Example #1
0
    public void moveCharacter(GameObject role, Vector3 middle_pos, Vector3 end_pos, float speed)
    {
        SSAction action1 = CCMoveToAction.GetSSAction(middle_pos, speed);
        SSAction action2 = CCMoveToAction.GetSSAction(end_pos, speed);

        CharaMove = CCSequenceAction.GetSSAction(1, 0, new List <SSAction> {
            action1, action2
        });
        this.RunAction(role, CharaMove, this);
    }
 public void SSActionEvent
 (
     SSAction source,
     SSActionEventType events = SSActionEventType.Competeted,
     int intParam             = 0,
     string strParam          = null,
     Object objectParam       = null
 )
 {
 }
Example #3
0
    public void moveRole(GameObject role, Vector3 middle_pos, Vector3 end_pos, float speed)
    {
        SSAction action1 = SSMoveToAction.GetSSAction(middle_pos, speed);
        SSAction action2 = SSMoveToAction.GetSSAction(end_pos, speed);

        moveRoleToLandorBoat = SequenceAction.GetSSAcition(1, 0, new List <SSAction> {
            action1, action2
        });
        this.RunAction(role, moveRoleToLandorBoat, this);
    }
Example #4
0
 //实现接口ISSActionCallback
 public void SSActionEvent(SSAction source, SSActionEventType events = SSActionEventType.Competeted, int intParam = 0, string strParam = null, Object objectParam = null)
 {
     if (source is PhysicMoveAction)
     {
         DiskNumber--;
         DiskFactory df = Singleton <DiskFactory> .Instance;
         df.FreeDisk(source.gameobject);
         FreeSSAction(source);
     }
 }
Example #5
0
    public void moveCha(GameObject Cha, Vector3 middle_pos, Vector3 end_pos, float speed)
    {
        SSAction action1 = SSMoveToAction.GetSSAction(middle_pos, speed);
        SSAction action2 = SSMoveToAction.GetSSAction(end_pos, speed);

        moveChaToCoastorBoat = SequenceAction.GetSSAcition(1, 0, new List <SSAction> {
            action1, action2
        });
        this.RunAction(Cha, moveChaToCoastorBoat, this);
    }
Example #6
0
    public void moveCharacterAction(GameObject character, Vector3 middle_pos, Vector3 end_pos, float speed)
    {
        SSAction action1 = CCMoveToAction.GetSSAction(middle_pos, speed);
        SSAction action2 = CCMoveToAction.GetSSAction(end_pos, speed);

        ccmoveCharacter = CCSequenceAction.GetSSAction(1, 0, new List <SSAction> {
            action1, action2
        });                                                                                            //1表示做一次动作,0表示从初始action1开始
        this.RunAction(character, ccmoveCharacter, this);
    }
Example #7
0
 public void SSActionEvent(SSAction source, SSActionEventType events = SSActionEventType.Completed, int intParam = 0, string strParam = null, Object objParam = null)
 {
     disks.RecycleDisk(source.gameObject);
     seq.Remove(source as CCMoveToAction);
     source.destory = true;
     if (FirstSceneController.times >= 30)
     {
         sceneController.flag = 1;
     }
 }
 public void DestroyAllActions()
 {
     foreach (KeyValuePair <int, SSAction> kv in actions)
     {
         SSAction ac = kv.Value;
         ac.agent.velocity = Vector3.zero;
         ac.agent.ResetPath();
         ac.destroy = true;
     }
 }
Example #9
0
// 提供了运行一个新动作的方法。该方法把游戏对象与动作绑定,并绑定该动作事件的消息接收者。
    public void RunAction(GameObject gameobject, SSAction action, ISSActionCallback manager)
    {
        action.gameobject = gameobject;
        action.transform = gameobject.transform;
        action.callback = manager;
        action.destroy = false;
        action.enable = true;
        waitingAdd.Add(action);
        action.Start();
    }
