コード例 #1
0
    private void Consume()
    {
        _currentAmount -= _consumingTimeStep * Time.deltaTime;

        if (GameEventsManager.OnFuelAmountChanged != null)
        {
            GameEventsManager.OnFuelAmountChanged(_currentAmount / _maxAmount);
        }

        if (_currentAmount <= 0)
        {
            if (GameEventsManager.OnFuelEmpty != null)
            {
                GameEventsManager.OnFuelEmpty();
            }
        }
    }