// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.K)) { currentHealth -= (maximumHealth * 0.2f); healthBar.SetDamage(0.2f); } Move(); HealthBarUpdate(); CheckEnemyState(); TakeAction(); }
// Update is called once per frame void Update() { Move(); CheckLineOfSight(); CheckEnemyState(); TakeAction(); if (Input.GetKeyDown(KeyCode.K)) { currentHealth -= 1.0f; healthBar.SetDamage(0.1f); } }