Esempio n. 1
0
 public void ResetXPosition()
 {
     OnZero?.Invoke();
     player.transform.position     = new Vector3(0, player.transform.position.y, 0);
     mainCamera.transform.position = new Vector3(platformConfig.CameraOffset, mainCamera.transform.position.y, mainCamera.transform.position.z);
     OnReady?.Invoke();
 }
Esempio n. 2
0
 public void countdown()
 {
     totalUnit -= 1;
     if (totalUnit == 0)
     {
         OnZero.Invoke();
     }
 }
Esempio n. 3
0
            public void Decrease()
            {
                Count--;
                if (Count != 0)
                {
                    return;
                }

                OnZero?.Invoke();
                _allowIncrease.Set();
            }
Esempio n. 4
0
    public void UpdateCurrent(int amount)
    {
        current -= amount;

        if (current > max)
        {
            current = max;
        }
        else if (current <= 0)
        {
            OnZero?.Invoke(this);
        }

        OnChanged?.Invoke(this);
    }
Esempio n. 5
0
        private void Update()
        {
            if (!IsCounting)
            {
                return;
            }

            time += Time.deltaTime;

            if (time > 1.0f)
            {
                Count--;
                time -= 1.0f;
            }

            if (Count == 0)
            {
                IsCounting = false;
                OnZero?.Invoke(this, EventArgs.Empty);
            }
        }