public override void InitWindowOnAwake()
        {
            base.InitWindowOnAwake();
            InitWindowCoreData();

            btnStart         = GameUtility.FindDeepChild(this.gameObject, "LevelDetailRight/BtnEnter").gameObject;
            this.lbLevelDes  = GameUtility.FindDeepChild <UILabel>(this.gameObject, "LevelDetailRight/Content/des");
            this.lbLevelName = GameUtility.FindDeepChild <UILabel>(this.gameObject, "levelName");

            this.listStarts.Add(GameUtility.FindDeepChild(this.gameObject, "Stars/star01").gameObject);
            this.listStarts.Add(GameUtility.FindDeepChild(this.gameObject, "Stars/star02").gameObject);
            this.listStarts.Add(GameUtility.FindDeepChild(this.gameObject, "Stars/star03").gameObject);

            twAlpha = this.gameObject.GetComponent <TweenAlpha>();

            UIEventListener.Get(btnStart).onClick = delegate
            {
                // Application.LoadLevel("AnimationCurve");
                GameMonoHelper.GetInstance().LoadGameScene("RealGame-AnimationCurve", false,
                                                           delegate
                {
                    UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_Matching);
                    UICenterMasterManager.Instance.GetGameWindowScript <UIMatching>(WindowID.WindowID_Matching).SetMatchingData(this.ID);
                });
            };
        }
Exemplo n.º 2
0
        public override void InitWindowOnAwake()
        {
            InitWindowCoreData();
            base.InitWindowOnAwake();
            itemsGrid    = GameUtility.FindDeepChild(this.gameObject, "LeftAnchor/LeftMain/Scroll View/Grid");
            trsAnimation = GameUtility.FindDeepChild(this.gameObject, "LeftAnchor/LeftMain");
            scrollView   = GameUtility.FindDeepChild <UIScrollView>(this.gameObject, "LeftAnchor/LeftMain/Scroll View");
            btnGoToMatch = GameUtility.FindDeepChild(this.gameObject, "Btn_GotoMatch").gameObject;

            rankWindowManager = this.gameObject.GetComponent <UIRankManager>();
            if (rankWindowManager == null)
            {
                rankWindowManager = this.gameObject.AddComponent <UIRankManager>();
                rankWindowManager.InitWindowManager();
            }

            // Just go to Game scene logic
            UIEventListener.Get(btnGoToMatch).onClick = delegate
            {
                GameMonoHelper.GetInstance().LoadGameScene("RealGame-AnimationCurve", false,
                                                           delegate
                {
                    UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_Matching);
                    UICenterMasterManager.Instance.GetGameWindowScript <UIMatching>(WindowID.WindowID_Matching).SetMatchingData(this.ID);
                });
            };
        }
Exemplo n.º 3
0
        /// <summary>
        /// Init the rank sub window Manager
        /// 1. Find the managed sub window
        /// 2. init the managed sub window
        /// </summary>
        public override void InitWindowManager()
        {
            base.InitWindowManager();
            InitWindowControl();
            isNeedWaitHideOver = true;

            // UIRankDetail sub window
            GameObject   objRankDetail    = GameUtility.FindDeepChild(this.gameObject, "DetailWindowContainer").gameObject;
            UIRankDetail rankDetailScript = objRankDetail.GetComponent <UIRankDetail>();

            if (rankDetailScript == null)
            {
                rankDetailScript = objRankDetail.AddComponent <UIRankDetail>();
            }

            dicAllWindows[(int)WindowID.WindowID_Rank_Detail] = rankDetailScript;

            // UIRankOwnDetail sub window
            GameObject      objRankOwnDetail    = GameUtility.FindDeepChild(this.gameObject, "OwnDetailWindow").gameObject;
            UIRankOwnDetail rankOwnDetailScript = objRankOwnDetail.GetComponent <UIRankOwnDetail>();

            if (rankOwnDetailScript == null)
            {
                rankOwnDetailScript = objRankOwnDetail.AddComponent <UIRankOwnDetail>();
            }

            dicAllWindows[(int)WindowID.WindowID_Rank_OwnDetail] = rankOwnDetailScript;
        }
