|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic; |
|
|
|
using UnityEngine; |
|
|
|
using UnityEngine; |
|
|
|
using UnityEngine.Experimental.VFX; |
|
|
|
using UnityEngine.Experimental.VFX; |
|
|
|
using UnityEngine.UI; |
|
|
|
using UnityEngine.UI; |
|
|
|
|
|
|
|
using UltraCombos.Configuration; |
|
|
|
|
|
|
|
|
|
|
|
public class DebugUI : MonoBehaviour |
|
|
|
public class DebugUI : MonoBehaviour |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -13,9 +14,20 @@ public class DebugUI : MonoBehaviour |
|
|
|
public GameObject target; |
|
|
|
public GameObject target; |
|
|
|
public GameObject emitter; |
|
|
|
public GameObject emitter; |
|
|
|
public GameObject button; |
|
|
|
public GameObject button; |
|
|
|
public float growingSpeed; |
|
|
|
|
|
|
|
public string stat = "wait"; |
|
|
|
public string stat = "wait"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
|
|
|
[Range(0f, 0.02f)] |
|
|
|
|
|
|
|
public float growingSpeed; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
|
|
|
[Range(10, 30)] |
|
|
|
|
|
|
|
public float fadeSpeed; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
|
|
|
|
[Range(0f, 0.5f)] |
|
|
|
|
|
|
|
public float smooth; |
|
|
|
|
|
|
|
|
|
|
|
float spawn_t; |
|
|
|
float spawn_t; |
|
|
|
float total_t; |
|
|
|
float total_t; |
|
|
|
float lerp_val; |
|
|
|
float lerp_val; |
|
|
|
@ -35,6 +47,7 @@ public class DebugUI : MonoBehaviour |
|
|
|
// Update is called once per frame |
|
|
|
// Update is called once per frame |
|
|
|
void Update() |
|
|
|
void Update() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
updateVFX(); |
|
|
|
if (Input.GetKeyDown(KeyCode.A)) |
|
|
|
if (Input.GetKeyDown(KeyCode.A)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
debugMode = !debugMode; |
|
|
|
debugMode = !debugMode; |
|
|
|
@ -62,7 +75,6 @@ public class DebugUI : MonoBehaviour |
|
|
|
{ |
|
|
|
{ |
|
|
|
lerp_val = 1; |
|
|
|
lerp_val = 1; |
|
|
|
stat = "completed"; |
|
|
|
stat = "completed"; |
|
|
|
//vfx.SendEvent("Completed"); |
|
|
|
|
|
|
|
StartCoroutine("sendCompleted"); |
|
|
|
StartCoroutine("sendCompleted"); |
|
|
|
setButtonInteractable(true); |
|
|
|
setButtonInteractable(true); |
|
|
|
button.GetComponent<Text>().text = stat; |
|
|
|
button.GetComponent<Text>().text = stat; |
|
|
|
@ -86,30 +98,9 @@ public class DebugUI : MonoBehaviour |
|
|
|
lerp_val = Mathf.Clamp(lerp_val, 0, 1); |
|
|
|
lerp_val = Mathf.Clamp(lerp_val, 0, 1); |
|
|
|
vfx.SetFloat("_LerpVal", lerp_val); |
|
|
|
vfx.SetFloat("_LerpVal", lerp_val); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Vector3 base_pos = baseEmitter.GetComponent<Transform>().position; |
|
|
|
Vector3 base_pos = baseEmitter.GetComponent<Transform>().position; |
|
|
|
Vector3 target_pos = target.GetComponent<Transform>().position; |
|
|
|
Vector3 target_pos = target.GetComponent<Transform>().position; |
|
|
|
|
|
|
|
|
|
|
|
emitter.GetComponent<Transform>().position = Vector3.Lerp(base_pos, target_pos, lerp_val); |
|
|
|
emitter.GetComponent<Transform>().position = Vector3.Lerp(base_pos, target_pos, lerp_val); |
|
|
|
/* |
|
|
|
|
|
|
|
if (debugMode && Input.GetMouseButtonDown(0)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
ray = Camera.main.ScreenPointToRay(Input.mousePosition); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GameObject selected_obj = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 200.0f)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
selected_obj = hit.collider.gameObject; |
|
|
|
|
|
|
|
Debug.Log("hit!!" + selected_obj.name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(selected_obj != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
selected_obj.GetComponent<Renderer>().material.color = new Color(255, 100, 100); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
IEnumerator sendCompleted() |
|
|
|
IEnumerator sendCompleted() |
|
|
|
@ -161,9 +152,12 @@ public class DebugUI : MonoBehaviour |
|
|
|
|
|
|
|
|
|
|
|
private void setButtonInteractable(bool _stat) |
|
|
|
private void setButtonInteractable(bool _stat) |
|
|
|
{ |
|
|
|
{ |
|
|
|
//GameObject g = GameObject.Find("Grow"); |
|
|
|
|
|
|
|
//GameObject v = GameObject.Find("Vanish"); |
|
|
|
|
|
|
|
//g.GetComponent<Button>().interactable = _stat; |
|
|
|
|
|
|
|
button.GetComponentInParent<Button>().interactable = _stat; |
|
|
|
button.GetComponentInParent<Button>().interactable = _stat; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void updateVFX() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
vfx.SetFloat("Fade Speed", fadeSpeed); |
|
|
|
|
|
|
|
vfx.SetFloat("Smooth", smooth); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|