LH 6 years ago
commit 94876b5156
  1. 5
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Prefabs/RawImage.prefab
  2. 83
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs
  3. 124
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs
  4. 2
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/New UltraCombos.DShowClip.asset
  5. 6
      Unity-19050-01_ForstCoronation/Assets/Scenes/Ice.unity
  6. 4
      Unity-19050-01_ForstCoronation/Assets/Scenes/Ice_Profiles/PostProcessing Profile.asset
  7. 21
      Unity-19050-01_ForstCoronation/Assets/Scripts/DebugUI.cs
  8. 17949
      Unity-19050-01_ForstCoronation/Assets/Visual Effect Graphs/iceVFX_2018.vfx

@ -38,7 +38,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0} 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} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2142686115215515799 --- !u!222 &2142686115215515799
CanvasRenderer: CanvasRenderer:
@ -88,6 +88,9 @@ MonoBehaviour:
id: 0 id: 0
fade_speed: 0.05 fade_speed: 0.05
stat: 0 stat: 0
alpha: 0
destroy_timer: 0
CanDsetroy: 0
--- !u!114 &1996081109 --- !u!114 &1996081109
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

@ -9,72 +9,58 @@ public class movieController : MonoBehaviour
{ {
DShowMoviePlayer player; DShowMoviePlayer player;
public int id; public int id;
//public tuio_event tuio_event;
public float fade_speed = 0.02f; public float fade_speed = 0.02f;
public int stat; public int stat;
float c; public float alpha;
//Vector2 pos, pre_pos; public float destroy_timer;
//public Transform trans; public bool CanDsetroy;
float wait_sec = 2f;
void Awake() void Awake()
{ {
player = GetComponent<DShowMoviePlayer>(); player = GetComponent<DShowMoviePlayer>();
//trans = GetComponent<Transform>(); CanDsetroy = true;
stat = 1;
} }
void Start() void Start()
{ {
//player = GetComponent<DShowMoviePlayer>(); //player = GetComponent<DShowMoviePlayer>();
GetComponent<RawImage>().color = Color.clear; GetComponent<RawImage>().color = Color.clear;
//pos = Vector2.zero;
} }
// Update is called once per frame
void Update() void Update()
{ {
#if false if(stat == 0){
transform.gameObject.SetActive(true); alpha = 0;
stat = 1;
trans = GetComponent<Transform>();
//Debug.Log(stat);
pre_pos = pos;
if (tuio_event.tuio_input.touchCount > 0 && id != -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); else if (stat == 1)
if (id >= 0)
{ {
pos = tuio_event.tuio_input.GetTouch(id).position; alpha += fade_speed;
if (alpha >= 1)
{
alpha = 1;
stat = 2;
} }
else
pos = pre_pos;
GetComponent<RectTransform>().position = new Vector3(pos.x, pos.y, 0);
*/
} }
#endif else if (stat == 3)
if (stat == 1)
{ {
c += fade_speed; float t = Time.time;
if(c > 1) if (t - destroy_timer > wait_sec)
{ {
c = 1; //Debug.Log("fade");
stat = 2; alpha -= fade_speed;
if (alpha < 0 && CanDsetroy)
{
Destroy(this.gameObject);
} }
GetComponent<RawImage>().color = new Color(1f, 1f, 1f, c);
} }
} }
GetComponent<RawImage>().color = new Color(1f, 1f, 1f, alpha);
}
void OnEnable() void OnEnable()
{ {
@ -83,17 +69,22 @@ public class movieController : MonoBehaviour
GetComponent<RawImage>().enabled = true; GetComponent<RawImage>().enabled = true;
} }
//Debug.Log("Hi"); //Debug.Log("Hi");
//Debug.Log(id.ToString());
stat = 1; stat = 1;
c = 0f; alpha = 0f;
Vector3 rot_axis = new Vector3(0, 0, 1); rotateImg();
Vector3 mid_pt = new Vector3(GetComponent<RectTransform>().position.x, GetComponent<RectTransform>().position.y, 0);
float rand_deg = Random.Range(0, 360);
GetComponent<RectTransform>().Rotate(rot_axis, rand_deg);
} }
void OnDestroy() void OnDestroy()
{ {
//Debug.Log("Bye"); //Debug.Log("Bye");
} }
public void rotateImg()
{
Vector3 rot_axis = new Vector3(0, 0, 1);
Vector3 mid_pt = new Vector3(GetComponent<RectTransform>().position.x, GetComponent<RectTransform>().position.y, 0);
float rand_deg = Random.Range(0, 360);
GetComponent<RectTransform>().Rotate(rot_axis, rand_deg);
}
} }

