|
|
|
|
@ -9,7 +9,7 @@ using TUIO; |
|
|
|
|
public class DebugUI : MonoBehaviour |
|
|
|
|
{ |
|
|
|
|
public bool debugMode = true; |
|
|
|
|
public GameObject debugUI; |
|
|
|
|
public GameObject canvas; |
|
|
|
|
public VisualEffect vfx; |
|
|
|
|
public GameObject baseEmitter; |
|
|
|
|
public GameObject target; |
|
|
|
|
@ -35,7 +35,43 @@ public class DebugUI : MonoBehaviour |
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
[Range(1, 10)] |
|
|
|
|
public int lifetime = 5; |
|
|
|
|
public int vfx_lifetime = 5; |
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
[Range(10000, 60000)] |
|
|
|
|
public int vfx_ground_ice_spawn_rate = 30000; |
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
[Range(1000, 10000)] |
|
|
|
|
public int vfx_ground_flake_spawn_rate = 5000; |
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
[Range(100, 3000)] |
|
|
|
|
public int vfx_flying_flake_spawn_rate = 1000; |
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
[Range(0.1f, 0.8f)] |
|
|
|
|
public float vfx_min_frost_size = 0.3f; |
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
[Range(0.3f, 1f)] |
|
|
|
|
public float vfx_max_frost_size = 0.5f; |
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
[Range(0.01f, 0.5f)] |
|
|
|
|
public float vfx_min_spike_size = 0.1f; |
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
[Range(0.1f, 1f)] |
|
|
|
|
public float vfx_max_spike_size = 0.3f; |
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
[Range(0f, 0.1f)] |
|
|
|
|
public float vfx_min_flake_size = 0f; |
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
[Range(0.05f, 0.3f)] |
|
|
|
|
public float vfx_max_flake_size = 0.1f; |
|
|
|
|
|
|
|
|
|
float lerp_val; |
|
|
|
|
Vector3 final_pos; |
|
|
|
|
@ -46,7 +82,7 @@ public class DebugUI : MonoBehaviour |
|
|
|
|
{ |
|
|
|
|
QualitySettings.vSyncCount = 0; |
|
|
|
|
stat = "wait"; |
|
|
|
|
debugUI.SetActive(debugMode); |
|
|
|
|
canvas.SetActive(debugMode); |
|
|
|
|
button.GetComponent<Text>().text = stat; |
|
|
|
|
lerp_val = 0; |
|
|
|
|
cur_blob_count = 0; |
|
|
|
|
@ -75,43 +111,45 @@ public class DebugUI : MonoBehaviour |
|
|
|
|
if (Input.GetKeyDown(KeyCode.F1)) |
|
|
|
|
{ |
|
|
|
|
debugMode = !debugMode; |
|
|
|
|
debugUI.GetComponent<Canvas>().enabled = debugMode; |
|
|
|
|
canvas.GetComponent<Canvas>().enabled = debugMode; |
|
|
|
|
if (debugMode) |
|
|
|
|
{ |
|
|
|
|
showObject = true; |
|
|
|
|
setObjectVisible(showObject); |
|
|
|
|
} else |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
showObject = false; |
|
|
|
|
setObjectVisible(showObject); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (debugMode && Input.GetKeyDown(KeyCode.F2)){ |
|
|
|
|
else if (debugMode && Input.GetKeyDown(KeyCode.F2)) |
|
|
|
|
{ |
|
|
|
|
showObject = !showObject; |
|
|
|
|
setObjectVisible(showObject); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(stat == "growing") |
|
|
|
|
if (stat == "growing") |
|
|
|
|
{ |
|
|
|
|
lerp_val += growing_speed; |
|
|
|
|
if(lerp_val >= 1) |
|
|
|
|
if (lerp_val >= 1) |
|
|
|
|
{ |
|
|
|
|
lerp_val = 1; |
|
|
|
|
stat = "completed"; |
|
|
|
|
StartCoroutine("sendCompleted"); |
|
|
|
|
Invoke("setButtonInteractable", delay_sec); |
|
|
|
|
Invoke("switchButtonStat", delay_sec); |
|
|
|
|
button.GetComponent<Text>().text = stat; |
|
|
|
|
Debug.Log(stat); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if(stat == "vanishing") |
|
|
|
|
else if (stat == "vanishing") |
|
|
|
|
{ |
|
|
|
|
lerp_val -= growing_speed; |
|
|
|
|
if(lerp_val <= 0) |
|
|
|
|
if (lerp_val <= 0) |
|
|
|
|
{ |
|
|
|
|
lerp_val = 0; |
|
|
|
|
stat = "wait"; |
|
|
|
|
Invoke("setButtonInteractable", delay_sec); |
|
|
|
|
Invoke("switchButtonStat", delay_sec); |
|
|
|
|
button.GetComponent<Text>().text = stat; |
|
|
|
|
Debug.Log(stat); |
|
|
|
|
} |
|
|
|
|
@ -135,11 +173,11 @@ public class DebugUI : MonoBehaviour |
|
|
|
|
|
|
|
|
|
public void switchStat() |
|
|
|
|
{ |
|
|
|
|
if(stat == "wait") |
|
|
|
|
if (stat == "wait") |
|
|
|
|
{ |
|
|
|
|
enterGrow(); |
|
|
|
|
} |
|
|
|
|
else if(stat == "completed") |
|
|
|
|
else if (stat == "completed") |
|
|
|
|
{ |
|
|
|
|
enterVanish(); |
|
|
|
|
} |
|
|
|
|
@ -148,8 +186,8 @@ public class DebugUI : MonoBehaviour |
|
|
|
|
|
|
|
|
|
public void enterGrow() |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
setButtonInteractable(); |
|
|
|
|
switchButtonStat(); |
|
|
|
|
Camera.main.GetComponent<AudioSource>().Play(); |
|
|
|
|
stat = "growing"; |
|
|
|
|
vfx.SendEvent("Emit"); |
|
|
|
|
vfx.SetBool("isGrowing", true); |
|
|
|
|
@ -159,7 +197,7 @@ public class DebugUI : MonoBehaviour |
|
|
|
|
|
|
|
|
|
public void enterVanish() |
|
|
|
|
{ |
|
|
|
|
setButtonInteractable(); |
|
|
|
|
switchButtonStat(); |
|
|
|
|
stat = "vanishing"; |
|
|
|
|
vfx.SetBool("isGrowing", false); |
|
|
|
|
button.GetComponent<Text>().text = stat; |
|
|
|
|
@ -173,7 +211,7 @@ public class DebugUI : MonoBehaviour |
|
|
|
|
emitter.GetComponent<Renderer>().enabled = isShowed; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setButtonInteractable() |
|
|
|
|
private void switchButtonStat() |
|
|
|
|
{ |
|
|
|
|
bool _stat = button.GetComponentInParent<Button>().interactable; |
|
|
|
|
button.GetComponentInParent<Button>().interactable = !_stat; |
|
|
|
|
@ -181,6 +219,15 @@ public class DebugUI : MonoBehaviour |
|
|
|
|
|
|
|
|
|
void updateVFX() |
|
|
|
|
{ |
|
|
|
|
vfx.SetInt("lifetime", lifetime); |
|
|
|
|
vfx.SetInt("lifetime", vfx_lifetime); |
|
|
|
|
vfx.SetInt("ground_ice_spawn_rate", vfx_ground_ice_spawn_rate); |
|
|
|
|
vfx.SetInt("ground_flake_spawn_rate", vfx_ground_flake_spawn_rate); |
|
|
|
|
vfx.SetInt("flying_flake_spawn_rate", vfx_flying_flake_spawn_rate); |
|
|
|
|
vfx.SetFloat("min_frost_size", vfx_min_frost_size); |
|
|
|
|
vfx.SetFloat("max_frost_size", vfx_max_frost_size); |
|
|
|
|
vfx.SetFloat("min_spike_size", vfx_min_spike_size); |
|
|
|
|
vfx.SetFloat("max_spike_size", vfx_max_spike_size); |
|
|
|
|
vfx.SetFloat("min_flake_size", vfx_min_flake_size); |
|
|
|
|
vfx.SetFloat("max_flake_size", vfx_max_flake_size); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|