示例#1
0
    void FixedUpdate()
    {
        //Debug.Log(currentState);
        //Debug.Log(agent.destination);
        //Debug.Log(damageableObject);
        //Debug.Log(agent.remainingDistance);

        currentState.UpdateStates();

        if (currentState == attackState)
        {
            if (chaseTarget == null)
            {
                currentState = targetWayPoint;
            }
            else if (chaseTarget != null)
            {
                float dist = Vector3.Distance(chaseTarget.position, transform.position);

                if (dist >= 1500)
                {
                    chaseTarget = null;
                }
            }
        }
        //else if (currentState != attackState)
        //{
        //}
    }
示例#2
0
 void Start()
 {
     currentState = targetWayPoint;
 }