예제 #1
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); }));
        }
예제 #2
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)"))));
        }