// Update is called once per frame void Update() { m_objtime.text = ((int)m_time).ToString(); AkiVACO.XEventTimer obj = this.transform.GetChild(0).GetComponent <AkiVACO.XEventTimer>(); if (obj) { m_time = obj.nowTime; } }
public static void StartOneShot(GameObject obj, float time, UnityAction call) { XEventTimer ev = obj.AddComponent <XEventTimer>(); ev.isLoop = false; ev.isOnShot = true; ev.time = time; ev.AddListener(call); ev.StartTimer(); }
public static void AttachLoopTimer(out XEventTimer outTimer, GameObject obj, float time, UnityAction call = null) { XEventTimer ev = obj.AddComponent <XEventTimer>(); ev.isLoop = true; ev.isOnShot = false; ev.time = time; if (call != null) { ev.AddListener(call); } outTimer = ev; }