Пример #1
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Return))
        {
            TogglePause();
        }

        if (!m_player.GetComponent <Health>().IsAlive)
        {
            // end the game
            EndGame();
        }
    }
Пример #2
0
 public void HitPlayer()
 {
     if (m_animator.GetBool("IsAttacking"))
     {
         m_player.GetComponent <Health>().ModifyHealth(-m_attackDamage);
     }
 }
Пример #3
0
    // 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));
    }