Exemplo n.º 1
0
 private void NumEventInit(int num)
 {
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Num_" + num).gameObject).onClick = delegate
     {
         NumOnClick(num);
     };
 }
Exemplo n.º 2
0
        public override void ShowPanel()
        {
            base.ShowPanel();
            string strArea = DataCenter.Instance.gamedata.GameArea.ToString();

            GameUtility.FindDeepChild(gameObject, strArea).GetComponent <UIToggle>().value = true;
        }
Exemplo n.º 3
0
 private void PauseHF()
 {
     bPause = true;
     DealCommand.Instance.SendHFZT(mHrd);
     GameUtility.FindDeepChild(gameObject, "Btn_M").GetComponent <UISprite>().spriteName   = mSpriteName_暂停;
     GameUtility.FindDeepChild(gameObject, "Btn_M").GetComponent <UIButton>().normalSprite = mSpriteName_暂停;
 }
Exemplo n.º 4
0
 private void EventInit()
 {
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_Close").gameObject).onClick = delegate
     {
         ViewCenter.Instance.HidePanel <UIPanelBase>(PanelType.Setting);
     };
 }
Exemplo n.º 5
0
 private void EventInit()
 {
     UIEventListener.Get(GameUtility.FindDeepChild(this.gameObject, "Btn_Setting").gameObject).onClick = delegate
     {
         ViewCenter.Instance.ShowPanel <UIPanelBase>(PanelType.Setting);
     };
     UIEventListener.Get(GameUtility.FindDeepChild(this.gameObject, "Btn_Chat").gameObject).onClick = delegate
     {
         ViewCenter.Instance.ShowPanel <UIPanelBase>(PanelType.Chat);
     };
     UIEventListener.Get(GameUtility.FindDeepChild(this.gameObject, "Btn_Exit").gameObject).onClick = delegate
     {
         if (DataCenter.Instance.gamedata.gameMode == GAME_MODE.自由匹配)
         {
             //ViewCenter.Instance.GetPanel<Panel_MessageBox>(PanelType.MessageBox).ShowMessageBox(Tags.TextPrompt.sIsReturnToHall, "", delegate { DealCommand.Instance.SendLeaveRoom(); }, "", null);
             ViewCenter.Instance.GetPanel <Panel_MessageBox>(PanelType.MessageBox).ShowMessageBox(Tags.TextPrompt.sIsReturnToHall, "", delegate { DealCommand.Instance.SendLeaveRoom(); }, "", null);
         }
         if (DataCenter.Instance.hFdata.IsHuiFanging)
         {
             ViewCenter.Instance.GetPanel <Panel_HuiFang>(PanelType.HuiFang).HFLK();
         }
     };
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_DismissRoom").gameObject).onClick = delegate
     {
         if (DataCenter.Instance.gamedata.gameMode == GAME_MODE.创建房间)
         {
             ViewCenter.Instance.GetPanel <Panel_MessageBox>(PanelType.MessageBox).ShowMessageBox(Tags.TextPrompt.sIsDismissRoom, "", delegate { DealCommand.Instance.SendDissolveRoom(); }, "", null);
         }
     };
 }
Exemplo n.º 6
0
 public void Init(MJ_Manager _Mgr)
 {
     _MJ_Mgr   = _Mgr;
     sprite_BG = GetComponentInChildren <UISprite>();
     Show(false);
     GameUtility.FindDeepChild(gameObject, "GameObject").gameObject.SetActive(false);
 }
Exemplo n.º 7
0
 private void ResumeHF()
 {
     bPause = false;
     DealCommand.Instance.SendHFHF(mHrd);
     GameUtility.FindDeepChild(gameObject, "Btn_M").GetComponent <UISprite>().spriteName   = mSpriteName_恢复;
     GameUtility.FindDeepChild(gameObject, "Btn_M").GetComponent <UIButton>().normalSprite = mSpriteName_恢复;
 }