Exemplo n.º 4
0
        public override void InitWindowOnAwake()
        {
            this.windowID = WindowID.WindowID_MatchResult;
            base.InitWindowOnAwake();
            InitWindowData();

            gbWinContent  = GameUtility.FindDeepChild(this.gameObject, "WinContent").gameObject;
            gbLoseContent = GameUtility.FindDeepChild(this.gameObject, "LoseContent").gameObject;

            btnRank        = GameUtility.FindDeepChild(this.gameObject, "LoseContent/Btns/Btn_Rank").gameObject;
            btnSkill       = GameUtility.FindDeepChild(this.gameObject, "LoseContent/Btns/Btn_Skill").gameObject;
            btnLoseContine = GameUtility.FindDeepChild(this.gameObject, "LoseContent/Btns/Btn_Continue").gameObject;
            btnWinContine  = GameUtility.FindDeepChild(this.gameObject, "WinContent/Btn_Continue").gameObject;
            lbResult       = GameUtility.FindDeepChild <UILabel>(this.gameObject, "Msg/Sprite/Label");
            lbResultMsg    = GameUtility.FindDeepChild <UILabel>(this.gameObject, "Msg/Label");

            UIEventListener.Get(btnLoseContine).onClick = OnContineBtn;
            UIEventListener.Get(btnWinContine).onClick  = OnContineBtn;

            UIEventListener.Get(btnSkill).onClick = delegate
            {
                //ShowWindowData windowData = new ShowWindowData();
                //windowData.needClearBackSequence = true;
                UIManager.GetInstance().ShowWindow(WindowID.WindowID_TopBar);
                UIManager.GetInstance().ShowWindow(WindowID.WindowID_Skill);
            };

            UIEventListener.Get(btnRank).onClick = delegate
            {
                //UIManager.GetInstance().ShowWindow(WindowID.WindowID_TopBar);
                //UIManager.GetInstance().ShowWindow(WindowID.WindowID_Rank);
                UIManager.GetInstance().ShowWindow(WindowID.WindowID_TopBar);
                UIManager.GetInstance().ShowWindow(WindowID.WindowID_Level);
            };
        }
Exemplo n.º 5
0
 public override void InitWindowOnAwake()
 {
     InitWindowCoreData();
     base.InitWindowOnAwake();
     trsLevelItemsParent = GameUtility.FindDeepChild(this.gameObject, "LevelItems/Items");
     twAlpha             = gameObject.GetComponent <TweenAlpha>();
 }
Exemplo n.º 6
0
        public override void InitWindowOnAwake()
        {
            this.windowData.windowType = UIWindowType.Fixed;

            base.InitWindowOnAwake();
            btnReturn  = GameUtility.FindDeepChild(this.gameObject, "TopLeft/Btn_Rtn").gameObject;
            btnShowMsg = GameUtility.FindDeepChild(this.gameObject, "TopRight/Meg/Sprite").gameObject;
            btnShop    = GameUtility.FindDeepChild(this.gameObject, "TopRight/BtnShop").gameObject;
            UIEventListener.Get(btnReturn).onClick = delegate
            {
                UICenterMasterManager.Instance.PopNavigationWindow();
            };

            UIEventListener.Get(btnShop).onClick = delegate
            {
                UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_Shop);
            };

            // message box Test.
            UIEventListener.Get(btnShowMsg).onClick = delegate
            {
                UICenterMasterManager.Instance.ShowMessageBox(
                    "You are yourself, Just Don't lose confidence.",
                    "Sure!",
                    delegate
                {
                    UICenterMasterManager.Instance.CloseMessageBox();
                });
                // UICenterMasterManager.Instance.ShowMessageBox("Hello World!");
            };
        }
