Exemplo n.º 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);
    }
Exemplo n.º 2
0
 public void SSActionEvent
 (
     SSAction source,
     SSActionEventType events = SSActionEventType.Competeted,
     int intParam             = 0,
     string strParam          = null,
     Object objectParam       = null
 )
 {
 }
Exemplo n.º 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);
    }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
    }
Exemplo n.º 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);
    }
Exemplo n.º 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;
     }
 }
Exemplo n.º 8
0
 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;
     }
 }
Exemplo n.º 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();
    }
Exemplo n.º 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");
     }
 }
Exemplo n.º 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;
 }
Exemplo n.º 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);        //逐条执行动作
    }
Exemplo n.º 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;
    }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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();
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 19
0
 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);
 }
Exemplo n.º 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);
    }
Exemplo n.º 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);
        }
    }
Exemplo n.º 22
0
    public static PhysicsMoveToAction GetSSAction(float speed)

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

        action.speed = speed;

        action.originPosition = SSAction.getRandomStartPoint();

        return(action);
    }
Exemplo n.º 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);
     }
 }
Exemplo n.º 24
0
 //动作结束后
 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);
     }
 }
Exemplo n.º 25
0
 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);
 }
Exemplo n.º 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();
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 28
0
    // 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);
    }
Exemplo n.º 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);
    }
Exemplo n.º 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;
 }