Example #10
0
 public void SSActionEvent(SSAction source, SSActionEventType events = SSActionEventType.Completed, int intParam = 0, string strParam = null, Object objectParam = null)
 {
     if (source.transform.tag == "boat")
     {
         sceneController.boat_move_to_left  = false;
         sceneController.boat_move_to_right = false;
         sceneController.game_over_judge();
         Debug.Log("callback");
     }
 }
Example #11
0
 public void SSActionEvent(SSAction source, SSActionEventType events = SSActionEventType.Competeted,
                           int intParam = 0, string strParam = null, Object objectParam = null)
 {
     if (!source.gameobject.GetComponent <DiskData2>().hit)
     {
         scoreRecorder.miss();
     }
     diskFactory.freeDisk(source.gameobject);
     source.gameobject.GetComponent <DiskData2>().hit = false;
 }
Example #12
0
 public void SSActionEvent(SSAction source, SSActionEventType events = SSActionEventType.Completed, int intParam = 0, string strParam = null, Object objParam = null)
 {
     ufo.RecycleUFO(source.gameObject);
     seq.Remove(source as PhysicsEmitAction);
     source.destory = true;
     if (FirstSceneController.times >= 30)
     {
         sceneCtrl.flag = 1;
     }
 }
    public void moveRole(GameObject role, Vector3 middle_pos, Vector3 end_pos, float speed)
    {
        SSAction action1 = SSMoveToAction.GetSSAction(middle_pos, speed);         // GetSSAction添加动作到动作列表
        SSAction action2 = SSMoveToAction.GetSSAction(end_pos, speed);

        action_seq = SequenceAction.GetSSAcition(1, 0, new List <SSAction> {
            action1, action2
        });                                            // 1, 0 对应动作是否重复等
        this.RunAction(role, action_seq, this);        //逐条执行动作
    }
Example #14
0
 //动作结束后
 public void SSActionEvent(SSAction source, bool catchState)
 {
     if (catchState)
     {
         addDirectMovement(source.GameObject);
     }
     else
     {
         addRandomMovement(source.GameObject, true);
     }
 }
    public void MoveRole(GameObject role, Vector3 middlePosition, Vector3 endPosition, float speed)
    {
        SSAction step1 = CCMoveToAction.GetSSAction(middlePosition, speed);
        SSAction step2 = CCMoveToAction.GetSSAction(endPosition, speed);

        moveRole = CCSequenceAction.GetSSAction(1, 0, new List <SSAction> {
            step1, step2
        });
        this.RunAction(role, moveRole, this);
        sceneController.moving = true;
    }
Example #16
0
 public void SSActionEvent(SSAction source, SSActionEventType events = SSActionEventType.Competeted,
                           int intParam = 0, string strParam = null, UnityEngine.Object objectParam = null)
 {
     if (source is UFOFlyAction)
     {
         UFONumber--;
         UFOFactory ufof = Singleton <UFOFactory> .Instance;
         ufof.recoverUFO(source.gameobject);
         releaseSSACtion(source);
     }
 }
Example #17
0
 public void RunAction(
     GameObject obj,
     SSAction act,
     ISSActionCallback manager)
 {
     act.Obj      = obj;
     act.Tra      = obj.transform;
     act.Callback = manager;
     waitAdd.Add(act);
     act.Start();
 }
Example #18
0
 public void SSActionEvent(SSAction source, SSActionEventType events = SSActionEventType.Completed, int Param = 0, string strParam = null, Object objectParam = null)
 {
     source.destory = false;
     this.start++;
     if (this.start >= sequence.Count)
     {
         this.start   = 0;
         this.destory = true;
         this.callback.SSActionEvent(this);
     }
 }
 public void SSActionEvent(SSAction source,
                           SSActionEventType events = SSActionEventType.Completed,
                           int intParam             = 0,
                           string strParam          = null,
                           Object objectParam       = null)
 {
     source.gameObject.GetComponent <Rigidbody>().useGravity  = false;
     source.gameObject.GetComponent <Rigidbody>().velocity    = Vector3.zero;
     source.gameObject.GetComponent <Rigidbody>().isKinematic = true;
     sceneController.ReturnUFO(source.gameObject);
 }
