void OnInitialize() { LuaManager.InitStart(); LuaManager.DoFile("Logic/Game"); //加载游戏 Util.CallMethod("Game", "OnInitOK"); //初始化完成 KBEMain km = GameObject.Find("ClientApp").GetComponent <KBEMain>(); if (km != null) { km.initKBEngine(); } initialize = true; }
protected override void OnShow(INotification notification) { if (PlayerPrefs.HasKey("UserName") && PlayerPrefs.HasKey("UserPass")) { panel.txtPassword.value = PlayerPrefs.GetString("UserName"); user = panel.txtPassword.value; panel.txtPassword.value = PlayerPrefs.GetString("UserPass"); pass = panel.txtPassword.value; } Facade.SendNotification(NotificationID.UpdateResources_Close); KBEMain.StartClientap("192.168.1.106"); }
/// <summary> /// 初始化游戏管理器 /// </summary> void Start() { DontDestroyOnLoad(gameObject); //防止销毁自己 mLuaManager = gameObject.GetComponent <LuaManager>(); if (mLuaManager == null) { mLuaManager = gameObject.AddComponent <LuaManager>(); } mKbeMain = gameObject.GetComponent <KBEMain>(); if (mKbeMain == null) { mKbeMain = gameObject.AddComponent <KBEMain>(); } OnInitialize(); }
/// <summary> /// 点击事件 /// </summary> private void OnClick(GameObject go) { if (go == m_Panel.startGameBtn.gameObject) { if (panel.serverName.text == string.Empty) { GUIManager.SetPromptInfo(TextManager.GetUIString("UIServer"), null); return; } if (loginSucess) { return; } loginSucess = true; KBEMain.StartClientap(PlayerPrefs.GetString("UserServer")); TimerManager.AddTimerRepeat(m_timerLoginKey, 0.5f, OnTimer_LoginQiYouGame); } else if (go == m_Panel.chooseBtn.gameObject) { panel.chooseServer.gameObject.SetActive(true); panel.ServerGrid.mgridItem = panel.ServerItem.gameObject; panel.ServerGrid.AddCustomDataList(AddListGrid(ServerConfig.serverList)); } else if (go == m_Panel.recommendBtn.gameObject) { panel.ServerGrid.AddCustomDataList(AddListGrid(ServerConfig.serverList)); } else if (go == m_Panel.oldAccountBtn.gameObject) { panel.ServerGrid.AddCustomDataList(AddListGrid(ServerConfig.serverList)); } else if (go == m_Panel.backBtn.gameObject) { panel.chooseServer.gameObject.SetActive(false); } }
private void Awake() { kbemain = gameObject.GetComponent <KBEMain>(); }