示例#1
0
    void Move()
    {
        Vector3 move = Vector3.zero;

        if (botState == SM_BotState.PlayerControl)
        {
            move = PlayerController.moveDirection;
        }

        if (move != Vector3.zero)
        {
            botAction = SM_BotAction.Move;
        }

        if (move.x != 0)
        {
            Quaternion rotation = Quaternion.LookRotation(thisTransform.TransformDirection(new Vector3(move.x, 0, 0)));
            thisTransform.rotation = Quaternion.RotateTowards(thisTransform.rotation, rotation, speedRotate * Time.deltaTime);

            if (move.z == 0)
            {
                move.z = 1;
            }
        }

        UpdateAnimator(move);
    }
示例#2
0
 void ProcessAction()
 {
     if (supportBotController != null)
     {
         supportBotController.ProcessAction(this);
     }
     else
     {
         botAction = SM_BotAction.Wait;
     }
 }
示例#3
0
 public void ChangeAction(int nextState = 0)
 {
     botAction = (SM_BotAction)nextState;
 }