@ -9,6 +9,8 @@ public class tuio_event : MonoBehaviour
public Transform canvas; public Transform canvas;
//public UltraCombos.GlobalMKHookInput tuio_input; //public UltraCombos.GlobalMKHookInput tuio_input;
Dictionary<int, movieController> movies = new Dictionary<int, movieController>(); Dictionary<int, movieController> movies = new Dictionary<int, movieController>();
Dictionary<int, Vector2> pre_pos = new Dictionary<int, Vector2>();
void Update() void Update()
{ {
var touches = TUIOManager.Instance.touches; var touches = TUIOManager.Instance.touches;
@ -23,103 +25,69 @@ public class tuio_event : MonoBehaviour
movie = g.AddComponent<movieController>(); movie = g.AddComponent<movieController>();
movie.id = id; movie.id = id;
movies.Add(id, movie); movies.Add(id, movie);
}
else //update
movie = movies[id];
//update or after adding
//Debug.Log("Update");
movie.transform.position = touches[id].position; movie.transform.position = touches[id].position;
pre_pos.Add(id, touches[id].position);
} }
var removes = new HashSet<int>(); else //update
foreach (var id in movies.Keys)
{ {
if (touches.ContainsKey(id) == false) // remove if (Time.frameCount % 10 == 0)
{ {
Debug.Log("Remove"); float delta_pos = Vector2.Distance(pre_pos[id], touches[id].position);
Destroy(movies[id].gameObject); if (delta_pos > 200)
//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<int> cur_ids = new List<int>();
List<int> pre_ids = new List<int>();
int pre_count;
int cur_count;
void Start()
{ {
cur_count = 0; Debug.Log("generate new one");
} GameObject g = Instantiate(img, canvas);
int clone_id = id + Random.Range(5000, 10000);
void Update() g.name = clone_id.ToString();
{ movie = g.AddComponent<movieController>();
reset_id(); movie.id = clone_id;
pre_count = cur_count; movies.Add(clone_id, movie);
pre_ids.Clear(); movie.transform.position = pre_pos[id];
cur_ids.ForEach(i => pre_ids.Add(i)); movie.transform.localRotation = movies[id].transform.localRotation;
movie.alpha = 0.9f;
cur_count = tuio_input.touchCount; movies[id].stat = 0;
cur_ids.Clear(); movies[id].transform.position = touches[id].position;
movies[id].CanDsetroy = false;
movies[id].rotateImg();
for (int i = 0; i < cur_count; i++) pre_pos[id] = touches[id].position;
{
cur_ids.Add(tuio_input.GetTouch(i).fingerId);
} }
else
if (cur_count > pre_count) // Add
{
//Debug.Log("Add");
for (int i = 0; i < cur_count; i++)
{ {
int f_id = tuio_input.GetTouch(i).fingerId; //movies[id].transform.position = touches[id].position;
bool isOldTouch = pre_ids.Contains(f_id); }
if (isOldTouch == false) }
else
{ {
GameObject g = Instantiate(img, canvas.GetComponent<Transform>()); movie = movies[id];
g.name = f_id.ToString();
//g.GetComponent<movieController>().id = i;
} }
} }
//update or after adding
//Debug.Log("Update");
//movie.transform.position = touches[id].position;
} }
else if (cur_count < pre_count) // Remove var removes = new HashSet<int>();
{ foreach (var id in movies.Keys)
//Debug.Log("Remove");
int exit_id;
for (int i = 0; i < pre_count; i++)
{ {
int _id = pre_ids[i]; if (touches.ContainsKey(id) == false) // remove
bool isExitTouch = !cur_ids.Contains(_id);
if (isExitTouch)
{ {
exit_id = _id; //Destroy(movies[id].gameObject);
//GameObject.Find(_id.ToString()).GetComponent<movieController>().stat = 2; //movies.Remove(id);
Destroy(GameObject.Find(_id.ToString())); removes.Add(id);
}
}
} }
reset_id();
} }
foreach (var id in removes)
void reset_id()
{ {
GameObject[] objs = GameObject.FindGameObjectsWithTag("onFoot"); if (movies[id].stat == 2 || movies[id].stat == 3)
//Debug.Log(objs.Length);
for (int i = 0; i < objs.Length; i++)
{ {
objs[i].GetComponent<movieController>().id = i - 1; movies[id].stat = 3;
Debug.Log(objs[i].name + " / id = " + objs[i].GetComponent<movieController>().id.ToString()); movies[id].destroy_timer = Time.time;
movies[id].CanDsetroy = true;
movies.Remove(id);
Debug.Log("Remove");
}
//movies[id].destroy_timer = Time.time;
} }
} }
#endif #endif

