void Start() { _inventory = GetComponent<Player_Inventory>(); Debug.Assert(_inventory != null); _stateChanger = GetComponent<Player_StateChanger>(); Debug.Assert(_stateChanger != null); _hudModel = GetComponent<HUD_Model>(); Debug.Assert(_hudModel != null); }
private void Start() { _energyFiller = GameObject.Find("EnergyFiller").GetComponent <Image>(); Debug.Assert(_energyFiller != null); _fuelFiller = GameObject.Find("FuelFiller").GetComponent <Image>(); Debug.Assert(_fuelFiller != null); _hudModel = GetComponent <HUD_Model>(); Debug.Assert(_hudModel != null); _energyFiller.fillAmount = _hudModel.currentEnergy / _hudModel.maxEnergy; _fuelFiller.fillAmount = _hudModel.currentFuel / _hudModel.maxFuel; _hudModel.HudUpdate += UpdateHUD; }
private void OnTriggerExit(Collider other) { if (other.tag == GameManager_References._playerTag) { Debug.Log("Player exits city collider"); HUD_Model hudModel = other.GetComponent <HUD_Model>(); if (hudModel == null) { return; } hudModel.CanPlayerSurvive(); } }
private void OnTriggerEnter(Collider other) { if (other.tag == GameManager_References._playerTag) { Debug.Log("Player enters city collider"); HUD_Model hudModel = other.GetComponent <HUD_Model>(); if (hudModel == null) { return; } hudModel.checkPoint.position = transform.position; hudModel.StopCoroutine("DrainPowertype"); } }