void Update() { if (Input.GetKeyDown(KeyCode.Return)) { TogglePause(); } if (!m_player.GetComponent <Health>().IsAlive) { // end the game EndGame(); } }
public void HitPlayer() { if (m_animator.GetBool("IsAttacking")) { m_player.GetComponent <Health>().ModifyHealth(-m_attackDamage); } }
// returns true if the enemy sees an object of interest private bool LookForObjectsOfInterestInFOV(ref Plane[] planes, Character_Player player) { if (player == null) { Debug.Log("null player"); } if (planes == null) { Debug.Log("Null planes"); } return(GeometryUtility.TestPlanesAABB(planes, player.GetComponent <Collider>().bounds)); }