add configuration code

master
tigerchen 6 years ago
parent 720562046a
commit 55c28e7296
  1. 4
      .gitmodules
  2. 46
      Unity-19050-01_ForstCoronation/Assets/Scripts/DebugUI.cs
  3. 1
      Unity-19050-01_ForstCoronation/Packages/manifest.json

4
.gitmodules vendored

@ -34,3 +34,7 @@
[submodule "_Package/jp.keijiro.klak.spout"]
path = _Package/jp.keijiro.klak.spout
url = "https://github.com/keijiro/KlakSpout#upm"
[submodule "_Package/com.ultracombos.configuration"]
path = _Package/com.ultracombos.configuration
url = https://github.com/UltraCombos/com.ultracombos.configuration.git
branch = master

@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.VFX;
using UnityEngine.UI;
using UltraCombos.Configuration;
public class DebugUI : MonoBehaviour
{
@ -13,9 +14,20 @@ public class DebugUI : MonoBehaviour
public GameObject target;
public GameObject emitter;
public GameObject button;
public float growingSpeed;
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 total_t;
float lerp_val;
@ -35,6 +47,7 @@ public class DebugUI : MonoBehaviour
// Update is called once per frame
void Update()
{
updateVFX();
if (Input.GetKeyDown(KeyCode.A))
{
debugMode = !debugMode;
@ -62,7 +75,6 @@ public class DebugUI : MonoBehaviour
{
lerp_val = 1;
stat = "completed";
//vfx.SendEvent("Completed");
StartCoroutine("sendCompleted");
setButtonInteractable(true);
button.GetComponent<Text>().text = stat;
@ -86,30 +98,9 @@ public class DebugUI : MonoBehaviour
lerp_val = Mathf.Clamp(lerp_val, 0, 1);
vfx.SetFloat("_LerpVal", lerp_val);
Vector3 base_pos = baseEmitter.GetComponent<Transform>().position;
Vector3 target_pos = target.GetComponent<Transform>().position;
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()
@ -161,9 +152,12 @@ public class DebugUI : MonoBehaviour
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;
}
void updateVFX()
{
vfx.SetFloat("Fade Speed", fadeSpeed);
vfx.SetFloat("Smooth", smooth);
}
}

@ -1,6 +1,7 @@
{
"dependencies": {
"com.ultracombos.grpc": "file:<project>/../../../_Package/com.ultracombos.grpc",
"com.ultracombos.configuration": "file:<project>/../../../_Package/com.ultracombos.configuration",
"com.unity.collab-proxy": "1.2.16",
"com.unity.ext.nunit": "1.0.0",
"com.unity.ide.rider": "1.1.0",

Loading…
Cancel
Save