Esempio n. 1
0
        public override void Awake()
        {
            base.Awake();
            var t = controller.transform;

            Scroll = t.Find("Anchor_Mid/Content/Partners/Placeholder/Grid").GetMonoILRComponent <LTSSRWishScroll>();
            controller.backButton = t.Find("Anchor_Mid/Content/Top/CloseBtn").GetComponent <UIButton>();

            battleReady = t.GetMonoILRComponent <BattleReadyTitle>("Anchor_Mid/Content/Top/Title");

            t.GetComponent <UIButton>("Anchor_Mid/Content/Top/BtnList/FengBtn").onClick.Add(new EventDelegate(
                                                                                                () =>
            {
                battleReady.OnTitleBtnClick(t.FindEx("Anchor_Mid/Content/Top/BtnList/FengBtn/Sprite").gameObject);
                RefreshPartnerList(eAttrTabType.Feng);
            }));
            t.GetComponent <UIButton>("Anchor_Mid/Content/Top/BtnList/HuoBtn").onClick.Add(new EventDelegate(
                                                                                               () =>
            {
                battleReady.OnTitleBtnClick(t.FindEx("Anchor_Mid/Content/Top/BtnList/HuoBtn/Sprite").gameObject);
                RefreshPartnerList(eAttrTabType.Huo);
            }));
            t.GetComponent <UIButton>("Anchor_Mid/Content/Top/BtnList/ShuiBtn").onClick.Add(new EventDelegate(
                                                                                                () =>
            {
                battleReady.OnTitleBtnClick(t.FindEx("Anchor_Mid/Content/Top/BtnList/ShuiBtn/Sprite").gameObject);
                RefreshPartnerList(eAttrTabType.Shui);
            }));
        }
