Beispiel #1
0
 private void Update()
 {
     if (isOn)
     {
         timer += Time.deltaTime;
         if (timer >= duration)
         {
             isOn  = false;
             timer = 0;
             OnFreezeStateChanged?.Invoke(isOn);
         }
     }
 }
Beispiel #2
0
 public void FreezeEnemies(float duration)
 {
     this.duration = duration;
     isOn          = true;
     OnFreezeStateChanged?.Invoke(isOn);
 }