Example #20
0
    public void moveCharacter(GameObject ch, Vector3 middle, Vector3 dest, float speed)
    {
        //先到岸边,再上船
        SSAction action1 = SSMoveToAction.GetSSAction(middle, speed);
        SSAction action2 = SSMoveToAction.GetSSAction(dest, speed);

        movech = SequenceAction.GetSSAcition(1, 0, new List <SSAction> {
            action1, action2
        });                                                                                       //船动作组合
        this.RunAction(ch, movech, this);
    }
Example #21
0
    public void SSActionEvent(SSAction source, SSActionEventType events = SSActionEventType.Completed, int intPram = 0
                              , string strParm = null, Object objParm = null)
    {
        if (source is CCFlyAction)
        {
            diskNumber--;
            Singleton <DiskFactory> .Instance.freeDisk(source.gameObject);

            freeSSAction(source);
        }
    }
    public static PhysicsMoveToAction GetSSAction(float speed)

    {
        PhysicsMoveToAction action = ScriptableObject.CreateInstance <PhysicsMoveToAction>();

        action.speed = speed;

        action.originPosition = SSAction.getRandomStartPoint();

        return(action);
    }
Example #23
0
 public void SSActionEvent(SSAction source,
                           SSActionEventType events       = SSActionEventType.Competeted,
                           int intParam                   = 0,
                           string strParam                = null,
                           UnityEngine.Object objectParam = null)
 {
     if (source is CCFlyAction)
     {
         diskNumber--;
         source.gameobject.SetActive(false);
     }
 }
 //动作结束后
 public void SSActionEvent(SSAction source, SSActionEventType eventType = SSActionEventType.Completed,
                           SSActionTargetType intParam = SSActionTargetType.Normal, string strParam = null, object objParam = null)
 {
     if (intParam == SSActionTargetType.Normal)
     {
         addRandomMovement(source.gameObject, true);
     }
     else
     {
         addDirectMovement(source.gameObject);
     }
 }
 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);
 }
Example #26
0
 public void ClearAction()
 {
     foreach (int _key in waitDel)
     {
         SSAction act = actions [_key];
         actions.Remove(_key);
         DestroyObject(act);
     }
     waitAdd.Clear();
     waitDel.Clear();
     actions.Clear();
 }
Example #27
0
 public void SSActionEvent(SSAction source, GameObject arrow = null)
 {
     if (arrow != null)
     {
         ArrowTremble tremble = ArrowTremble.GetSSAction();
         this.RunAction(arrow, tremble, this);
     }
     else
     {
         Controllor scene_controller = (Controllor)SSDirector.GetInstance().CurrentSceneControllor;
     }
 }
    // Update is called once per frame
    // protected new void Update()
    // {

    // }

    public void SSActionEvent(SSAction source,
                              SSActionEventType events = SSActionEventType.Completed,
                              int intParam             = 0,
                              string strParam          = null,
                              Object objectParam       = null)
    {
        // Debug.Log("飞碟被击中或飞出视界,动作结束,飞碟被销毁");
        // if (source.transform != null) {
        //     Destroy(source.transform.gameObject);
        // }
        factory.FreeDisk(source.transform.gameObject);
    }
Example #29
0
    public void moveRole(GameObject role, Vector3 middlePos, Vector3 endPos, float speed)
    {
        //两段移动
        SSAction action1 = SSMoveToAction.GetSSAction(middlePos, speed);
        SSAction action2 = SSMoveToAction.GetSSAction(endPos, speed);

        //repeat=1,start=0,两个动作
        roleMove = SequenceAction.GetSSAcition(1, 0, new List <SSAction> {
            action1, action2
        });
        this.RunAction(role, roleMove, this);
    }
Example #30
0
 public void SSEventAction(SSAction source, SSActionEventType events = SSActionEventType.COMPLETED, int intParam = 0, string strParam = null, Object objParam = null)
 {
     if (actionState)
     {
         walkLeft();
     }
     else
     {
         idle();
     }
     actionState = !actionState;
 }