Exemplo n.º 1
0
    private void Wander()
    {
        if (m_DeaggroTimer <= 0.0f && inViewCone())
        {
            AudioManager.PlaySound("BidgeScream", transform.position);
            state = BidgeState.Chasing;
            m_Agent.destination = target.position;
            return;
        }

        //Go to Random Wander point if at Current Wander Point
        if (Vector3.Distance(transform.position, m_Agent.destination) <= 2.0f)
        {
            setRandomTarget();
        }
    }
Exemplo n.º 2
0
    private void Chase()
    {
        var diff = target.position - transform.position;

        m_Agent.destination = target.position;
        //print(abs);

        //If the Player is Outside the View Distance
        if (m_DeaggroTimer > 0 || !inViewCone())
        {
            state = BidgeState.Wandering;

            if (Vector3.Distance(transform.position, m_Agent.destination) <= 2.0f)
            {
                setRandomTarget();
            }
        }
    }
Exemplo n.º 3
0
 public void StopChasing()
 {
     currentTimer = m_DeaggroTimer;
     state        = BidgeState.Wandering;
     setRandomTarget();
 }