Exemplo n.º 7
0
        public override void InitWindowOnAwake()
        {
            this.windowID    = WindowID.WindowID_Rank;
            this.preWindowID = WindowID.WindowID_MainMenu;
            InitWindowData();
            base.InitWindowOnAwake();

            // this.RegisterReturnLogic(RetrunPreLogic);

            objEffect    = GameUtility.FindDeepChild(this.gameObject, "EffectParent");
            itemsGrid    = GameUtility.FindDeepChild(this.gameObject, "LeftAnchor/LeftMain/Scroll View/Grid");
            trsAnimation = GameUtility.FindDeepChild(this.gameObject, "LeftAnchor/LeftMain");
            scrollView   = GameUtility.FindDeepChild <UIScrollView>(this.gameObject, "LeftAnchor/LeftMain/Scroll View");
            btnGoToMatch = GameUtility.FindDeepChild(this.gameObject, "Btn_GotoMatch").gameObject;

            rankWindowManager = this.gameObject.GetComponent <UIRankManager>();
            if (rankWindowManager == null)
            {
                rankWindowManager = this.gameObject.AddComponent <UIRankManager>();
                rankWindowManager.InitWindowManager();
            }

            UIEventListener.Get(btnGoToMatch).onClick = delegate
            {
                GameMonoHelper.GetInstance().LoadGameScene("AnimationCurve",
                                                           delegate
                {
                    UIManager.GetInstance().ShowWindow(WindowID.WindowID_Matching);
                    UIManager.GetInstance().GetGameWindowScript <UIMatching>(WindowID.WindowID_Matching).SetMatchingData(this.windowID);
                });
            };
        }
Exemplo n.º 8
0
        void Awake()
        {
            lbItemName = GameUtility.FindDeepChild <UILabel>(this.gameObject, "Label");
            spIcon     = GameUtility.FindDeepChild <UISprite>(this.gameObject, "Sprite");
            btnBg      = GameUtility.FindDeepChild(this.gameObject, "Bgbtn").gameObject;

            UIEventListener.Get(btnBg).onClick = OnBtnClick;
        }
Exemplo n.º 9
0
 public override void InitWindowOnAwake()
 {
     this.windowID = WindowID.WindowID_Level;
     InitWindowData();
     base.InitWindowOnAwake();
     // this.RegisterReturnLogic(RetrunPreLogic);
     trsLevelItemsParent = GameUtility.FindDeepChild(this.gameObject, "LevelItems/Items");
     twAlpha             = gameObject.GetComponent <TweenAlpha>();
 }
Exemplo n.º 10
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.º 11
0
        void Awake()
        {
            lbLevelName  = GameUtility.FindDeepChild <UILabel>(this.gameObject, "Label");
            btnLevelItem = GameUtility.FindDeepChild(this.gameObject, "Icon").gameObject;

            UIEventListener.Get(btnLevelItem).onClick = delegate
            {
                UIManager.GetInstance().ShowWindow(WindowID.WindowID_LevelDetail);
                // UIManager.GetInstance().ShowWindowDelay(2.0f, WindowID.WindowID_LevelDetail);
            };
        }
Exemplo n.º 12
0
        public override void InitWindowOnAwake()
        {
            InitWindowCoreData();
            base.InitWindowOnAwake();

            spHeadIcon   = GameUtility.FindDeepChild <UISprite>(this.gameObject, "Sprite");
            btnClose     = GameUtility.FindDeepChild(this.gameObject, "Close").gameObject;
            objAnimation = this.gameObject;

            UIEventListener.Get(btnClose).onClick = OnBtnSwitch;
        }
Exemplo n.º 13
0
        // <summary>
        /// 给目标添加Collider背景
        /// Add Collider Background for target
        /// </summary>
        public static GameObject AddColliderBgToTarget(GameObject target, string maskName, UIAtlas altas, bool isTransparent)
        {
            // 添加UIPaneldepth最小上面
            // 保证添加的Collider放置在屏幕中间
            Transform windowBg = GameUtility.FindDeepChild(target, "WindowBg");

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

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

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

            if (bg == null)
            {
                // add sprite or widget to ColliderBg
                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
                // You can use the new Anchor system
                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);
            }
            return(bg.gameObject);
        }
Exemplo n.º 14
0
        public override void InitWindowOnAwake()
        {
            this.windowID = WindowID.WindowID_Rank_OwnDetail;
            InitWindowData();
            base.InitWindowOnAwake();

            lbName       = GameUtility.FindDeepChild <UILabel>(this.gameObject, "Name");
            spHeadIcon   = GameUtility.FindDeepChild <UISprite>(this.gameObject, "Sprite");
            btnClose     = GameUtility.FindDeepChild(this.gameObject, "Close").gameObject;
            objAnimation = this.gameObject;

            UIEventListener.Get(btnClose).onClick = OnBtnSwitch;
        }
