diff --git a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Prefabs/RawImage.prefab b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Prefabs/RawImage.prefab index 27e5695..694f9a5 100644 --- a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Prefabs/RawImage.prefab +++ b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Prefabs/RawImage.prefab @@ -38,7 +38,7 @@ RectTransform: m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 300, y: 300} + m_SizeDelta: {x: 200, y: 200} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &2142686115215515799 CanvasRenderer: @@ -88,6 +88,9 @@ MonoBehaviour: id: 0 fade_speed: 0.05 stat: 0 + alpha: 0 + destroy_timer: 0 + CanDsetroy: 0 --- !u!114 &1996081109 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs index ba8738e..21cbba0 100644 --- a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs +++ b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs @@ -9,71 +9,57 @@ public class movieController : MonoBehaviour { DShowMoviePlayer player; public int id; - //public tuio_event tuio_event; public float fade_speed = 0.02f; public int stat; - float c; - //Vector2 pos, pre_pos; - //public Transform trans; + public float alpha; + public float destroy_timer; + public bool CanDsetroy; + float wait_sec = 2f; void Awake() { player = GetComponent(); - //trans = GetComponent(); + CanDsetroy = true; + stat = 1; } void Start() { //player = GetComponent(); GetComponent().color = Color.clear; - //pos = Vector2.zero; } - // Update is called once per frame void Update() { -#if false - transform.gameObject.SetActive(true); - - trans = GetComponent(); - //Debug.Log(stat); - pre_pos = pos; - - if (tuio_event.tuio_input.touchCount > 0 && id != -1) + if(stat == 0){ + alpha = 0; + stat = 1; + } + else if (stat == 1) { - - transform.gameObject.SetActive(true); - ////////////////////// - /// - /* - int t_c = tuio_event.tuio_input.touchCount; - if (id == t_c) - { - //id -= 1; - Debug.Log("error"); - } - //Debug.Log("id = " + id + " / touch count = " + t_c); - if (id >= 0) + alpha += fade_speed; + if (alpha >= 1) { - pos = tuio_event.tuio_input.GetTouch(id).position; + alpha = 1; + stat = 2; } - else - pos = pre_pos; - GetComponent().position = new Vector3(pos.x, pos.y, 0); - */ + } -#endif - if (stat == 1) + else if (stat == 3) { - c += fade_speed; - if(c > 1) + float t = Time.time; + if (t - destroy_timer > wait_sec) { - c = 1; - stat = 2; + //Debug.Log("fade"); + alpha -= fade_speed; + if (alpha < 0 && CanDsetroy) + { + Destroy(this.gameObject); + } } - GetComponent().color = new Color(1f, 1f, 1f, c); - } - + + } + GetComponent().color = new Color(1f, 1f, 1f, alpha); } void OnEnable() @@ -83,17 +69,22 @@ public class movieController : MonoBehaviour GetComponent().enabled = true; } //Debug.Log("Hi"); - //Debug.Log(id.ToString()); + stat = 1; - c = 0f; - Vector3 rot_axis = new Vector3(0, 0, 1); - Vector3 mid_pt = new Vector3(GetComponent().position.x, GetComponent().position.y, 0); - float rand_deg = Random.Range(0, 360); - GetComponent().Rotate(rot_axis, rand_deg); + alpha = 0f; + rotateImg(); } void OnDestroy() { //Debug.Log("Bye"); } + + public void rotateImg() + { + Vector3 rot_axis = new Vector3(0, 0, 1); + Vector3 mid_pt = new Vector3(GetComponent().position.x, GetComponent().position.y, 0); + float rand_deg = Random.Range(0, 360); + GetComponent().Rotate(rot_axis, rand_deg); + } } diff --git a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs index 96b730e..326208d 100644 --- a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs +++ b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs @@ -9,6 +9,8 @@ public class tuio_event : MonoBehaviour public Transform canvas; //public UltraCombos.GlobalMKHookInput tuio_input; Dictionary movies = new Dictionary(); + Dictionary pre_pos = new Dictionary(); + void Update() { var touches = TUIOManager.Instance.touches; @@ -23,103 +25,69 @@ public class tuio_event : MonoBehaviour movie = g.AddComponent(); movie.id = id; movies.Add(id, movie); + movie.transform.position = touches[id].position; + pre_pos.Add(id, touches[id].position); } else //update - movie = movies[id]; + { + if (Time.frameCount % 10 == 0) + { + float delta_pos = Vector2.Distance(pre_pos[id], touches[id].position); + if (delta_pos > 200) + { + Debug.Log("generate new one"); + GameObject g = Instantiate(img, canvas); + int clone_id = id + Random.Range(5000, 10000); + g.name = clone_id.ToString(); + movie = g.AddComponent(); + movie.id = clone_id; + movies.Add(clone_id, movie); + movie.transform.position = pre_pos[id]; + movie.transform.localRotation = movies[id].transform.localRotation; + movie.alpha = 0.9f; + + movies[id].stat = 0; + movies[id].transform.position = touches[id].position; + movies[id].CanDsetroy = false; + movies[id].rotateImg(); + pre_pos[id] = touches[id].position; + } + else + { + //movies[id].transform.position = touches[id].position; + } + } + else + { + movie = movies[id]; + } + } //update or after adding //Debug.Log("Update"); - movie.transform.position = touches[id].position; - + //movie.transform.position = touches[id].position; } var removes = new HashSet(); foreach (var id in movies.Keys) { if (touches.ContainsKey(id) == false) // remove - { - Debug.Log("Remove"); - Destroy(movies[id].gameObject); + { + //Destroy(movies[id].gameObject); //movies.Remove(id); removes.Add(id); } } foreach (var id in removes) - movies.Remove(id); - } -#else - // Start is called before the first frame update - public GameObject img; - public GameObject canvas; - public UltraCombos.GlobalMKHookInput tuio_input; - - List cur_ids = new List(); - List pre_ids = new List(); - - int pre_count; - int cur_count; - - void Start() - { - cur_count = 0; - } - - void Update() - { - reset_id(); - pre_count = cur_count; - pre_ids.Clear(); - cur_ids.ForEach(i => pre_ids.Add(i)); - - cur_count = tuio_input.touchCount; - cur_ids.Clear(); - - for (int i = 0; i < cur_count; i++) - { - cur_ids.Add(tuio_input.GetTouch(i).fingerId); - } - - if (cur_count > pre_count) // Add { - //Debug.Log("Add"); - for (int i = 0; i < cur_count; i++) + if (movies[id].stat == 2 || movies[id].stat == 3) { - int f_id = tuio_input.GetTouch(i).fingerId; - bool isOldTouch = pre_ids.Contains(f_id); - if (isOldTouch == false) - { - GameObject g = Instantiate(img, canvas.GetComponent()); - g.name = f_id.ToString(); - //g.GetComponent().id = i; - } + movies[id].stat = 3; + movies[id].destroy_timer = Time.time; + movies[id].CanDsetroy = true; + movies.Remove(id); + Debug.Log("Remove"); } - } - else if (cur_count < pre_count) // Remove - { - //Debug.Log("Remove"); - int exit_id; - for (int i = 0; i < pre_count; i++) - { - int _id = pre_ids[i]; - bool isExitTouch = !cur_ids.Contains(_id); - if (isExitTouch) - { - exit_id = _id; - //GameObject.Find(_id.ToString()).GetComponent().stat = 2; - Destroy(GameObject.Find(_id.ToString())); - } - } - } - reset_id(); - } - - void reset_id() - { - GameObject[] objs = GameObject.FindGameObjectsWithTag("onFoot"); - //Debug.Log(objs.Length); - for (int i = 0; i < objs.Length; i++) - { - objs[i].GetComponent().id = i - 1; - Debug.Log(objs[i].name + " / id = " + objs[i].GetComponent().id.ToString()); + //movies[id].destroy_timer = Time.time; } } #endif diff --git a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/New UltraCombos.DShowClip.asset b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/New UltraCombos.DShowClip.asset index 8514bad..8ac65e0 100644 --- a/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/New UltraCombos.DShowClip.asset +++ b/08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/New UltraCombos.DShowClip.asset @@ -13,5 +13,5 @@ MonoBehaviour: m_Name: New UltraCombos.DShowClip m_EditorClassIdentifier: m_VideoLocation: 1 - m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Material\1928-01-D.avi + m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Material\Video_buttombracket.avi animationClip: {fileID: 0} diff --git a/Unity-19050-01_ForstCoronation/Assets/Scenes/Ice.unity b/Unity-19050-01_ForstCoronation/Assets/Scenes/Ice.unity index f797a8c..ce358dd 100644 --- a/Unity-19050-01_ForstCoronation/Assets/Scenes/Ice.unity +++ b/Unity-19050-01_ForstCoronation/Assets/Scenes/Ice.unity @@ -237,7 +237,7 @@ Light: m_Type: 2 m_Color: {r: 1, g: 1, b: 1, a: 1} m_Intensity: 47.746483 - m_Range: 20.754486 + m_Range: 50 m_SpotAngle: 30 m_CookieSize: 10 m_Shadows: @@ -1309,9 +1309,9 @@ MonoBehaviour: m_EditorClassIdentifier: m_ExecuteInEditor: 1 m_Bindings: - - {fileID: 1090188931} - - {fileID: 1090188930} - {fileID: 1090188929} + - {fileID: 1090188930} + - {fileID: 1090188931} m_VisualEffect: {fileID: 1090188927} --- !u!1 &1216109995 GameObject: diff --git a/Unity-19050-01_ForstCoronation/Assets/Scenes/Ice_Profiles/PostProcessing Profile.asset b/Unity-19050-01_ForstCoronation/Assets/Scenes/Ice_Profiles/PostProcessing Profile.asset index 9c1c837..50b23ef 100644 --- a/Unity-19050-01_ForstCoronation/Assets/Scenes/Ice_Profiles/PostProcessing Profile.asset +++ b/Unity-19050-01_ForstCoronation/Assets/Scenes/Ice_Profiles/PostProcessing Profile.asset @@ -88,10 +88,10 @@ MonoBehaviour: value: 0 postExposure: overrideState: 1 - value: -0.36 + value: -0.6 contrast: overrideState: 1 - value: 80 + value: 100 mixerRedOutRedIn: overrideState: 0 value: 100 diff --git a/Unity-19050-01_ForstCoronation/Assets/Scripts/DebugUI.cs b/Unity-19050-01_ForstCoronation/Assets/Scripts/DebugUI.cs index 431e568..78bf38b 100644 --- a/Unity-19050-01_ForstCoronation/Assets/Scripts/DebugUI.cs +++ b/Unity-19050-01_ForstCoronation/Assets/Scripts/DebugUI.cs @@ -61,13 +61,17 @@ public class DebugUI : MonoBehaviour { cur_blob_count = TUIOManager.Instance.touches.Count; - if(cur_blob_count == 3 && stat == "completed") + if (button.GetComponentInParent