Ejemplo n.º 1
0
 private void EventInit()
 {
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_炫耀一下").gameObject).onClick = delegate
     {
         ControlCenter.Instance.CaptureShare();
     };
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_Exit").gameObject).onClick = delegate
     {
         GameApp.Instance.SetGameState(GAME_STATE.HALL);
     };
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_再来一局").gameObject).onClick = delegate
     {
         if (DataCenter.Instance.gamedata.gameMode == GAME_MODE.自由匹配)
         {
             DealCommand.Instance.SendJoinRoom_自由匹配();
         }
         else if (DataCenter.Instance.gamedata.gameMode == GAME_MODE.创建房间)
         {
             DataCenter.Instance.GoToNextPlate();
             DealCommand.Instance.SendPrepare();
             GameApp.Instance.SetGameState(GAME_STATE.PREPARE);
         }
     };
 }
Ejemplo n.º 2
0
        private void InitDialogueItems()
        {
            ShowDialogue(true);
            UIGrid grid = GameUtility.FindDeepChild(gameObject, "Dialogue_Items").GetComponent <UIGrid>();

            List <Transform> childList = grid.GetChildList();

            for (int i = 0; i < childList.Count; i++)
            {
                grid.RemoveChild(childList[i]);
                childList[i].gameObject.SetActive(false);
            }

            for (int i = 0; i < Tags.Audio_Name.Chat.Boy_Chat.Length; i++)
            {
                GameObject go = GDFunc.CreateGameObject(DialogueItemObj, grid.transform);
                go.GetComponentInChildren <UILabel>().text = Tags.Audio_Name.Chat.Boy_Chat[i];
                UIEventListener.Get(go).onClick            = delegate
                {
                    OnClickDialogue(go);
                };
                grid.AddChild(go.transform);
            }
        }
