// 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();
         }
     }
 }
Example #2
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
     if (gamestates.Count > 0)
     {
         currentStateIdx = 0;
         currentState    = gamestates[currentStateIdx];
         currentState.OnStateStart();
     }
 }
Example #3
0
 public virtual void OnStateUpdate()
 {
     onUpdateEvent.Invoke();
     if (roundtime > 0)
     {
         if (Time.time >= timer)
         {
             Gameflow.NextState();
         }
     }
 }