adjust vfx & invoke function

master
tigerchen 6 years ago
parent 310d684049
commit 25e9ccfae8
  1. 6
      Unity-19050-01_ForstCoronation/Assets/Scenes/Ice.unity
  2. 21
      Unity-19050-01_ForstCoronation/Assets/Scripts/DebugUI.cs
  3. 5948
      Unity-19050-01_ForstCoronation/Assets/Visual Effect Graphs/iceVFX_2018.vfx

@ -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:

@ -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