Ejemplo n.º 3
0
        private void EventInit()
        {
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_自由匹配").gameObject).onClick = delegate
            {
                //Handheld.PlayFullScreenMovie("MJ_Movie.mp4", Color.black, FullScreenMovieControlMode.Full);
                //GameApp.Instance.SetGameState(GAME_STATE.MAIN);
                DealCommand.Instance.SendJoinRoom_自由匹配();
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_创建房间").gameObject).onClick = delegate
            {
                ViewCenter.Instance.ShowPanel <UIPanelBase>(PanelType.CreateRoom);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_加入游戏").gameObject).onClick = delegate
            {
                ViewCenter.Instance.ShowPanel <UIPanelBase>(PanelType.JoinRoom);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_玩法介绍").gameObject).onClick = delegate
            {
                ViewCenter.Instance.ShowPanel <UIPanelBase>(PanelType.Help);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_战绩").gameObject).onClick = delegate
            {
                ViewCenter.Instance.ShowPanel <UIPanelBase>(PanelType.Record);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_设置").gameObject).onClick = delegate
            {
                ViewCenter.Instance.ShowPanel <UIPanelBase>(PanelType.Setting);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_分享").gameObject).onClick = delegate
            {
                ShareContent content = new ShareContent();
                content.SetText(Tags.Title_Name + ",快来和我一起玩游戏吧!");
                content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
                //content.SetImageUrl("http://fir.im/1946");
                content.SetTitle(Tags.Title_Name);
                content.SetTitleUrl("http://fir.im/1946");
                content.SetSite("Mob-ShareSDK");
                content.SetSiteUrl("http://fir.im/1946");
                content.SetUrl("http://fir.im/1946");
                content.SetComment("描述");
                //content.SetMusicUrl("http://mp3.mwap8.com/destdir/Music/2009/20090601/ZuiXuanMinZuFeng20090601119.mp3");
                content.SetShareType(ContentType.Webpage);
                WeiXinCenter.Instance.ShareWeChatMoments(content);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_反馈").gameObject).onClick = delegate
            {
                ControlCenter.Instance.CaptureShare();
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Add_Gold").gameObject).onClick = delegate
            {
                ViewCenter.Instance.GetPanel <Panel_MessageBox>(PanelType.MessageBox).ShowMessageBox(Tags.TextPrompt.sContactAdmin + DataCenter.Instance.gamedata.AdministratorName, "", null);
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Add_Diamond").gameObject).onClick = delegate
            {
                ViewCenter.Instance.GetPanel <Panel_MessageBox>(PanelType.MessageBox).ShowMessageBox(Tags.TextPrompt.sContactAdmin + DataCenter.Instance.gamedata.AdministratorName, "", null);
            };

            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "开始录音").gameObject).onClick = delegate
            {
                GameApp.Instance.StartRecording();
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "结束录音").gameObject).onClick = delegate
            {
                GameApp.Instance.EndRecording();
            };

            NotificationCenter.Instance.AddNotificationEvent(NotificateMsgType.PLAYER_SCORE, SetLabel_Coin);
            NotificationCenter.Instance.AddNotificationEvent(NotificateMsgType.PLAYER_DIAMOND, SetLabel_Diamond);
        }
Ejemplo n.º 4
0
 public override void Init(PanelType type)
 {
     base.Init(type);
     EventInit();
     inputFiled = GameUtility.FindDeepChild(gameObject, "Input Filed").GetComponent <UIInput>();
 }
Ejemplo n.º 5
0
        private void SetPrepare(int playerId, bool bPrepare)
        {
            PlayerInfo player = DataCenter.Instance.players[playerId].playerInfo;
            SEAT_DIR   dir    = GameGD.GetSeatDir(player.DNXBDir);
            GameObject go     = null;

            switch (dir)
            {
            case SEAT_DIR.DIR_BOTTOM:
                go = GameUtility.FindDeepChild(gameObject, "Player_B").gameObject;
                break;

            case SEAT_DIR.DIR_RIGHT:
                go = GameUtility.FindDeepChild(gameObject, "Player_R").gameObject;
                break;

            case SEAT_DIR.DIR_TOP:
                go = GameUtility.FindDeepChild(gameObject, "Player_T").gameObject;
                break;

            case SEAT_DIR.DIR_LEFT:
                go = GameUtility.FindDeepChild(gameObject, "Player_L").gameObject;
                break;

            case SEAT_DIR.DIR_NULL:
                break;

            default:
                break;
            }

            if (go != null)
            {
                UISprite headIconSprite = GameUtility.FindDeepChild(go, "Head").GetComponent <UISprite>();
                headIconSprite.atlas = null;
                headIconSprite.atlas = ResourcesManager.GetAtlas(Tags.MJ_DynamicAtlas);
                if (bPrepare)
                {
                    headIconSprite.spriteName = player.WXTX_Icon_SpriteName;
                }
                else
                {
                    headIconSprite.spriteName = "";
                }

                UISprite prepareOKSprite = GameUtility.FindDeepChild(go, "PrepareOK").GetComponent <UISprite>();
                prepareOKSprite.gameObject.SetActive(bPrepare);

                UILabel nameLabel = GameUtility.FindDeepChild(go, "Name").GetComponent <UILabel>();
                if (bPrepare)
                {
                    nameLabel.text = player.WXName;
                }
                else
                {
                    nameLabel.text = "";
                }

                UILabel coinLabel = GameUtility.FindDeepChild(go, "Coin").GetComponent <UILabel>();
                if (bPrepare)
                {
                    coinLabel.text = "" + player.coin;
                }
                else
                {
                    coinLabel.text = "";
                }
            }
        }
Ejemplo n.º 6
0
 public void Init(MJ_Manager _Mgr)
 {
     _MJ_Mgr   = _Mgr;
     sprite_BG = GetComponent <UISprite>();
     sprite_鱼  = GameUtility.FindDeepChild(gameObject, "鱼").GetComponent <UISprite>();
 }
Ejemplo n.º 7
0
 private void EventInit()
 {
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Game_MJ").gameObject).onClick = delegate
     {
     };
 }
Ejemplo n.º 8
0
 private void PlayerInfoInit()
 {
     InfoObj = GameUtility.FindDeepChild(gameObject, "Info_BG").gameObject;
     HideInfo();
 }
Ejemplo n.º 9
0
 private void ClearAllHistroyRecord()
 {
     _mHistroyRecordMgr.ClearAllHistroyRecord();
     GameUtility.FindDeepChild(gameObject, "Label_NoRecord").gameObject.SetActive(true);
 }
Ejemplo n.º 10
0
 public void AddHistoryRecord(ref HistroyRecordData data)
 {
     _mHistroyRecordMgr.AddHistroyRecord(ref data);
     GameUtility.FindDeepChild(gameObject, "Label_NoRecord").gameObject.SetActive(false);
 }
Ejemplo n.º 11
0
 public override void ShowPanel()
 {
     base.ShowPanel();
     GameUtility.FindDeepChild(this.gameObject, "音效/OFF").GetComponent <UIToggle>().value = AudioManager.audioEffectVolumes == 1;
     GameUtility.FindDeepChild(this.gameObject, "音乐/OFF").GetComponent <UIToggle>().value = AudioManager.audioBackgroundVolumes == 1;
 }
Ejemplo n.º 12
0
 public override void Init(PanelType type)
 {
     base.Init(type);
     label = GameUtility.FindDeepChild(gameObject, "Label").GetComponent <UILabel>();
 }