Exemplo n.º 15
0
        public override void InitWindowOnAwake()
        {
            this.windowID = WindowID.WindowID_MainMenu;
            base.InitWindowOnAwake();
            InitWindowData();

            twPositions = new TweenPosition[4];
            btnInfor    = GameUtility.FindDeepChild(this.gameObject, "LeftBottom/Btns/Btn_Infor").gameObject;
            btnRank     = GameUtility.FindDeepChild(this.gameObject, "LeftBottom/Btns/Btn_Rank").gameObject;
            btnLevel    = GameUtility.FindDeepChild(this.gameObject, "LeftBottom/Btns/Btn_Level").gameObject;
            btnSwitch   = GameUtility.FindDeepChild(this.gameObject, "BottomRight/Btn_Switch").gameObject;
            btnSkill    = GameUtility.FindDeepChild(this.gameObject, "LeftBottom/Btns/Btn_Skill").gameObject;
            lbSwitch    = GameUtility.FindDeepChild <UILabel>(this.gameObject, "BottomRight/Btn_Switch/Label");

            twPositions[0] = btnInfor.GetComponent <TweenPosition>();
            twPositions[1] = btnRank.GetComponent <TweenPosition>();
            twPositions[2] = btnLevel.GetComponent <TweenPosition>();
            twPositions[3] = btnSkill.GetComponent <TweenPosition>();

            UIEventListener.Get(btnRank).onClick = delegate
            {
                ShowWindowData showData = new ShowWindowData();
                showData.forceResetWindow = true;
                UIManager.GetInstance().ShowWindow(WindowID.WindowID_Rank, showData);
            };

            UIEventListener.Get(btnSwitch).onClick = delegate
            {
                switchFlag = !switchFlag;
                if (switchFlag)
                {
                    ShowBtns();
                }
                else
                {
                    HideBtns();
                }
            };

            UIEventListener.Get(btnLevel).onClick = delegate
            {
                UIManager.GetInstance().ShowWindow(WindowID.WindowID_Level);
            };

            UIEventListener.Get(btnSkill).onClick = delegate
            {
                UIManager.GetInstance().ShowWindow(WindowID.WindowID_Skill);
            };
        }
Exemplo n.º 16
0
        public override void InitWindowOnAwake()
        {
            base.InitWindowOnAwake();
            InitWindowCoreData();

            gbAnimation  = GameUtility.FindDeepChild(this.gameObject, "Center/Sprite").gameObject;
            btnGoToLevel = GameUtility.FindDeepChild(this.gameObject, "RightAnchor/BtnLevel").gameObject;

            twPosition = gbAnimation.GetComponent <TweenPosition>();

            UIEventListener.Get(btnGoToLevel).onClick = delegate
            {
                UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_Level);
            };
        }
Exemplo n.º 17
0
        void Awake()
        {
            lbLevelName  = GameUtility.FindDeepChild <UILabel>(this.gameObject, "Label");
            btnLevelItem = GameUtility.FindDeepChild(this.gameObject, "Icon").gameObject;

            UIEventListener.Get(btnLevelItem).onClick = delegate
            {
                ShowWindowData         showData = new ShowWindowData();
                ContextDataLevelDetail context  = new ContextDataLevelDetail();
                context.levelDescription = "Hi Man cool things will be happen.Be busy living or be busy dying. - Fighting for the game world";
                context.levelId          = 10001;
                context.levelName        = lbLevelName.text;
                context.starCount        = starCount;
                showData.contextData     = context;
                UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_LevelDetail, showData);
            };
        }
Exemplo n.º 18
0
        public override void InitWindowOnAwake()
        {
            this.windowID = WindowID.WindowID_Rank_Detail;
            InitWindowData();
            base.InitWindowOnAwake();

            lbDetail     = GameUtility.FindDeepChild(this.gameObject, "Move/Label").GetComponent <UILabel>();
            spHeadIcon   = GameUtility.FindDeepChild <UISprite>(this.gameObject, "Move/Sprite");
            objAnimation = GameUtility.FindDeepChild(this.gameObject, "Move").gameObject;
            btnClose     = GameUtility.FindDeepChild(this.gameObject, "Move/Close").gameObject;
            btnGoToLevel = GameUtility.FindDeepChild(this.gameObject, "Move/BtnGotoLevel").gameObject;
            UIEventListener.Get(btnClose).onClick = OnBtnClose;

            UIEventListener.Get(btnGoToLevel).onClick = delegate
            {
                UIManager.GetInstance().ShowWindow(WindowID.WindowID_Level);
            };
        }