Exemplo n.º 8
0
        private UISprite sprite_Result;//输赢结果

        public override void Init(PanelType type)
        {
            Transform[] childs = GetComponentsInChildren <Transform>();
            foreach (Transform item in childs)
            {
                if (item.name == "MJ")
                {
                    item.gameObject.SetActive(false);
                }
            }

            _MJ_Mgr = GetComponentInChildren <MJ_Manager>();
            _MJ_Mgr.Init();

            label_time    = GameUtility.FindDeepChild(gameObject, "时间").GetComponent <UILabel>();
            label_当前玩法    = GameUtility.FindDeepChild(gameObject, "当前玩法").GetComponent <UILabel>();
            sprite_Result = GameUtility.FindDeepChild(gameObject, "Result").GetComponent <UISprite>();

            playeInfos = GetComponentsInChildren <PlayerInfo_GameOver>(true);
            foreach (PlayerInfo_GameOver item in playeInfos)
            {
                item.Init(_MJ_Mgr);
            }

            base.Init(type);
            AddColliderMode(PanelColliderMode.Normal);

            EventInit();
        }
Exemplo n.º 9
0
 private void EventInit()
 {
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_Close").gameObject).onClick = delegate
     {
         ViewCenter.Instance.GetPanel <Panel_MessageBox>(PanelType.MessageBox).ShowMessageBox(Tags.TextPrompt.sIsLeaveRoom, "", delegate { DealCommand.Instance.SendLeaveRoom(); }, "", null);
     };
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_DismissRoom").gameObject).onClick = delegate
     {
         if (DataCenter.Instance.gamedata.IsFangZhu)
         {
             ViewCenter.Instance.GetPanel <Panel_MessageBox>(PanelType.MessageBox).ShowMessageBox(Tags.TextPrompt.sIsDismissRoom, "", delegate { DealCommand.Instance.SendDissolveRoom(); }, "", null);
         }
     };
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_InviteFriends").gameObject).onClick = delegate
     {
         ShareContent content = new ShareContent();
         content.SetText(Tags.Title_Name + ",快来和我一起玩游戏吧!\n房间号:" + DataCenter.Instance.gamedata.RoomNum + "\n玩法:" + label_当前玩法.text);
         content.SetImageUrl("http://ww3.sinaimg.cn/mw690/be159dedgw1evgxdt9h3fj218g0xctod.jpg");
         content.SetTitle(Tags.Title_Name + "!房号:" + DataCenter.Instance.gamedata.RoomNum);
         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.ShareWeChatFriend(content);
     };
 }
Exemplo n.º 10
0
        private void EventInit()
        {
            int i = 0;

            for (; i <= 9; i++)
            {
                NumEventInit(i);
            }
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "加入房间").gameObject).onClick = delegate
            {
                if (IsInputOver())
                {
                    HidePanel();
                    DealCommand.Instance.SendJoinRoom(GetInputRoomNum());
                }
                else
                {
                    ViewCenter.Instance.GetPanel <Panel_Prompt>(PanelType.Prompt).ShowText("请输入六位房间号");
                }
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "删除").gameObject).onClick = delegate
            {
                DeleteInputText();
            };
            UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_Close").gameObject).onClick = delegate
            {
                ViewCenter.Instance.HidePanel <UIPanelBase>(PanelType.JoinRoom);
            };
        }
Exemplo n.º 11
0
 private void EventInit()
 {
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_HF").gameObject).onClick = delegate
     {
         ViewCenter.Instance.GetPanel <Panel_HuiFang>(PanelType.HuiFang).StartHF(data);
     };
 }
Exemplo n.º 12
0
 private void RefleshPanel()
 {
     GameUtility.FindDeepChild(gameObject, "房间号").GetComponent <UILabel>().text = "房间号:" + DataCenter.Instance.gamedata.RoomNum;
     for (int i = 0; i < 4; i++)
     {
         RefleshData(i);
     }
 }
Exemplo n.º 13
0
        public void Init()
        {
            Instance = this;
            pool     = CreatePool(transform.name);
            CreatePrefab(pool, prefab);

            mUIGrid = GameUtility.FindDeepChild(gameObject, "UIGris").GetComponent <UIGrid>();
        }
Exemplo n.º 14
0
 private void EventInit()
 {
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_Close").gameObject).onClick = delegate
     {
         AudioManager.Play(Tags.Audio_Name.Btn);
         HidePanel();
     };
 }
Exemplo n.º 15
0
        public override void Init(PanelType type)
        {
            _mHistroyRecordMgr = GameUtility.FindDeepChild(gameObject, "HistroyRecordMgr").GetComponent <HistroyRecordManager>();
            _mHistroyRecordMgr.Init();

            base.Init(type);
            AddColliderMode(PanelColliderMode.Normal);
            EventInit();
        }
