public override void Init() { base.Init(); subBtnGroup = AddComponent <ButtonGroup>(); _settingPersonalCpt = ComponentFactory.Create <Setting_PersonalCpt, GameObject, GameObject, ButtonGroup>( ReferenceCollector.Get <GameObject>("SoundTableToggle"), ReferenceCollector.Get <GameObject>("SoundView"), subBtnGroup); _settingReportCpt = ComponentFactory.Create <Setting_ReportCpt, GameObject, GameObject, ButtonGroup>( ReferenceCollector.Get <GameObject>("ReportTableToggle"), ReferenceCollector.Get <GameObject>("ReportView"), subBtnGroup); subBtnGroup.OnButtonClick(_settingPersonalCpt); }
public void Awake() { var res = ETModel.Game.Scene.GetComponent <ResourcesComponent>(); res.LoadBundle(UIType.UserCenterWin.StringToAB()); var gameObject = res.GetAsset(UIType.UserCenterWin.StringToAB(), UIType.UserCenterWin); this.panelGo = (GameObject)UnityEngine.Object.Instantiate(gameObject, this.Parent.Parent.GameObject.transform); UI ui = ComponentFactory.Create <UI, string, GameObject>(UIType.UserCenterWin, this.panelGo, false); Game.Scene.GetComponent <UIComponent>().Add(ui); _panelTweener = panelGo.transform.GetChild(1).DOScale(Vector3.one, 0.3f).Pause().SetEase(Ease.OutBack) .SetAutoKill(false); this.ReferenceCollector = this.panelGo.GetComponent <ReferenceCollector>(); this.ReferenceCollector.Get <GameObject>("CloseBtn").Get <Button>().onClick.AddListener(Close); this.ReferenceCollector.Get <GameObject>("mask").Get <Button>().onClick.AddListener(Close); ButtonGroup = AddComponent <ButtonGroup>(); UserInfoCpt = AddComponent <UserCenter_UserInfoCpt>(); var userInfoBtn = ReferenceCollector.Get <GameObject>("PersonInfoToggle"); UserInfoCpt.Awake(userInfoBtn, ReferenceCollector.Get <GameObject>("PersonView"), ButtonGroup); ReportCpt = AddComponent <Setting_ReportCpt>(); var reportBtn = ReferenceCollector.Get <GameObject>("ReportToggle"); ReportCpt.Awake(reportBtn, ReferenceCollector.Get <GameObject>("ReportView"), ButtonGroup); ButtonGroup.OnButtonClick(UserInfoCpt); }