adjust vfx & invoke function

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

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

@ -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<Button>().interactable)
{
enterVanish();
}
else if (cur_blob_count > 0 && stat == "wait")
{
enterGrow();
if (cur_blob_count == 0 && stat == "completed")
{
enterVanish();
}
else if (cur_blob_count > 0 && stat == "wait")
{
enterGrow();
}
}
updateVFX();
@ -99,19 +103,19 @@ public class DebugUI : MonoBehaviour
lerp_val = 1;
stat = "completed";
StartCoroutine("sendCompleted");
setButtonInteractable(true);
Invoke("setButtonInteractable", 1);
button.GetComponent<Text>().text = stat;
Debug.Log(stat);
}
}
else if(stat == "vanishing")
{
lerp_val -= growingSpeed * 0.4f;
lerp_val -= growingSpeed;
if(lerp_val <= 0)
{
lerp_val = 0;
stat = "wait";
setButtonInteractable(true);
Invoke("setButtonInteractable", 1);
button.GetComponent<Text>().text = stat;
Debug.Log(stat);
}
@ -149,7 +153,7 @@ public class DebugUI : MonoBehaviour
public void enterGrow()
{
setButtonInteractable(false);
setButtonInteractable();
stat = "growing";
vfx.SendEvent("Emit");
vfx.SetBool("isGrowing", true);
@ -159,7 +163,7 @@ public class DebugUI : MonoBehaviour
public void enterVanish()
{
setButtonInteractable(false);
setButtonInteractable();
stat = "vanishing";
vfx.SetBool("isGrowing", false);
button.GetComponent<Text>().text = stat;
@ -173,13 +177,14 @@ public class DebugUI : MonoBehaviour
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()
{
}
}

Loading…
Cancel
Save