public void SSActionEvent(SSAction source, int intParam = 0, GameObject objectParam = null)
 {
     if (intParam == 0)
     {
         action = PatrolFollowAction.GetSSAction();
     }
     else if (intParam == 1)
     {
         action = PatrolAction.GetSSAction();
     }
     this.RunAction(objectParam, action, this);
 }
Exemple #2
0
 public void SSActionEvent(SSAction source, int intParam = 0, GameObject objectParam = null)
 {
     if (intParam == 0)
     {
         PatrolFollowAction follow = PatrolFollowAction.GetSSAction(objectParam.gameObject.GetComponent <PatrolData>().player);
         this.RunAction(objectParam, follow, this);
     }
     else
     {
         GoPatrolAction move = GoPatrolAction.GetSSAction(objectParam.gameObject.GetComponent <PatrolData>().start_position);
         this.RunAction(objectParam, move, this);
         Singleton <GameEventManager> .Instance.PlayerEscape();
     }
 }
Exemple #3
0
 //针对这次游戏新增的一个方法,用于增加不同的动作
 public void SSActionEvent(SSAction source, bool catching = false, GameObject objectParam = null)
 {
     //不捉玩家时,自由移动
     if (!catching)
     {
         GoPatrolAction goPatrolAction = GoPatrolAction.GetSSAction(objectParam.gameObject.GetComponent <PatrolData>().start_position);
         RunAction(objectParam, goPatrolAction, this);
         Singleton <GameEventManager> .Instance.PlayerEscape();
     }
     //捕捉玩家时,跟着玩家走
     else
     {
         PatrolFollowAction patrolFollowAction = PatrolFollowAction.GetSSAction(objectParam.gameObject.GetComponent <PatrolData>().player);
         RunAction(objectParam, patrolFollowAction, this);
     }
 }
Exemple #4
0
 //根据传入参数来选择执行不同的动作
 public void SSActionEvent(SSAction source, int intParam = 0, GameObject objectParam = null)
 {
     if (intParam == 0)
     {
         //侦查兵跟随玩家
         PatrolFollowAction follow = PatrolFollowAction.GetSSAction(objectParam.gameObject.GetComponent <PatrolData>().player);
         this.RunAction(objectParam, follow, this);
     }
     else
     {
         //侦察兵按照初始位置开始继续巡逻
         PatrolMoveAction move = PatrolMoveAction.GetSSAction(objectParam.gameObject.GetComponent <PatrolData>().start_position);
         this.RunAction(objectParam, move, this);
         //玩家逃脱
         Singleton <GameEventManager> .Instance.AddScore();
     }
 }
Exemple #5
0
 public void SSActionEvent(SSAction source,
                           SSActionEventType events = SSActionEventType.Compeleted,
                           int intParam             = 0,
                           string strParam          = null,
                           GameObject objectParam   = null)
 {
     //回调函数,动作执行完后调用
     if (intParam == 0)
     {
         //开始跟随玩家
         PatrolFollowAction follow = PatrolFollowAction.GetSSAction(sceneController.player);
         this.RunAction(objectParam, follow, this);
     }
     else
     {
         //丢失目标,继续巡逻
         PatrolMoveAction move = PatrolMoveAction.GetSSAction(objectParam.gameObject.GetComponent <PatrolData>().initPosition);
         this.RunAction(objectParam, move, this);
         //玩家逃脱
         Singleton <GameEventManager> .Instance.PlayerEscape();
     }
 }