Exemplo n.º 19
0
        /// <summary>
        /// 查找子节点
        /// </summary>
        public static Transform FindDeepChild(GameObject _target, string _childName)
        {
            Transform resultTrs = null;

            resultTrs = _target.transform.Find(_childName);
            if (resultTrs == null)
            {
                foreach (Transform trs in _target.transform)
                {
                    resultTrs = GameUtility.FindDeepChild(trs.gameObject, _childName);
                    if (resultTrs != null)
                    {
                        return(resultTrs);
                    }
                }
            }
            return(resultTrs);
        }
Exemplo n.º 20
0
        public override void InitWindowOnAwake()
        {
            this.windowID = WindowID.WindowID_TopBar;
            this.windowData.windowType = UIWindowType.Fixed;

            base.InitWindowOnAwake();
            btnReturn  = GameUtility.FindDeepChild(this.gameObject, "TopLeft/Btn_Rtn").gameObject;
            btnShowMsg = GameUtility.FindDeepChild(this.gameObject, "TopRight/Meg/Sprite").gameObject;

            UIEventListener.Get(btnReturn).onClick = delegate
            {
                UIManager.GetInstance().ReturnWindow();
            };

            // message box Test.
            UIEventListener.Get(btnShowMsg).onClick = delegate
            {
                // UIManager.GetInstance().ShowMessageBox("Hello World!");

                //UIManager.GetInstance().ShowMessageBox(
                //    "Do you want to quit this game?",
                //    "Yes",
                //    delegate
                //    {
                //        Debug.Log("Message Box click YES.");
                //        UIManager.GetInstance().CloseMessageBox();
                //    },
                //    "No",
                //    delegate
                //    {
                //        Debug.Log("Message Box click NO.");
                //        UIManager.GetInstance().CloseMessageBox();
                //    });

                UIManager.GetInstance().ShowMessageBox(
                    "You are yourself, please don't lose confidence.",
                    "Sure!",
                    delegate
                {
                    UIManager.GetInstance().CloseMessageBox();
                });
            };
        }
Exemplo n.º 21
0
        public override void InitWindowOnAwake()
        {
            base.InitWindowOnAwake();
            InitWindowCoreData();

            gbWinContent  = GameUtility.FindDeepChild(this.gameObject, "WinContent").gameObject;
            gbLoseContent = GameUtility.FindDeepChild(this.gameObject, "LoseContent").gameObject;

            btnRank        = GameUtility.FindDeepChild(this.gameObject, "LoseContent/Btns/Btn_Rank").gameObject;
            btnSkill       = GameUtility.FindDeepChild(this.gameObject, "LoseContent/Btns/Btn_Skill").gameObject;
            btnLoseContine = GameUtility.FindDeepChild(this.gameObject, "LoseContent/Btns/Btn_Continue").gameObject;
            btnWinContine  = GameUtility.FindDeepChild(this.gameObject, "WinContent/Btn_Continue").gameObject;
            lbResult       = GameUtility.FindDeepChild <UILabel>(this.gameObject, "Msg/Sprite/Label");
            lbResultMsg    = GameUtility.FindDeepChild <UILabel>(this.gameObject, "Msg/Label");

            UIEventListener.Get(btnLoseContine).onClick = OnContineBtn;
            UIEventListener.Get(btnWinContine).onClick  = OnContineBtn;

            UIEventListener.Get(btnSkill).onClick = delegate
            {
                GameMonoHelper.GetInstance().LoadGameScene("RealGame-EmptyScene", true, delegate
                {
                    UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_TopBar);
                    ShowWindowData showData   = new ShowWindowData();
                    showData.checkNavigation  = true;
                    showData.ignoreAddNavData = true;
                    UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_Skill, showData);
                });
            };

            UIEventListener.Get(btnRank).onClick = delegate
            {
                GameMonoHelper.GetInstance().LoadGameScene("RealGame-EmptyScene", true, delegate
                {
                    UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_TopBar);
                    ShowWindowData showData   = new ShowWindowData();
                    showData.checkNavigation  = true;
                    showData.ignoreAddNavData = true;
                    UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_LevelDetail, showData);
                });
            };
        }
