// Update is called once per frame
    void Update()
    {
        switch (ca.GetState())
        {
        case Creature_AI.State.Wandering:
            Move(1.0f);
            break;

        case Creature_AI.State.MovingTo:
            GoTo(targetLocation);
            Move(1.0f);
            break;

        case Creature_AI.State.Fleeing:
            Move(flee_scale);
            break;

        case Creature_AI.State.Asleep:
            Stop();
            break;

        default:
            Stop();
            break;
        }
    }
Beispiel #2
0
 // Update is called once per frame
 void Update()
 {
     if (ca.GetState() != Creature_AI.State.Asleep)
     {
         if (!eyes_open)
         {
             OpenEyes();
         }
         CheckVision();
     }
     else
     {
         if (eyes_open)
         {
             CloseEyes();
         }
     }
 }