コード例 #1
0
    private void Empty()
    {
        _collider.enabled = false;
        _playerCharging   = false;
        _fuelComponent    = null;

        if (GameEventsManager.OnFuelStopCharging != null)
        {
            GameEventsManager.OnFuelStopCharging();
        }
    }
コード例 #2
0
    private void OnTriggerEnter(Collider other)
    {
        _fuelComponent = other.GetComponent <FuelConsumptionComponent>();

        if (_fuelComponent != null)
        {
            _playerCharging = true;

            if (GameEventsManager.OnFuelStartCharging != null)
            {
                GameEventsManager.OnFuelStartCharging();
            }
        }
    }
コード例 #3
0
    private void OnTriggerExit(Collider other)
    {
        _fuelComponent = other.GetComponent <FuelConsumptionComponent>();

        if (_fuelComponent != null)
        {
            _fuelComponent = null;

            _playerCharging = false;

            if (GameEventsManager.OnFuelStopCharging != null)
            {
                GameEventsManager.OnFuelStopCharging();
            }
        }
    }
コード例 #4
0
    private void Awake()
    {
        _collisionDetection = GetComponent <PushBackComponent>();

        if (_collisionDetection != null)
        {
            _collisionDetection.OnCollision += CollisionDetected;
        }

        SpeedBoostComponent speedBoost = GetComponent <SpeedBoostComponent>();

        if (speedBoost != null)
        {
            GameEventsManager.OnBoostActivated += BoostActivated;
        }

        _fuelComponent = GetComponent <FuelConsumptionComponent>();
    }