Exemplo n.º 22
0
        public override void InitWindowOnAwake()
        {
            InitWindowCoreData();
            base.InitWindowOnAwake();

            lbMsg        = GameUtility.FindDeepChild <UILabel>(this.gameObject, "Message");
            btnCenter    = GameUtility.FindDeepChild(this.gameObject, "Btns/CenterBtn").gameObject;
            btnRight     = GameUtility.FindDeepChild(this.gameObject, "Btns/RightBtn").gameObject;
            btnLeft      = GameUtility.FindDeepChild(this.gameObject, "Btns/LeftBtn").gameObject;
            btnClose     = GameUtility.FindDeepChild(this.gameObject, "Btns/Close").gameObject;
            objAnimation = GameUtility.FindDeepChild(this.gameObject, "Center").gameObject;
            lbCenter     = GameUtility.FindDeepChild <UILabel>(this.gameObject, "Btns/CenterBtn/Label");
            lbLeft       = GameUtility.FindDeepChild <UILabel>(this.gameObject, "Btns/LeftBtn/Label");
            lbRight      = GameUtility.FindDeepChild <UILabel>(this.gameObject, "Btns/RightBtn/Label");

            UIEventListener.Get(btnClose).onClick = delegate
            {
                UICenterMasterManager.Instance.CloseMessageBox();
            };
        }
Exemplo n.º 23
0
        public override void InitWindowOnAwake()
        {
            this.windowID = WindowID.WindowID_LevelDetail;
            base.InitWindowOnAwake();
            InitWindowData();

            btnStart = GameUtility.FindDeepChild(this.gameObject, "LevelDetailRight/BtnEnter").gameObject;
            twAlpha  = this.gameObject.GetComponent <TweenAlpha>();

            UIEventListener.Get(btnStart).onClick = delegate
            {
                // Application.LoadLevel("AnimationCurve");
                GameMonoHelper.GetInstance().LoadGameScene("AnimationCurve",
                                                           delegate
                {
                    UIManager.GetInstance().ShowWindow(WindowID.WindowID_Matching);
                    UIManager.GetInstance().GetGameWindowScript <UIMatching>(WindowID.WindowID_Matching).SetMatchingData(this.windowID);
                });
            };
        }
Exemplo n.º 24
0
        public override void InitWindowOnAwake()
        {
            base.InitWindowOnAwake();
            InitWindowCoreData();

            btnWin  = GameUtility.FindDeepChild(this.gameObject, "BtnWin").gameObject;
            btnLose = GameUtility.FindDeepChild(this.gameObject, "BtnLose").gameObject;
            btnShop = GameUtility.FindDeepChild(this.gameObject, "BtnShop").gameObject;

            // win the game
            // load new scene to show target window
            UIEventListener.Get(btnWin).onClick = delegate
            {
                GameMonoHelper.GetInstance().LoadGameScene("RealGame-EmptyScene", false, delegate
                {
                    UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_MatchResult);
                    UIBaseWindow baseWindow = UICenterMasterManager.Instance.GetGameWindow(WindowID.WindowID_MatchResult);
                    ((UIMatchResult)baseWindow).SetMatchResult(true, targetBackWindowId);
                });
            };

            // lose the game
            // load new scene to show target window
            UIEventListener.Get(btnLose).onClick = delegate
            {
                GameMonoHelper.GetInstance().LoadGameScene("RealGame-EmptyScene", false, delegate
                {
                    UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_MatchResult);
                    UIBaseWindow baseWindow = UICenterMasterManager.Instance.GetGameWindow(WindowID.WindowID_MatchResult);
                    ((UIMatchResult)baseWindow).SetMatchResult(false, targetBackWindowId);
                });
            };

            // show navigation window shop
            UIEventListener.Get(btnShop).onClick = delegate
            {
                UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_Shop);
            };
        }
