Example #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();
 }
Example #2
0
 public void countdown()
 {
     totalUnit -= 1;
     if (totalUnit == 0)
     {
         OnZero.Invoke();
     }
 }
Example #3
0
            public void Decrease()
            {
                Count--;
                if (Count != 0)
                {
                    return;
                }

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

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

        OnChanged?.Invoke(this);
    }
Example #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);
            }
        }