Esempio n. 2
0
        public override void Awake()
        {
            base.Awake();
            var t = controller.transform;

            judgePosList = controller.FetchComponentList <Transform>(GetArray(
                                                                         "Center/One/Center/Container", "Center/One/Center/Container (1)", "Center/One/Center/Container (2)",
                                                                         "Center/One/Center/Container (3)", "Center/One/Center/Container (4)", "Center/One/Center/Container (5)",
                                                                         "Center/One (1)/Center/Container", "Center/One (1)/Center/Container (1)", "Center/One (1)/Center/Container (2)",
                                                                         "Center/One (1)/Center/Container (3)", "Center/One (1)/Center/Container (4)", "Center/One (1)/Center/Container (5)",
                                                                         "Center/One (2)/Center/Container", "Center/One (2)/Center/Container (1)", "Center/One (2)/Center/Container (2)",
                                                                         "Center/One (2)/Center/Container (3)", "Center/One (2)/Center/Container (4)", "Center/One (2)/Center/Container (5)"));
            cellIcons = new List <CombatPartnerCellController>();
            foreach (var judgeItem in judgePosList)
            {
                CombatPartnerCellController temp = judgeItem.GetMonoILRComponent <CombatPartnerCellController>("DragPartnerItem");
                // judgeItem.GetComponent<ContinueClickCDTrigger>().m_CallBackPress.Add(new EventDelegate(() => OnClickOutTeam(judgeItem)));
                cellIcons.Add(temp);
                DragEventDispatcher DragEventDispatcher = judgeItem.GetComponent <DragEventDispatcher>();
                DragEventDispatcher.onDragStartFunc.Add(new EventDelegate(() => { OnDragStartFromCenter(judgeItem); }));
                DragEventDispatcher.onDragFunc.Add(new EventDelegate(OnDrag));
                DragEventDispatcher.onDragEndFunc.Add(new EventDelegate(OnDragEndFromCenter));
            }

            BottomBoxCollider = t.GetComponent <BoxCollider>("Edge/Bottom/BuddyList/Placeholder");
            DynamicScroll     = t.GetMonoILRComponent <CombatPartnerDynamicScroll>("Edge/Bottom/BuddyList/Placeholder/PartnerGrid");
            DragPartnerCell   = t.GetMonoILRComponent <CombatPartnerCellController>("Edge/DragPanel/DragPartnerItem");

            tranBtns = controller.FetchComponentList <UIButton>(GetArray("Center/One/Tran", "Center/One (1)/Tran", "Center/One (2)/Tran"));
            tranBtns[0].onClick.Add(new EventDelegate(() => { TranBtnClick(tranBtns[0], 0); }));
            tranBtns[1].onClick.Add(new EventDelegate(() => { TranBtnClick(tranBtns[1], 1); }));
            tranBtns[2].onClick.Add(new EventDelegate(() => { TranBtnClick(tranBtns[2], 2); }));
            tranBtnsFx = new List <GameObject>();
            for (int i = 0; i < tranBtns.Count; i++)
            {
                tranBtnsFx.Add(tranBtns[i].transform.Find("FX").gameObject);
            }
            checkEnemyBtn = t.GetComponent <UIButton>("Edge/TopRight/CheckEnemyFormationLabel");
            checkEnemyBtn.onClick.Add(new EventDelegate(OnCheckEnemyBtnClick));
            startBtnPanel = t.Find("Edge/Bottom/StartBtnPanel").gameObject;
            startBtn      = t.GetComponent <UIButton>("Edge/Bottom/StartBtnPanel/BG/StartBattleBtn");
            startBtn.onClick.Add(new EventDelegate(OnStartBtnClick));
            t.GetComponent <UIButton>("Edge/Bottom/BG/RuleBtn").onClick.Add(new EventDelegate(OnAttrInfoBtnClick));
            UIButton backButton = t.GetComponent <UIButton>("Edge/LeftUp/CancelBtn");

            backButton.onClick.Add(new EventDelegate(OnCancelButtonClick));

            BattleReadyTitle battleReady = t.GetMonoILRComponent <BattleReadyTitle>("Edge/Bottom/BG/Title");
            UIButton         AllBtn      = t.GetComponent <UIButton>("Edge/Bottom/BG/Title/BtnList/AllBtn");

            AllBtn.onClick.Add(new EventDelegate(() => OnRaceTabClick(t.FindEx("Edge/Bottom/BG/Title/BtnList/AllBtn").gameObject)));
            UIButton FengBtn = t.GetComponent <UIButton>("Edge/Bottom/BG/Title/BtnList/FengBtn");

            FengBtn.onClick.Add(new EventDelegate(() => OnRaceTabClick(t.FindEx("Edge/Bottom/BG/Title/BtnList/FengBtn").gameObject)));
            UIButton HuoBtn = t.GetComponent <UIButton>("Edge/Bottom/BG/Title/BtnList/HuoBtn");

            HuoBtn.onClick.Add(new EventDelegate(() => OnRaceTabClick(t.FindEx("Edge/Bottom/BG/Title/BtnList/HuoBtn").gameObject)));
            UIButton ShuiBtn = t.GetComponent <UIButton>("Edge/Bottom/BG/Title/BtnList/ShuiBtn");

            ShuiBtn.onClick.Add(new EventDelegate(() => OnRaceTabClick(t.FindEx("Edge/Bottom/BG/Title/BtnList/ShuiBtn").gameObject)));

            AllBtn.onClick.Add(new EventDelegate(() => { battleReady.OnTitleBtnClick(AllBtn.transform.FindEx("Sprite").gameObject); }));
            FengBtn.onClick.Add(new EventDelegate(() => { battleReady.OnTitleBtnClick(FengBtn.transform.FindEx("Sprite").gameObject); }));
            HuoBtn.onClick.Add(new EventDelegate(() => { battleReady.OnTitleBtnClick(HuoBtn.transform.FindEx("Sprite").gameObject); }));
            ShuiBtn.onClick.Add(new EventDelegate(() => { battleReady.OnTitleBtnClick(ShuiBtn.transform.FindEx("Sprite").gameObject); }));
        }