Exemplo n.º 25
0
        public override void InitWindowOnAwake()
        {
            this.windowID = WindowID.WindowID_Matching;
            base.InitWindowOnAwake();

            InitWindowData();

            btnWin  = GameUtility.FindDeepChild(this.gameObject, "BtnWin").gameObject;
            btnLose = GameUtility.FindDeepChild(this.gameObject, "BtnLose").gameObject;

            // win the game
            UIEventListener.Get(btnWin).onClick = delegate
            {
                GameMonoHelper.GetInstance().LoadGameScene("TestEmptyScene", delegate
                {
                    // 是否需要一个退出比赛单独接口?
                    // UIManager.GetInstance().ShowWindow(WindowID.WindowID_TopBar);
                    // UIManager.GetInstance().ShowWindow(WindowID.WindowID_LevelDetail);

                    UIManager.GetInstance().ShowWindow(WindowID.WindowID_MatchResult);
                    UIBaseWindow baseWindow = UIManager.GetInstance().GetGameWindow(WindowID.WindowID_MatchResult);
                    ((UIMatchResult)baseWindow).SetMatchResult(true, targetBackWindowId);
                });
            };

            // lose the game
            UIEventListener.Get(btnLose).onClick = delegate
            {
                GameMonoHelper.GetInstance().LoadGameScene("TestEmptyScene", delegate
                {
                    UIManager.GetInstance().ShowWindow(WindowID.WindowID_MatchResult);
                    UIBaseWindow baseWindow = UIManager.GetInstance().GetGameWindow(WindowID.WindowID_MatchResult);
                    ((UIMatchResult)baseWindow).SetMatchResult(false, targetBackWindowId);
                });
            };
        }
Exemplo n.º 26
0
        public override void InitWindowOnAwake()
        {
            base.InitWindowOnAwake();
            InitWindowCoreData();

            twPositions = new TweenPosition[4];
            btnInfor    = GameUtility.FindDeepChild(this.gameObject, "LeftBottom/Btns/Btn_Infor").gameObject;
            btnRank     = GameUtility.FindDeepChild(this.gameObject, "LeftBottom/Btns/Btn_Rank").gameObject;
            btnLevel    = GameUtility.FindDeepChild(this.gameObject, "LeftBottom/Btns/Btn_Level").gameObject;
            btnSwitch   = GameUtility.FindDeepChild(this.gameObject, "BottomRight/Btn_Switch").gameObject;
            btnSkill    = GameUtility.FindDeepChild(this.gameObject, "LeftBottom/Btns/Btn_Skill").gameObject;
            lbSwitch    = GameUtility.FindDeepChild <UILabel>(this.gameObject, "BottomRight/Btn_Switch/Label");

            twPositions[0] = btnInfor.GetComponent <TweenPosition>();
            twPositions[1] = btnRank.GetComponent <TweenPosition>();
            twPositions[2] = btnLevel.GetComponent <TweenPosition>();
            twPositions[3] = btnSkill.GetComponent <TweenPosition>();

            UIEventListener.Get(btnRank).onClick = delegate
            {
                ShowWindowData showData = new ShowWindowData();
                showData.forceResetWindow = true;

                string[] headIcons = new string[] { "Rambo", "Angry", "Smile", "Laugh", "Dead", "Frown", "Annoyed" };

                // fill the rank data
                ContextDataRank contextData = new ContextDataRank();
                contextData.listRankItemDatas = new List <RankItemData>();

                // rank list
                for (int i = 0; i < 10; i++)
                {
                    RankItemData newData = new RankItemData();
                    newData.playerName        = headIcons[UnityEngine.Random.Range(0, headIcons.Length)];
                    newData.headIcon          = "Emoticon - " + newData.playerName;
                    newData.playerName        = "Mr." + newData.playerName;
                    newData.playerDescription = string.Format("I'm {0}", newData.playerName);
                    contextData.listRankItemDatas.Add(newData);
                }
                showData.contextData = contextData;
                UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_Rank, showData);
            };

            UIEventListener.Get(btnSwitch).onClick = delegate
            {
                switchFlag = !switchFlag;
                if (switchFlag)
                {
                    ShowBtns();
                }
                else
                {
                    HideBtns();
                }
            };

            UIEventListener.Get(btnLevel).onClick = delegate
            {
                UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_Level);
            };

            UIEventListener.Get(btnSkill).onClick = delegate
            {
                UICenterMasterManager.Instance.ShowWindow(WindowID.WindowID_Skill);
            };
        }