Exemplo n.º 16
0
 // Use this for initialization
 void Start()
 {
     UIEventListener.Get(this.gameObject).onPress = MicroPhonePress;
     sprite_Process         = GameUtility.FindDeepChild(gameObject, "Process").GetComponent <UISprite>();
     sprite_Process.enabled = false;
     Debuger.Log("McroPhoneProcess Start !");
     MicrophoneInput.getInstance().StartRecord();
     MicrophoneInput.getInstance().StopRecord();
 }
Exemplo n.º 17
0
        private Vector3 GetHeadWorldPos()
        {
            Transform headTrans    = GameUtility.FindDeepChild(this.gameObject, "HeadIcon");
            Vector3   pos          = UICamera.currentCamera.WorldToViewportPoint(headTrans.position);
            Vector3   headWorldPos = GDFunc.NGUIPosToWorld(headTrans.gameObject);

            headWorldPos   = Camera.main.ViewportToWorldPoint(pos);
            headWorldPos.z = -Camera.main.transform.position.z;
            return(headWorldPos);
        }
Exemplo n.º 18
0
 private void InitBtnResult()
 {
     for (int i = 0; i < btn_resultList.Count; i++)
     {
         btn_resultList[i].Init();
         btn_resultList[i].Show(false);
     }
     ResultColliderBgObj = GameUtility.FindDeepChild(gameObject, "ResultColliderBg").gameObject;
     ResultColliderBgObj.SetActive(false);
 }
Exemplo n.º 19
0
        /// <summary>
        /// 查找子节点脚本
        /// </summary>
        public static T FindDeepChild <T>(GameObject _target, string _childName) where T : Component
        {
            Transform resultTrs = GameUtility.FindDeepChild(_target, _childName);

            if (resultTrs != null)
            {
                return(resultTrs.gameObject.GetComponent <T>());
            }
            return((T)((object)null));
        }
Exemplo n.º 20
0
 public void SelectArea(UIToggle toggle)
 {
     if (toggle.value)
     {
         AREA_ENUM areaSelect = (AREA_ENUM)Enum.Parse(typeof(AREA_ENUM), toggle.transform.name);
         DataCenter.Instance.gamedata.GameArea = areaSelect;
         DealCommand.Instance.SendZBCJ();
         GameUtility.FindDeepChild(gameObject, "GameRule").gameObject.SetActive(false);
     }
 }
Exemplo n.º 21
0
 public override void Init(PanelType type)
 {
     base.Init(type);
     EventInit();
     label_Coin      = GameUtility.FindDeepChild(gameObject, "Coin").GetComponent <UILabel>();
     label_Diamond   = GameUtility.FindDeepChild(gameObject, "Diamond").GetComponent <UILabel>();
     label_Name      = GameUtility.FindDeepChild(gameObject, "Name").GetComponent <UILabel>();
     label_ID        = GameUtility.FindDeepChild(gameObject, "ID").GetComponent <UILabel>();
     sprite_HeadIcon = GameUtility.FindDeepChild(gameObject, "HeadIcon").GetComponent <UISprite>();
 }
Exemplo n.º 22
0
        private void ShowDialogue(bool bShow)
        {
            GameUtility.FindDeepChild(gameObject, "Btn_语言").GetComponent <UIToggle>().value = bShow;
            GameObject ItemsCenter = GameUtility.FindDeepChild(gameObject, "Dialogue_Items").gameObject;

            if (bShow)
            {
                ShowFace(false);
            }
            ItemsCenter.SetActive(bShow);
        }
Exemplo n.º 23
0
 private void EventInit()
 {
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "HeadFrame").gameObject).onClick = delegate
     {
         ShowInfo();
     };
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "ColliderBg").gameObject).onClick = delegate
     {
         HideInfo();
     };
 }
Exemplo n.º 24
0
 private void EventInit()
 {
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_炫耀一下").gameObject).onClick = delegate
     {
         ControlCenter.Instance.CaptureShare();
     };
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_返回大厅").gameObject).onClick = delegate
     {
         GameApp.Instance.SetGameState(GAME_STATE.HALL);
     };
 }
