Esempio n. 1
0
 private void OnEnable()
 {
     _mystate  = CharCoordinatorStates.NotInitialized;
     _myIchar  = GetComponent <ICharacterAnim>();
     character = GetComponent <Dweller3rdPerson>();
     agent     = GetComponent <NavMeshAgent>();
 }
Esempio n. 2
0
    public void ActivateAgent()
    {
        agent.enabled = true;
        if (agent.isActiveAndEnabled)
        {
            // print("ACTIVIA");
        }
        else
        {
            // print("POOP");
        }
        AgentIsAwake = true;

        _mystate = CharCoordinatorStates.Initialized;
    }
Esempio n. 3
0
 void USeAI()
 {
     if (agent.remainingDistance > agent.stoppingDistance)
     {
         character.Move(agent.desiredVelocity, false, false);
     }
     else //reached destination
     {
         if (!NOtStartedWalking)
         {
             print("started Nav To TArget");
             _mystate          = CharCoordinatorStates.MovingToTarget;
             NOtStartedWalking = true;
         }
         character.Move(Vector3.zero, false, false);
     }
     CheckIfReached();
 }
Esempio n. 4
0
 void CheckIfReached()
 {
     if (!agent.pathPending)
     {
         if (agent.remainingDistance <= agent.stoppingDistance)
         {
             if (!agent.hasPath || agent.velocity.sqrMagnitude == 0f)
             {
                 if (!arrived)
                 {
                     print("NOW WE HERE");
                     DoUseAi = false;
                     arrived = true;
                     character.Reset_ReachedRot();
                     _mystate = CharCoordinatorStates.RotatingToPlace;
                 }
             }
         }
     }
 }
Esempio n. 5
0
 void RotationCompleted()
 {
     print("fin trn");
     _mystate = CharCoordinatorStates.Interacting;
 }