Esempio n. 3
0
        public override void Awake()
        {
            base.Awake();

            var t = controller.transform;

            uIGrid                     = t.Find("Edge/Bottom/Grid").GetComponent <UIGrid>();
            SelectSwitchEquip          = t.Find("Edge/Bottom/Grid/SwitchEquipBtn/SelectToggle").GetComponent <UIToggle>();
            SelectSwitchPeak           = t.Find("Edge/Bottom/Grid/SwitchPeakBtn/SelectToggle").GetComponent <UIToggle>();
            SelectSwitchPo             = t.Find("Edge/Bottom/Grid/SwitchPoBtn/SelectToggle").GetComponent <UIToggle>();
            typeSprite_1               = t.GetComponent <UISprite>("Edge/Center/LeftPartCell/Type");
            typeSprite_2               = t.GetComponent <UISprite>("Edge/Center/RightPartCell/Type");
            leftNameLabel              = t.GetComponent <UILabel>("Edge/Center/LeftPartCell/Label");
            rightNameLabel             = t.GetComponent <UILabel>("Edge/Center/RightPartCell/Label (1)");
            transPriceLabel            = t.GetComponent <UILabel>("Edge/Bottom/TransBtn/Label_1");
            DiamondSprite              = t.GetComponent <UISprite>("Edge/Bottom/TransBtn/Sprite");
            pricefreelabel             = t.FindEx("Edge/Bottom/TransBtn/Label_2").gameObject;
            DynamicScroll              = t.GetMonoILRComponent <CombatPartnerDynamicScroll>("Edge/Bottom/BuddyList/Placeholder/PartnerGrid");
            DragPartnerCell            = t.GetMonoILRComponent <CombatPartnerCellController>("Edge/DragPanel/DragPartnerItem");
            LeftFx                     = t.FindEx("Edge/Center/LeftPartCell/Container/fx_hb_UI_Zhuanhuan_1").gameObject;
            RightFx                    = t.FindEx("Edge/Center/RightPartCell/Container/fx_hb_UI_Zhuanhuan_2").gameObject;
            DRAG_Z                     = -2f;
            MIN_DRAG_DIST              = 0.35f;
            DRAG_OFFSET_DIST           = 0.12f;
            MIN_DRAG_IN_DIST           = 0.34f;
            CHALLENGE_MIN_DRAG_IN_DIST = 0.2f;
            judgePosLeft               = t.GetComponent <Transform>("Edge/Center/LeftPartCell/Container");
            judgePosRight              = t.GetComponent <Transform>("Edge/Center/RightPartCell/Container");
            leftIcon                   = t.GetMonoILRComponent <CombatPartnerCellController>("Edge/Center/LeftPartCell/Container/DragPartnerItem");
            rightIcon                  = t.GetMonoILRComponent <CombatPartnerCellController>("Edge/Center/RightPartCell/Container/DragPartnerItem");
            MoveSpeed                  = 5f;
            tempWorldVec               = Vector3.zero;
            UIButton backButton = t.GetComponent <UIButton>("Edge/LeftUp/CancelBtn");

            backButton.onClick.Add(new EventDelegate(OnCancelButtonClick));

            BattleReadyTitle battleReady = t.GetMonoILRComponent <BattleReadyTitle>("Edge/Bottom/BG/Title");
            UIButton         AllBtn      = t.GetComponent <UIButton>("Edge/Bottom/BG/Title/BtnList/AllBtn");

            AllBtn.onClick.Add(new EventDelegate(() => OnRaceTabClick(t.FindEx("Edge/Bottom/BG/Title/BtnList/AllBtn").gameObject)));
            UIButton FengBtn = t.GetComponent <UIButton>("Edge/Bottom/BG/Title/BtnList/FengBtn");

            FengBtn.onClick.Add(new EventDelegate(() => OnRaceTabClick(t.FindEx("Edge/Bottom/BG/Title/BtnList/FengBtn").gameObject)));
            UIButton HuoBtn = t.GetComponent <UIButton>("Edge/Bottom/BG/Title/BtnList/HuoBtn");

            HuoBtn.onClick.Add(new EventDelegate(() => OnRaceTabClick(t.FindEx("Edge/Bottom/BG/Title/BtnList/HuoBtn").gameObject)));
            UIButton ShuiBtn = t.GetComponent <UIButton>("Edge/Bottom/BG/Title/BtnList/ShuiBtn");

            ShuiBtn.onClick.Add(new EventDelegate(() => OnRaceTabClick(t.FindEx("Edge/Bottom/BG/Title/BtnList/ShuiBtn").gameObject)));

            AllBtn.onClick.Add(new EventDelegate(() => { battleReady.OnTitleBtnClick(AllBtn.transform.FindEx("Sprite").gameObject); }));
            FengBtn.onClick.Add(new EventDelegate(() => { battleReady.OnTitleBtnClick(FengBtn.transform.FindEx("Sprite").gameObject); }));
            HuoBtn.onClick.Add(new EventDelegate(() => { battleReady.OnTitleBtnClick(HuoBtn.transform.FindEx("Sprite").gameObject); }));
            ShuiBtn.onClick.Add(new EventDelegate(() => { battleReady.OnTitleBtnClick(ShuiBtn.transform.FindEx("Sprite").gameObject); }));


            t.GetComponent <ConsecutiveClickCoolTrigger>("Edge/Bottom/TransBtn").clickEvent.Add(new EventDelegate(OnPartnerTransClick));
            t.GetComponent <UIButton>("Edge/Bottom/RuleBtn").onClick.Add(new EventDelegate(OnRuleBtnClick));

            t.GetComponent <ContinueClickCDTrigger>("Edge/Center/LeftPartCell/Container").m_CallBackPress.Add(new EventDelegate(() => OnClickOutTeam(t.GetComponent <Transform>("Edge/Center/LeftPartCell/Container"), t.GetComponent <UILabel>("Edge/Center/LeftPartCell/Label"))));
            t.GetComponent <ContinueClickCDTrigger>("Edge/Center/RightPartCell/Container").m_CallBackPress.Add(new EventDelegate(() => OnClickOutTeam(t.GetComponent <Transform>("Edge/Center/RightPartCell/Container"), t.GetComponent <UILabel>("Edge/Center/RightPartCell/Label (1)"))));
        }
