Dave Boyle

Think everything is here functionality wise other than the automation of connect…

…ing as client / server, and the swipe up motion to start video
Showing 39 changed files with 320 additions and 14 deletions
1 +fileFormatVersion: 2
2 +guid: 791b1242d0b0f83468035586df2a9671
3 +folderAsset: yes
4 +timeCreated: 1465157424
5 +licenseType: Pro
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 0feb2ccb20a6da64c81241422b8c5c0a
3 +folderAsset: yes
4 +timeCreated: 1463940038
5 +licenseType: Pro
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 8b78a419897fb474b9b7f7b3c6c7713c
3 +folderAsset: yes
4 +timeCreated: 1463940118
5 +licenseType: Pro
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: fcd7c007ea2a27644acf7bf27ef5510a
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 70a2cdd0400aedd42857e41e706c9353
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: e0247c67986905045887098ba77164a7
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 4d9fb302e590e5545b0079f9a35d74f0
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: e390dbc35c9e98f49b66848fc8322b2b
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 82a9901f420d30c4eb03e0b745e598bc
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 506de2ce97091614bb0db1d1e2725d7a
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: a098b4bb6355e414fa43939d60c7ff32
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 2785961627a74b84b95d33fdfd93472d
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: ac00bae8b1b291e4f931a229a0f98cb6
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 69e635a483a42974c9c056daab77fd56
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 5fb6339d8ea45bb46969ab49e37c72e8
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: e432cdd2f33958044921a1c3065b6f1f
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 3a6dc3b8061e86740942bde694c4d6ed
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 064538dc3e1eb2247b5d02178b80cbe2
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: ee7e134b52631994cad0da7d94ad8bfc
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: d2a75f58480c5d3449821a5f864c09a3
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: bd8b8f4f612f6674bb6c2ba4c3f5482e
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: f04d3c25adfae6248b99337d3297308d
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 7fd7a06093df48f46a6588ad521af626
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: ee1a034798804d54f81d70acbe8e5acd
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: b1f03c8dbdcc3f54da7db702aa46f000
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 4ea3cca300b1baf45bcfd34f07adcd1e
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: af33f08d9ecc56649815e59c8a4ece76
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: a9ce5f6af4a975140acd1969d7fc59f6
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: ac1169caed899e24e8aba9e9f1ad7b8a
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: a98eaee85fd018849978f62277c19a39
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: dbe94c65d3ae87c4f86510a598a9bbb4
3 +folderAsset: yes
4 +DefaultImporter:
5 + userData:
6 + assetBundleName:
7 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 16ed3d282118c5b49b3edf005e427cf0
3 +folderAsset: yes
4 +timeCreated: 1463938841
5 +licenseType: Pro
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: 7485df7669ded804cb3402554f165eeb
3 +folderAsset: yes
4 +timeCreated: 1462936077
5 +licenseType: Pro
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: c94c955445dabbd40856b18173670fc2
3 +folderAsset: yes
4 +timeCreated: 1462936060
5 +licenseType: Pro
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
1 +fileFormatVersion: 2
2 +guid: a84a17318e2de2d448b5440b29a570e1
3 +folderAsset: yes
4 +timeCreated: 1463927989
5 +licenseType: Pro
6 +DefaultImporter:
7 + userData:
8 + assetBundleName:
9 + assetBundleVariant:
...@@ -5,33 +5,42 @@ public class AppManager : Singleton<AppManager> ...@@ -5,33 +5,42 @@ public class AppManager : Singleton<AppManager>
5 { 5 {
6 public AVProWindowsMediaMovie movieScript; 6 public AVProWindowsMediaMovie movieScript;
7 public Canvas serverCanvas; 7 public Canvas serverCanvas;
8 - public CanvasGroup inactiveCanvas; 8 + public CanvasGroup inUseCanvas;
9 + public CanvasGroup timeoutCanvas;
10 + public CanvasGroup videoCanvas;
11 + public float tweenTime;
9 public float appTimeout; 12 public float appTimeout;
10 13
11 - void Start () 14 + public void Initialize()
12 { 15 {
13 - inactiveCanvas.alpha = 1; 16 + inUseCanvas.alpha = 1;
17 + timeoutCanvas.alpha = 0;
18 + videoCanvas.alpha = 0;
14 StartCoroutine(AppTimeout()); 19 StartCoroutine(AppTimeout());
15 } 20 }
16 21
17 private bool _videoPlaying = false; 22 private bool _videoPlaying = false;
23 + private float _timeout = 0;
24 + private bool _didTimeout = false;
18 25
19 private IEnumerator AppTimeout() 26 private IEnumerator AppTimeout()
20 { 27 {
21 while(true) 28 while(true)
22 { 29 {
23 - float timeout = 0; 30 + _timeout = 0;
24 - bool didTimeout = false; 31 + _didTimeout = false;
25 32
26 while (!_videoPlaying) 33 while (!_videoPlaying)
27 { 34 {
28 - timeout += Time.deltaTime; 35 + if (!_didTimeout)
29 - print(timeout); 36 + _timeout += Time.deltaTime;
30 37
31 - if (timeout >= appTimeout && ! didTimeout) 38 + if (_timeout >= appTimeout && !_didTimeout)
32 { 39 {
33 - didTimeout = true; 40 + _didTimeout = true;
34 - print("timeout"); 41 +
42 + TweenCanvasGroup(inUseCanvas, 0, tweenTime);
43 + TweenCanvasGroup(timeoutCanvas, 1, tweenTime);
35 } 44 }
36 45
37 yield return null; 46 yield return null;
...@@ -41,8 +50,20 @@ public class AppManager : Singleton<AppManager> ...@@ -41,8 +50,20 @@ public class AppManager : Singleton<AppManager>
41 } 50 }
42 } 51 }
43 52
53 + public void ResetTimer()
54 + {
55 + if (_videoPlaying) return;
56 +
57 + TweenCanvasGroup(inUseCanvas, 1, tweenTime);
58 + TweenCanvasGroup(timeoutCanvas, 0, tweenTime);
59 +
60 + _timeout = 0;
61 + _didTimeout = false;
62 + }
63 +
44 public void DestroyServerCanvas() 64 public void DestroyServerCanvas()
45 { 65 {
66 + if (serverCanvas != null)
46 Destroy(serverCanvas.gameObject); 67 Destroy(serverCanvas.gameObject);
47 } 68 }
48 69
...@@ -55,8 +76,6 @@ public class AppManager : Singleton<AppManager> ...@@ -55,8 +76,6 @@ public class AppManager : Singleton<AppManager>
55 movieScript._filename = filename; 76 movieScript._filename = filename;
56 movieScript.LoadMovie(true); 77 movieScript.LoadMovie(true);
57 78
58 - TweenCanvasGroup(inactiveCanvas, 0, 1);
59 -
60 if (movieCoroutine != null) 79 if (movieCoroutine != null)
61 StopCoroutine(movieCoroutine); 80 StopCoroutine(movieCoroutine);
62 81
...@@ -65,11 +84,26 @@ public class AppManager : Singleton<AppManager> ...@@ -65,11 +84,26 @@ public class AppManager : Singleton<AppManager>
65 84
66 private IEnumerator MoviePlaying() 85 private IEnumerator MoviePlaying()
67 { 86 {
87 + StopCoroutine("AppTimeout");
88 +
68 _videoPlaying = true; 89 _videoPlaying = true;
69 - while (movieScript.MovieInstance.IsPlaying) 90 + TweenCanvasGroup(videoCanvas, 1, tweenTime);
70 - yield return null; 91 + //TweenCanvasGroup(inUseCanvas, 0, tweenTime);
92 + //TweenCanvasGroup(timeoutCanvas, 0, tweenTime);
93 +
94 + float holdTime = movieScript.MovieInstance.DurationSeconds - tweenTime;
95 +
96 + yield return new WaitForSeconds(holdTime);
97 +
98 + TweenCanvasGroup(videoCanvas, 0, tweenTime);
99 + TweenCanvasGroup(inUseCanvas, 1, tweenTime);
100 +
101 + yield return new WaitForSeconds(tweenTime);
71 102
72 _videoPlaying = false; 103 _videoPlaying = false;
104 + movieScript.UnloadMovie();
105 +
106 + StartCoroutine("AppTimeout");
73 } 107 }
74 108
75 public void TweenCanvasGroup(CanvasGroup group, float alpha, float time) 109 public void TweenCanvasGroup(CanvasGroup group, float alpha, float time)
...@@ -79,6 +113,8 @@ public class AppManager : Singleton<AppManager> ...@@ -79,6 +113,8 @@ public class AppManager : Singleton<AppManager>
79 113
80 public void TweenCanvasGroup(CanvasGroup group, float alpha, float time, System.Action onComplete) 114 public void TweenCanvasGroup(CanvasGroup group, float alpha, float time, System.Action onComplete)
81 { 115 {
116 + iTween.Stop(group.gameObject);
117 +
82 Hashtable hash = new Hashtable() 118 Hashtable hash = new Hashtable()
83 { 119 {
84 { "from", group.alpha }, 120 { "from", group.alpha },
......
...@@ -18,6 +18,8 @@ public class NetworkUser : NetworkBehaviour ...@@ -18,6 +18,8 @@ public class NetworkUser : NetworkBehaviour
18 } 18 }
19 else 19 else
20 { 20 {
21 + AppManager.Instance.Initialize();
22 +
21 string path = Application.streamingAssetsPath + "/videoSettings.json"; 23 string path = Application.streamingAssetsPath + "/videoSettings.json";
22 if (!File.Exists(path)) 24 if (!File.Exists(path))
23 { 25 {
...@@ -66,6 +68,9 @@ public class NetworkUser : NetworkBehaviour ...@@ -66,6 +68,9 @@ public class NetworkUser : NetworkBehaviour
66 68
67 void Update () 69 void Update ()
68 { 70 {
71 + if (Input.touchCount > 0)
72 + CmdResetTimer();
73 +
69 if (Input.GetKeyDown(KeyCode.Alpha1)) 74 if (Input.GetKeyDown(KeyCode.Alpha1))
70 { 75 {
71 var thisDict = _files[0]; 76 var thisDict = _files[0];
...@@ -80,6 +85,12 @@ public class NetworkUser : NetworkBehaviour ...@@ -80,6 +85,12 @@ public class NetworkUser : NetworkBehaviour
80 } 85 }
81 86
82 [Command] 87 [Command]
88 + private void CmdResetTimer()
89 + {
90 + AppManager.Instance.ResetTimer();
91 + }
92 +
93 + [Command]
83 public void CmdLoadVideo(string file) 94 public void CmdLoadVideo(string file)
84 { 95 {
85 AppManager.Instance.LoadMovie(file); 96 AppManager.Instance.LoadMovie(file);
......