private void Empty() { _collider.enabled = false; _playerCharging = false; _fuelComponent = null; if (GameEventsManager.OnFuelStopCharging != null) { GameEventsManager.OnFuelStopCharging(); } }
private void OnTriggerEnter(Collider other) { _fuelComponent = other.GetComponent <FuelConsumptionComponent>(); if (_fuelComponent != null) { _playerCharging = true; if (GameEventsManager.OnFuelStartCharging != null) { GameEventsManager.OnFuelStartCharging(); } } }
private void OnTriggerExit(Collider other) { _fuelComponent = other.GetComponent <FuelConsumptionComponent>(); if (_fuelComponent != null) { _fuelComponent = null; _playerCharging = false; if (GameEventsManager.OnFuelStopCharging != null) { GameEventsManager.OnFuelStopCharging(); } } }
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>(); }