示例#1
0
    public void NormalAI()
    {
        if (null != _agent && null != Player)
        {
            if (_distance <= _attackRange)
            {
                UpdateState(global::State._state);
                AiNormalstate.Attack(_agent, Player);
            }
            else if (_distance <= _pursueRange)
            {
                Debug.Log(global::State._state);
                Debug.Log(_agent);
                Debug.Log(Player);
                UpdateState(global::State._state);
                if (_agent != null)
                {
                    AiNormalstate.Pursuit(_agent, Player);
                }
            }

            else if (_distance > _pursueRange)
            {
                UpdateState(global::State._state);
                //AiNormalstate.Seeking(_agent);
            }
            else
            {
                UpdateState(global::State._state);
                AiNormalstate.Idle();
            }
        }
        else
        {
            print("Could not find refference to _agent or Player. ");
        }
    }