Esempio n. 4
0
        private void InitView()
        {
            var t = controller.transform;

            vsTexture            = t.GetComponent <UITexture>("VsTexture");
            myPointLabel         = t.GetComponent <UILabel>("LeftTopHold/Jifei/ProgressBar/Label");
            otherPointLabel      = t.GetComponent <UILabel>("RightTopHold/Jifei (1)/ProgressBar/Label");
            myLeftPointBar       = t.GetComponent <UIProgressBar>("LeftTopHold/Jifei/ProgressBar");
            otherLeftPointBar    = t.GetComponent <UIProgressBar>("RightTopHold/Jifei (1)/ProgressBar");
            timeLabel            = t.GetComponent <UILabel>("TopCenterHold/Time_Label");
            startTimeLabel       = t.GetComponent <UILabel>("CenterHold/StartTime_Label");
            choiceStateTipsLabel = t.GetComponent <UILabel>("TopCenterHold/ChoiceState_Label");
            turnGO              = t.FindEx("TopCenterHold/YourTurn").GetComponent <UIWidget>();
            otherTurnGO         = t.FindEx("TopCenterHold/DifangTurn").GetComponent <UIWidget>();
            changeTurnTweenTime = 1.8f;
            selfNameLabel       = t.GetComponent <UILabel>("LeftTopHold/YourName_Label");
            OtherNameLabel      = t.GetComponent <UILabel>("RightTopHold/YourName_Label (1)");
            selfLevelLabel      = t.GetComponent <UILabel>("LeftTopHold/LTPlayerPortrait/TargetLevelBG/Level");
            otherLevelLabel     = t.GetComponent <UILabel>("RightTopHold/LTPlayerPortrait (1)/TargetLevelBG/Level");
            selfHeadIconSpt     = t.GetComponent <UISprite>("LeftTopHold/LTPlayerPortrait/Icon");
            otherHeadIconSpt    = t.GetComponent <UISprite>("RightTopHold/LTPlayerPortrait (1)/Icon");
            selfFrameIconSpt    = t.GetComponent <UISprite>("LeftTopHold/LTPlayerPortrait/Icon/Frame");
            otherFrameIconSpt   = t.GetComponent <UISprite>("RightTopHold/LTPlayerPortrait (1)/Icon/Frame");
            myModelShadow       = t.FindEx("MyModelShadow").gameObject;
            otherModelShadow    = t.FindEx("OtherModelShadow").gameObject;
            canChangeMyModel    = true;
            canChangeOtherModel = true;
            t.GetComponent <UIButton>("LeftTopHold/CancelBtn").onClick.Add(new EventDelegate(OnCancelButtonClick));
            t.GetComponent <UIButton>("LeftTopHold/AdmitDefeatBtn").onClick.Add(new EventDelegate(OnAdmitDefeatBtnClick));

            BattleReadyTitle battleReadyTitle = t.GetMonoILRComponent <BattleReadyTitle>("Bottom/BG/Title");

            t.GetComponent <UIButton>("Bottom/BG/Title/BtnList/AllBtn").onClick.Add(new EventDelegate(() => battleReadyTitle.OnTitleBtnClick(t.Find("Bottom/BG/Title/BtnList/AllBtn/Sprite").gameObject)));
            t.GetComponent <UIButton>("Bottom/BG/Title/BtnList/FengBtn").onClick.Add(new EventDelegate(() => battleReadyTitle.OnTitleBtnClick(t.Find("Bottom/BG/Title/BtnList/FengBtn/Sprite").gameObject)));
            t.GetComponent <UIButton>("Bottom/BG/Title/BtnList/HuoBtn").onClick.Add(new EventDelegate(() => battleReadyTitle.OnTitleBtnClick(t.Find("Bottom/BG/Title/BtnList/HuoBtn/Sprite").gameObject)));
            t.GetComponent <UIButton>("Bottom/BG/Title/BtnList/ShuiBtn").onClick.Add(new EventDelegate(() => battleReadyTitle.OnTitleBtnClick(t.Find("Bottom/BG/Title/BtnList/ShuiBtn/Sprite").gameObject)));

            t.GetComponent <TweenScale>("Bottom/BG/Title/BtnList/AllBtn/Sprite").onFinished.Add(new EventDelegate(() => battleReadyTitle.OnFinishShow(t.Find("Bottom/BG/Title/BtnList/AllBtn/Sprite/Sprite (1)").gameObject)));
            t.GetComponent <TweenScale>("Bottom/BG/Title/BtnList/FengBtn/Sprite").onFinished.Add(new EventDelegate(() => battleReadyTitle.OnFinishShow(t.Find("Bottom/BG/Title/BtnList/FengBtn/Sprite/Sprite (1)").gameObject)));
            t.GetComponent <TweenScale>("Bottom/BG/Title/BtnList/HuoBtn/Sprite").onFinished.Add(new EventDelegate(() => battleReadyTitle.OnFinishShow(t.Find("Bottom/BG/Title/BtnList/HuoBtn/Sprite/Sprite (1)").gameObject)));
            t.GetComponent <TweenScale>("Bottom/BG/Title/BtnList/ShuiBtn/Sprite").onFinished.Add(new EventDelegate(() => battleReadyTitle.OnFinishShow(t.Find("Bottom/BG/Title/BtnList/ShuiBtn/Sprite/Sprite (1)").gameObject)));

            TrusteeshipBtn = t.Find("CenterHold/TrusteeshipBtn").gameObject;
            TrusteeshipBtn.GetComponent <UIButton>().onClick.Add(new EventDelegate(OnTrusteeshipBtnClick));
            TrusteeshipOpenSprite = t.Find("CenterHold/TrusteeshipBtn/Open").gameObject;
            if (LadderManager.Instance.IsTrusteeship)
            {
                TrusteeshipOpenSprite.CustomSetActive(true);
            }
        }
Esempio n. 5
0
 public override void SetMenuData(object param)
 {
     battleReady.OnTitleBtnClick(controller.transform.FindEx("Anchor_Mid/Content/Top/BtnList/FengBtn/Sprite").gameObject);
     RefreshPartnerList(eAttrTabType.Feng);
 }