// Update is called once per frame void Update() { if (isDoubleClickToNext) { if (Input.GetMouseButtonDown(0)) { if (Time.time - prevLClickTime <= doubleClickTime) { Gameflow.NextState(); } prevLClickTime = Time.time; } if (Input.GetMouseButtonDown(1)) { if (Time.time - prevRClickTime <= doubleClickTime) { Gameflow.PrevState(); } prevRClickTime = Time.time; } } else { if (Input.GetMouseButtonDown(0)) { Gameflow.NextState(); } if (Input.GetMouseButtonDown(0)) { Gameflow.PrevState(); } } }
// Start is called before the first frame update void Start() { instance = this; if (gamestates.Count > 0) { currentStateIdx = 0; currentState = gamestates[currentStateIdx]; currentState.OnStateStart(); } }
public virtual void OnStateUpdate() { onUpdateEvent.Invoke(); if (roundtime > 0) { if (Time.time >= timer) { Gameflow.NextState(); } } }