public static GuardPatrolAction GetSSAction(Vector3 location)
    {
        GuardPatrolAction action = CreateInstance <GuardPatrolAction>();

        action.pos_x = location.x;
        action.pos_z = location.z;
        //设定移动矩形的边长
        action.move_length = Random.Range(5, 6);
        return(action);
    }
Esempio n. 2
0
 public void SSActionEvent(
     SSAction source, SSActionEventType events = SSActionEventType.Competeted,
     int intParam = 0, GameObject objectParam = null)
 {
     if (intParam == 0)
     {
         //追逐
         GuardFollowAction follow = GuardFollowAction.GetSSAction(player);
         this.RunAction(objectParam, follow, this);
     }
     else
     {
         //巡逻
         GuardPatrolAction move = GuardPatrolAction.GetSSAction(objectParam.gameObject.GetComponent <GuardData>().start_position);
         this.RunAction(objectParam, move, this);
         Singleton <GameEventManager> .Instance.PlayerEscape();
     }
 }
Esempio n. 3
0
 public void GuardPatrol(GameObject guard, GameObject _player)
 {
     player = _player;
     patrol = GuardPatrolAction.GetSSAction(guard.transform.position);
     this.RunAction(guard, patrol, this);
 }