// Update on UI and Health private void TextFailed( ) { // do something on UI and on health system as well. healthController.TakeDamage(1); textManager.HealthUpdate(healthController.GetHealth( )); if (healthController.IsItDead( )) { textManager.LostGameMessage( ); inputManager.DeactivateOrActivateInput( ); return; } textManager.ResetWord(); }
private void Awake( ) { gameStateController = GameStateController.GetSingletonInstance( ); wordFileReader = WordFileController.GetSingletonInstance( ); healthController = HealthController.GetSingletonInstance( ); healthController.InitializeHealth( ); textManager = GameObject.Find("TextAnchor").GetComponent <TextManager> ( ); textManager.HealthUpdate(healthController.GetHealth( )); inputManager = gameObject.GetComponent <InputManager> ( ); levelManager = gameObject.GetComponent <LevelManager> ( ); }
// Update is called once per frame void Update() { Bar.transform.localScale = new Vector3(Background.transform.localScale.x * healthSystem.GetHealth(), Background.transform.localScale.y, Background.transform.localScale.z); }