Esempio n. 1
0
 void Button3Click()
 {
     id = 3;
     if (effect3 == 0)
     {
         effect3 = GameFrameEntry.GetModule <EffectModule>().Show(3, Button3.transform);
     }
     else
     {
         GameFrameEntry.GetModule <EffectModule>().Close(effect3);
         effect3 = 0;
     }
     MsgDispatcher.SendMessage(GlobalEventType.TaskFinish, id);
     if (infoUI == 0)
     {
         GameFrameEntry.GetModule <UIModule>().Show <InfoUI>();
         infoUI = 1;
     }
     else
     {
         GameFrameEntry.GetModule <UIModule>().Close <InfoUI>();
         infoUI = 0;
     }
     Refresh();
 }
Esempio n. 2
0
 void Button2Click()
 {
     id = 2;
     GameFrameEntry.GetModule <EffectModule>().Show(2, Button2.transform);
     MsgDispatcher.SendMessage(GlobalEventType.TaskFinish, id);
     Refresh();
 }
Esempio n. 3
0
 void Button4Click()
 {
     id = 4;
     Button4.transform.DOLocalMoveY(400f, 0.3f).SetLoops(2, LoopType.Yoyo);
     MsgDispatcher.SendMessage(GlobalEventType.TaskFinish, id);
     Refresh();
     ChangeState();
 }
Esempio n. 4
0
 void Button1Click()
 {
     id = 1;
     if (effect1 == 0)
     {
         effect1 = GameFrameEntry.GetModule <EffectModule>().Show(1, Button1.transform.position + Vector3.up * 400, new Vector3(-90, 0, 0), Button1.transform);
     }
     else
     {
         GameFrameEntry.GetModule <EffectModule>().Close(effect1);
         effect1 = 0;
     }
     MsgDispatcher.SendMessage(GlobalEventType.TaskFinish, id);
     Refresh();
 }
Esempio n. 5
0
        /// <summary>添加事件监听</summary>
        override protected void Awake()
        {
            MsgDispatcher.AddEventListener(TheSecondWorld.GlobalEventType.NowRotation, ShowRotation);
            offset        = InfoItem.GetComponent <RectTransform>().sizeDelta.x;
            targetPosList = new List <Vector3>();
            for (int i = 0; i < Grid.transform.childCount; i++)
            {
                targetPosList.Add(Grid.transform.GetChild(i).localPosition);
            }

            itemList = new List <InfoItem>();
            for (int i = 0; i < itemNum; i++)
            {
                InfoItem item = new InfoItem();
                item.Instantiate(InfoItem, Root.transform);
                item.transform.localPosition = new Vector3(-offset, targetPosList[i].y, 0);
                item.transform.DOLocalMove(targetPosList[i], 1).SetEase(Ease.OutBack).SetDelay(i * 0.1f);
                itemList.Add(item);
            }
            MsgDispatcher.SendMessage(TheSecondWorld.GlobalEventType.GetRotation);
        }
Esempio n. 6
0
        void TouchMove(float x, float y)
        {
            if (dot > 0)
            {
                offset = new Vector3(startPos.y - y, x - startPos.x, 0);
            }
            else
            {
                offset = new Vector3(y - startPos.y, x - startPos.x, 0);
            }
            Vector3 newRotation = transform.localRotation.eulerAngles - offset * Time.deltaTime * rotateRate;

            if (newRotation.x > 180)
            {
                newRotation.x = newRotation.x - 360;
            }
            newRotation.x = Mathf.Clamp(newRotation.x, -60, 60f);

            transform.localRotation = Quaternion.Euler(newRotation);
            MsgDispatcher.SendMessage(TheSecondWorld.GlobalEventType.NowRotation, transform.localRotation.eulerAngles);
            startPos = new Vector2(x, y);
        }
 void ReadyExitGame(object[] Args)
 {
     MsgDispatcher.SendMessage(GameFramework.GlobalEventType.MineGameExitLogic);
     ChangeState <ProcedureExitGame>(m_ProcedureOwner);
 }
Esempio n. 8
0
 void GetRotation(object[] arg)
 {
     MsgDispatcher.SendMessage(TheSecondWorld.GlobalEventType.NowRotation, transform.localRotation.eulerAngles);
 }
Esempio n. 9
0
 /// <summary>
 /// 退出游戏
 /// </summary>
 void ExitGame()
 {
     GameFramework.UserDataPrefs.OnSave();
     /*游戏自身逻辑处理完后调用退出游戏事件*/
     MsgDispatcher.SendMessage(GameFramework.GlobalEventType.ExitGame);
 }
Esempio n. 10
0
 private void SendComplete(int num)
 {
     MsgDispatcher.SendMessage(GlobalEventType.CHANGE_RESULT, 0, num.ToString());
 }
Esempio n. 11
0
 private void SendError(string content)
 {
     MsgDispatcher.SendMessage(GlobalEventType.CHANGE_RESULT, -1, content);
 }