@ -13,5 +13,5 @@ MonoBehaviour:
m_Name: New UltraCombos.DShowClip m_Name: New UltraCombos.DShowClip
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_VideoLocation: 1 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} animationClip: {fileID: 0}

@ -237,7 +237,7 @@ Light:
m_Type: 2 m_Type: 2
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 47.746483 m_Intensity: 47.746483
m_Range: 20.754486 m_Range: 50
m_SpotAngle: 30 m_SpotAngle: 30
m_CookieSize: 10 m_CookieSize: 10
m_Shadows: m_Shadows:
@ -1309,9 +1309,9 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_ExecuteInEditor: 1 m_ExecuteInEditor: 1
m_Bindings: m_Bindings:
- {fileID: 1090188931}
- {fileID: 1090188930}
- {fileID: 1090188929} - {fileID: 1090188929}
- {fileID: 1090188930}
- {fileID: 1090188931}
m_VisualEffect: {fileID: 1090188927} m_VisualEffect: {fileID: 1090188927}
--- !u!1 &1216109995 --- !u!1 &1216109995
GameObject: GameObject:

@ -88,10 +88,10 @@ MonoBehaviour:
value: 0 value: 0
postExposure: postExposure:
overrideState: 1 overrideState: 1
value: -0.36 value: -0.6
contrast: contrast:
overrideState: 1 overrideState: 1
value: 80 value: 100
mixerRedOutRedIn: mixerRedOutRedIn:
overrideState: 0 overrideState: 0
value: 100 value: 100

@ -61,7 +61,10 @@ public class DebugUI : MonoBehaviour
{ {
cur_blob_count = TUIOManager.Instance.touches.Count; cur_blob_count = TUIOManager.Instance.touches.Count;
if(cur_blob_count == 3 && stat == "completed") if (button.GetComponentInParent<Button>().interactable)
{
if (cur_blob_count == 0 && stat == "completed")
{ {
enterVanish(); enterVanish();
} }
@ -69,6 +72,7 @@ public class DebugUI : MonoBehaviour
{ {
enterGrow(); enterGrow();
} }
}
updateVFX(); updateVFX();
@ -99,19 +103,19 @@ public class DebugUI : MonoBehaviour
lerp_val = 1; lerp_val = 1;
stat = "completed"; stat = "completed";
StartCoroutine("sendCompleted"); StartCoroutine("sendCompleted");
setButtonInteractable(true); Invoke("setButtonInteractable", 1);
button.GetComponent<Text>().text = stat; button.GetComponent<Text>().text = stat;
Debug.Log(stat); Debug.Log(stat);
} }
} }
else if(stat == "vanishing") else if(stat == "vanishing")
{ {
lerp_val -= growingSpeed * 0.4f; lerp_val -= growingSpeed;
if(lerp_val <= 0) if(lerp_val <= 0)
{ {
lerp_val = 0; lerp_val = 0;
stat = "wait"; stat = "wait";
setButtonInteractable(true); Invoke("setButtonInteractable", 1);
button.GetComponent<Text>().text = stat; button.GetComponent<Text>().text = stat;
Debug.Log(stat); Debug.Log(stat);
} }
@ -149,7 +153,7 @@ public class DebugUI : MonoBehaviour
public void enterGrow() public void enterGrow()
{ {
setButtonInteractable(false); setButtonInteractable();
stat = "growing"; stat = "growing";
vfx.SendEvent("Emit"); vfx.SendEvent("Emit");
vfx.SetBool("isGrowing", true); vfx.SetBool("isGrowing", true);
@ -159,7 +163,7 @@ public class DebugUI : MonoBehaviour
public void enterVanish() public void enterVanish()
{ {
setButtonInteractable(false); setButtonInteractable();
stat = "vanishing"; stat = "vanishing";
vfx.SetBool("isGrowing", false); vfx.SetBool("isGrowing", false);
button.GetComponent<Text>().text = stat; button.GetComponent<Text>().text = stat;
@ -173,9 +177,10 @@ public class DebugUI : MonoBehaviour
emitter.GetComponent<Renderer>().enabled = isShowed; emitter.GetComponent<Renderer>().enabled = isShowed;
} }
private void setButtonInteractable(bool _stat) private void setButtonInteractable()
{ {
button.GetComponentInParent<Button>().interactable = _stat; bool _stat = button.GetComponentInParent<Button>().interactable;
button.GetComponentInParent<Button>().interactable = !_stat;
} }
void updateVFX() void updateVFX()

Loading…
Cancel
Save