Example #1
0
        public override void Awake()
        {
            var t = mDMono.transform;

            Collider      = t.GetComponentInChildren <BoxCollider>();
            PartnerItem   = PartnerItem ?? t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Hotfix_LT.UI.FormationPartnerItemEx");
            formationCtrl = formationCtrl ?? t.GetComponentInParent <UIControllerILR>().transform.GetUIControllerILRComponent <NationBattleFormationController>();

            if (mDMono.StringParamList != null)
            {
                var count = mDMono.StringParamList.Count;

                if (count > 0)
                {
                    TeamName = mDMono.StringParamList[0];
                }
            }

            if (mDMono.IntParamList != null)
            {
                var count = mDMono.IntParamList.Count;

                if (count > 0)
                {
                    IndexInTeam = mDMono.IntParamList[0];
                }
            }

            t.GetComponentEx <UIEventTrigger>().onDrag.Add(new EventDelegate(mDMono, "OnDragStart"));
            t.GetComponentEx <UIEventTrigger>().onDrag.Add(new EventDelegate(mDMono, "OnDrag"));
            t.GetComponentEx <UIEventTrigger>().onDrag.Add(new EventDelegate(mDMono, "OnDragEnd"));
        }
Example #2
0
        public override void Awake()
        {
            base.Awake();

            var t = controller.transform;

            PathTabLabeList    = new UILabel[3];
            PathTabLabeList[0] = t.GetComponent <UILabel>("Content/PathTabGrid/0/Label");
            PathTabLabeList[1] = t.GetComponent <UILabel>("Content/PathTabGrid/1/Label");
            PathTabLabeList[2] = t.GetComponent <UILabel>("Content/PathTabGrid/2/Label");

            UIPathToggles    = new UIToggle[3];
            UIPathToggles[0] = t.GetComponent <UIToggle>("Content/PathTabGrid/0");
            UIPathToggles[1] = t.GetComponent <UIToggle>("Content/PathTabGrid/1");
            UIPathToggles[2] = t.GetComponent <UIToggle>("Content/PathTabGrid/2");

            TeamItems    = new NationBattleSelectTeamCell[3];
            TeamItems[0] = t.GetMonoILRComponent <NationBattleSelectTeamCell>("Content/TeamList/0");
            TeamItems[1] = t.GetMonoILRComponent <NationBattleSelectTeamCell>("Content/TeamList/1");
            TeamItems[2] = t.GetMonoILRComponent <NationBattleSelectTeamCell>("Content/TeamList/2");

            FormationPartnerItems    = new FormationPartnerItemEx[12];
            FormationPartnerItems[0] = t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Content/TeamList/0/PartnerUIGrid/0_Pos", "Hotfix_LT.UI.FormationPartnerItemEx");
            FormationPartnerItems[1] = t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Content/TeamList/0/PartnerUIGrid/0_Pos (1)", "Hotfix_LT.UI.FormationPartnerItemEx");
            FormationPartnerItems[2] = t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Content/TeamList/0/PartnerUIGrid/0_Pos (2)", "Hotfix_LT.UI.FormationPartnerItemEx");
            FormationPartnerItems[3] = t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Content/TeamList/0/PartnerUIGrid/0_Pos (3)", "Hotfix_LT.UI.FormationPartnerItemEx");

            FormationPartnerItems[4] = t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Content/TeamList/1/PartnerUIGrid/0_Pos", "Hotfix_LT.UI.FormationPartnerItemEx");
            FormationPartnerItems[5] = t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Content/TeamList/1/PartnerUIGrid/0_Pos (1)", "Hotfix_LT.UI.FormationPartnerItemEx");
            FormationPartnerItems[6] = t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Content/TeamList/1/PartnerUIGrid/0_Pos (2)", "Hotfix_LT.UI.FormationPartnerItemEx");
            FormationPartnerItems[7] = t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Content/TeamList/1/PartnerUIGrid/0_Pos (3)", "Hotfix_LT.UI.FormationPartnerItemEx");

            FormationPartnerItems[8]  = t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Content/TeamList/2/PartnerUIGrid/0_Pos", "Hotfix_LT.UI.FormationPartnerItemEx");
            FormationPartnerItems[9]  = t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Content/TeamList/2/PartnerUIGrid/0_Pos (1)", "Hotfix_LT.UI.FormationPartnerItemEx");
            FormationPartnerItems[10] = t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Content/TeamList/2/PartnerUIGrid/0_Pos (2)", "Hotfix_LT.UI.FormationPartnerItemEx");
            FormationPartnerItems[11] = t.GetMonoILRComponentByClassPath <FormationPartnerItemEx>("Content/TeamList/2/PartnerUIGrid/0_Pos (3)", "Hotfix_LT.UI.FormationPartnerItemEx");

            Path = string.Empty;
            LeftReviveTimeLabel   = t.GetComponent <UILabel>("Content/TimeBtn/Countdown");
            ReviveButton          = t.GetComponent <UIButton>("Content/ReviveBtn");
            TimeButton            = t.GetComponent <UIButton>("Content/TimeBtn");
            isAllTeamDeath        = false;
            ReviveCostLabel       = t.GetComponent <UILabel>("Content/ReviveBtn/HC");
            controller.backButton = t.GetComponent <UIButton>("LTPopFrame/CloseBtn");

            t.GetComponent <UIButton>("Content/ReviveBtn").onClick.Add(new EventDelegate(() => OnReviveBtnClick(null)));
            t.GetComponent <UIButton>("Content/TimeBtn").onClick.Add(new EventDelegate(OnCancelButtonClick));


            t.GetComponent <UIToggle>("Content/PathTabGrid/0").onChange.Add(new EventDelegate(() => OnSelectPathClick(t.GetComponent <UIToggle>("Content/PathTabGrid/0"))));
            t.GetComponent <UIToggle>("Content/PathTabGrid/1").onChange.Add(new EventDelegate(() => OnSelectPathClick(t.GetComponent <UIToggle>("Content/PathTabGrid/1"))));
            t.GetComponent <UIToggle>("Content/PathTabGrid/2").onChange.Add(new EventDelegate(() => OnSelectPathClick(t.GetComponent <UIToggle>("Content/PathTabGrid/2"))));
        }