Exemplo n.º 25
0
 public void StartHF(HistroyRecordData hr)
 {
     if (hr != null)
     {
         mHrd   = hr;
         bPause = false;
         DealCommand.Instance.SendHFKS(mHrd);
         GameUtility.FindDeepChild(gameObject, "Btn_M").GetComponent <UISprite>().spriteName   = mSpriteName_恢复;
         GameUtility.FindDeepChild(gameObject, "Btn_M").GetComponent <UIButton>().normalSprite = mSpriteName_恢复;
     }
 }
Exemplo n.º 26
0
 private void EventInit()
 {
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_Close").gameObject).onClick = delegate
     {
         ViewCenter.Instance.HidePanel <UIPanelBase>(type);
     };
     UIEventListener.Get(GameUtility.FindDeepChild(gameObject, "Btn_Create").gameObject).onClick = delegate
     {
         ViewCenter.Instance.HidePanel <UIPanelBase>(type);
         ControlCenter.Instance.CreateRoom(GetPlayRule());
     };
 }
Exemplo n.º 27
0
        /// <summary>
        /// 给目标添加Collider背景
        /// </summary>
        public static void AddColliderBgToTarget(GameObject target, string maskName, UIAtlas altas, bool isTransparent)
        {
            // 添加UIPaneldepth最小上面
            // 保证添加的Collider放置在屏幕中间
            Transform windowBg = GameUtility.FindDeepChild(target, "WindowBg");

            if (windowBg == null)
            {
                GameObject targetParent = GetPanelDepthMaxMin(target, false, true);
                if (targetParent == null)
                {
                    targetParent = target;
                }

                windowBg = (new GameObject("WindowBg")).transform;
                AddChildToTarget(targetParent.transform, windowBg);
            }

            Transform bg = GameUtility.FindDeepChild(target, "WindowColliderBg(Cool)");

            if (bg == null)
            {
                // add sprite or widget to ColliderBg gameobject
                UIWidget widget = null;
                if (!isTransparent)
                {
                    widget = NGUITools.AddSprite(windowBg.gameObject, altas, maskName);
                }
                else
                {
                    widget = NGUITools.AddWidget <UIWidget>(windowBg.gameObject);
                }

                widget.name = "WindowColliderBg(Cool)";
                bg          = widget.transform;

                // fill the screen
                UIStretch stretch = bg.gameObject.AddComponent <UIStretch>();
                stretch.style = UIStretch.Style.Both;
                // set relative size bigger
                stretch.relativeSize = new Vector2(1.5f, 1.5f);

                // set a lower depth
                widget.depth = -5;

                // set alpha
                widget.alpha = 0.6f;

                // add collider
                NGUITools.AddWidgetCollider(bg.gameObject);
            }
        }
Exemplo n.º 28
0
        public override void Init(PanelType type)
        {
            base.Init(type);
            type = PanelType.Player_BOTTOM;

            TrusteeshipObj = GameUtility.FindDeepChild(gameObject, "托管").gameObject;
            ShowTrusteeship(false);

            TingPaiTrans = GameUtility.FindDeepChild(gameObject, "TingPai");
            ShowTingPai(new List <MJType>());

            InitBtnResult();
        }
Exemplo n.º 29
0
        // Use this for initialization
        void Start()
        {
            Debuger.EnableLog = GD.ENABLELOG;

            tReceive = new Thread(ReceiveDatasThread);

            textList  = GetComponentInChildren <UITextList>();
            popup_端口号 = GameUtility.FindDeepChild(gameObject, "Popup_端口号").GetComponent <UIPopupList>();
            popup_波特率 = GameUtility.FindDeepChild(gameObject, "Popup_波特率").GetComponent <UIPopupList>();
            textInput = GameUtility.FindDeepChild(gameObject, "Input Field").GetComponent <UIInput>();

            EventInit();
        }
Exemplo n.º 30
0
        public override void Init(DYD.PanelType type)
        {
            base.Init(type);
            AddColliderMode(PanelColliderMode.WithBg);

            for (int i = 0; i < inputLabelAry.Length; i++)
            {
                inputLabelAry[i] = GameUtility.FindDeepChild(gameObject, "Input_" + i + "/Label").GetComponent <UILabel>();
            }
            SetInputText("");

            EventInit();
        }