예제 #1
0
 private void Update()
 {
     Animate();
     CheckVisible();
     if (updateFrameIndex > IMainMenu.GetUpdateFramesPerSecond() / 10)
     {
         if (canDoSomething)
         {
             AI();
         }
         else
         {
             if (attacking && who_under_attack)
             {
                 Vector3    look = Vector0.Flat(who_under_attack.trans.position - trans.position);
                 Quaternion n    = Quaternion.LookRotation(look);
                 trans.rotation = Quaternion.Slerp(trans.rotation, n, Time.deltaTime * 3);
             }
             Stop();
         }
         if (savable.health < 1 || (hasNoArms && hasNoLegs) || hasNoHead)
         {
             Die();
         }
         updateFrameIndex = 0;
     }
     updateFrameIndex++;
 }