public static SubGame Create(long GameID, int Index, Component parent) { SubGame subGame = ComponentFactory.CreateWithParent <SubGame>(parent); subGame.GameID = GameID; subGame.Index = Index; subGame.AddComponent <SubGameComponent>(); return(subGame); }
public GameLobbyGameListPlugin Awake(GameObject panel) { this.panel = panel; this._GameListsDialog = this.panel; this._rf = this.panel.GetComponent <ReferenceCollector>(); this.lobby = Game.Scene.GetComponent <UIComponent>().Get(UIType.UIHallPanel).GetComponent <GameLobbyCpt>(); this.SubGameDic = new Dictionary <int, SubGame>(); this.SubGameModelDic = new Dictionary <int, ETModel.SubGame>(); this.subGameComponentDic = new Dictionary <int, SubGameComponent>(); this.SubGameModelLoadUIDic = new Dictionary <int, ResGroupLoadUIComponent>(); var subGameInfoList = DataCenterComponent.Instance.gameInfo.SubGameInfoList; for (int i = 0; i < subGameInfoList.Count; i++) { SubGameInfo subGameInfo = subGameInfoList[i]; SubGame subGame = SubGameFactory.Create(subGameInfo.GameID, subGameInfo.Index, this); SubGameDic[i] = subGame; GameObject subGameIcon = _rf.Get <GameObject>(subGameInfo.PrefabName); subGame.GetComponent <SubGameComponent>().SetPanel(subGameIcon, subGameInfo.Index); subGameComponentDic[i] = subGame.GetComponent <SubGameComponent>(); //创建MODEL层子游戏 ETModel.SubGame subGameModel = ETModel.SubGameFactory.Create(subGameInfo.GameID, subGameInfo.Index); SubGameModelDic[i] = subGameModel; subGameModel.GetComponent <ResGroupLoadUIComponent>().SetPanel(subGameIcon, subGameModel.Index); SubGameModelLoadUIDic[i] = subGameModel.GetComponent <ResGroupLoadUIComponent>(); } #region Find this._GameType = _rf.Get <GameObject>("GameType"); //this.ZJHButton = _rf.Get<GameObject>("ZJHButton"); //this.NiuNiuButton = _rf.Get<GameObject>("NiuNiuButton"); //this.BJLButton = _rf.Get<GameObject>("BJLButton"); //this.DZButton = _rf.Get<GameObject>("DZButton"); //this.HongHeiButton = _rf.Get<GameObject>("HongHeiButton"); //this.LongHDButton = _rf.Get<GameObject>("LHDButton"); this.DDZButton = _rf.Get <GameObject>("DDZButton"); //this.SGJButton = _rf.Get<GameObject>("SGJButton"); //this.QZNNButton = _rf.Get<GameObject>("QZNNButton"); //ButtonHelper.RegisterButtonEvent(_rf, "NiuNiuButton", () => //{ // Game.PopupComponent.SetClickLock(); // this.OnNiuNiuButton(); } //); //ButtonHelper.RegisterButtonEvent(_rf, "HongHeiButton", () => //{ // Game.PopupComponent.SetClickLock(); // //this.OnHongHeiButton(); // Game.EventSystem.Run(EventIdType.HongHeiEnterGameModule); //} //); //ButtonHelper.RegisterButtonEvent(_rf, "LHDButton", () => //{ // Game.PopupComponent.SetClickLock(); // Game.EventSystem.Run(EventIdType.OnEnterNHDGameModule); //}); //ButtonHelper.RegisterButtonEvent(_rf, "BJLButton", () => //{ // Game.PopupComponent.SetClickLock(); // Game.EventSystem.Run(EventIdType.OnEnterBJLGameModule); //}); //ButtonHelper.RegisterButtonEvent(_rf, "DZButton", () => //{ // Game.PopupComponent.SetClickLock(); // this.OnDZButton(); //}); //ButtonHelper.RegisterButtonEvent(_rf, "QZNNButton", () => //{ // Game.PopupComponent.SetClickLock(); // Game.EventSystem.Run(EventIdType.OnEnterQZNNGameModule, lobby.GameLobbyGameListPlugin._GameType, lobby.GameLobbyGameTypeSelectPlugin._BackGameListsButton); //}); //ButtonHelper.RegisterButtonEvent(_rf, "ZJHButton", () => //{ // Game.PopupComponent.SetClickLock(); // this.OnZJHButton(); //}); //ButtonHelper.RegisterButtonEvent(_rf, "SGJButton", () => //{ // Game.PopupComponent.SetClickLock(); // this.OnSGJButton(); //}); ButtonHelper.RegisterButtonEvent(_rf, "DDZButton", () => { Game.PopupComponent.SetClickLock(); Game.EventSystem.Run(EventIdType.OnEnterDDZGameModule); }); #endregion this.SetAnimationEffect(); this.InitSubGameResGroup(); this.InitSubGameUpdate(); return(this); }