protected override void Update(GameTime gameTime) { base.Update(gameTime); KeyboardState kb = Keyboard.GetState(); if ( (kb.IsKeyDown(Keys.Space) && !kbOld.IsKeyDown(Keys.Space)) || (kb.IsKeyDown(Keys.Right) && !kbOld.IsKeyDown(Keys.Right)) ) { if (channel < channels.Count-1) { channel++; ChannelMgr.ZapTo(channels[channel]); } } else if (kb.IsKeyDown(Keys.Left) && !kbOld.IsKeyDown(Keys.Left)) { if (channel > 0) { channel--; ChannelMgr.ZapTo(channels[channel]); } } else if (kb.IsKeyDown(Keys.Escape) && !kbOld.IsKeyDown(Keys.Escape)) { Exit(); } kbOld = kb; }
void DoUserLogout() { ChannelMgr.UpdateLogoutSrc(); //if (ChannelMgr.LogoutSrc == LogOutSrc.EnterGame) //{ // Debug.Log("onLogoutSuccess:Login"); // ChannelMgr.Login(); //} //else if (ChannelMgr.LogoutSrc == LogOutSrc.CreateRole) //{ // Panel_CreateRole panel = (Panel_CreateRole)UIMgr.Instance.GetPanelScript(EUIPanelID.Panel_CreateRole); // if (panel != null) // panel.OnBackClick(); // else // yxyLog.LogError("PanelCreateRole is null"); // ChannelMgr.Login(); //} //else if (ChannelMgr.LogoutSrc == LogOutSrc.ChooseRole) //{ // Panel_ChooseRole panel = (Panel_ChooseRole)UIMgr.Instance.GetPanelScript(EUIPanelID.Panel_ChooseRole); // if (panel != null) // panel.ReturnToServerSelect(); // else // yxyLog.LogError("Panel_ChooseRole is null"); // ChannelMgr.Login(); //} //else //{ // //很诡异的bug,必须启用协程,否则切换账号会崩溃!可能是7kSDK的bug // StartCoroutine(SwitchAccountCoroutinue(true)); //} }
void onPayFailed(string msg) { Debug.Log("onPayFailed: " + msg); if (ChannelMgr.m_OnPayCallBack != null) { ChannelMgr.m_OnPayCallBack(msg); } }
void onPayUnknown(string msg) { Debug.Log("onPayUnknown: " + msg); if (ChannelMgr.m_OnPayCallBack != null) { ChannelMgr.m_OnPayCallBack(msg); } }
void onPaySuccess(string msg) { Debug.Log("onPaySuccess: " + msg); if (ChannelMgr.m_OnPayCallBack != null) { ChannelMgr.m_OnPayCallBack(msg); } }
void onSwitchUsered(string msg) { //yxyLog.Log("onSwitchUsered: " + msg); //GameConfig.Username = Platform.GetInstance().Plat_GetUid(); ChannelMgr.UpdateLogoutSrc(); //if (ChannelMgr.LogoutSrc == LogOutSrc.InGame) //{ // StartCoroutine(SwitchAccountCoroutinue(true)); //} }
protected override void LoadContent() { base.LoadContent(); // Here all the tests are listed DoTest(new TestLinearMotion()); DoTest(new TestRotation()); DoTest(new TestRelativeMotion()); ChannelMgr.ZapTo(channels[0]); }
static int Logout(IntPtr L) { try { ToLua.CheckArgsCount(L, 0); ChannelMgr.Logout(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int HasUserCenter(IntPtr L) { try { ToLua.CheckArgsCount(L, 0); bool o = ChannelMgr.HasUserCenter(); LuaDLL.lua_pushboolean(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetChannel(IntPtr L) { try { ToLua.CheckArgsCount(L, 0); string o = ChannelMgr.GetChannel(); LuaDLL.lua_pushstring(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
protected override void Update(GameTime gameTime) { base.Update(gameTime); KeyboardState kb = Keyboard.GetState(); if (kb.IsKeyDown(Keys.Space)) { ChannelMgr.ZapTo(titleChannel); } else { ChannelMgr.ZapTo(gameChannel); } }
static int Pay(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); ChannelPlatform.PayInfo arg0 = (ChannelPlatform.PayInfo)ToLua.CheckObject <ChannelPlatform.PayInfo>(L, 1); ChannelMgr.Pay(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void onLoginFailed(string msg) { Debug.Log("onLoginFailed: " + msg); //UIMgr.Instance.HidePanel(EUIPanelID.Panel_EnterGame); //UIMgr.Instance.ShowPanel(EUIPanelID.Panel_EnterGame, true, false, () => //{ // EnterGameCtrl.Instance.ShowTips(LocalizeUtils.GetLocalizedStr(UIStringDefine.id220503134)); //}); // //ChannelMgr.Login(); if (ChannelMgr.m_OnLoginCallBack != null) { ChannelMgr.m_OnLoginCallBack(msg); } }
private void DoTest(Test t) { var c = ChannelMgr.CreateChannel(); c.Screen.GetComponent<ScreenComp>().BackgroundColor = t.BackgroundColor; channels.Add(c); t.Initialize(Factory); t.Create(); // add framerate counter var col = TTutil.InvertColor(t.BackgroundColor); FrameRateCounter.Create(col); Factory.CreateTextlet(new Vector2(2f, 750f), t.GetType().Name, col); }
protected override void LoadContent() { base.LoadContent(); // game channel gameChannel = ChannelMgr.CreateChannel(); ChannelMgr.ZapTo(gameChannel); gameChannel.Screen.GetComponent <ScreenComp>().BackgroundColor = Color.Black; gameChannel.Screen.GetComponent <ScreenComp>().Zoom = 2.0f; // add framerate counter FrameRateCounter.Create(Color.White); // create level level = new QuestLevel(); Level.SetCurrentLevel(level); level.Init(); }
void onLoginSuccess(string msg) { //Z_LoginInfo.getInstance().Account_crc = msg; //Const.IsLoginToGoGame = true; //LZ_GameManager.getInstance().Account_SetEvent(Const.ET_SDKLogin); Debug.Log("onLoginSuccess: " + msg); //Debug.Log("Platform.GetInstance().GetChannel: " + Platform.GetInstance().Plat_GetChannel()); //Debug.Log("Platform.GetInstance().GetOrderID: " + Platform.GetInstance().Plat_GetOrderID()); //Debug.Log("Platform.GetInstance().GetPlatformOrderID: " + Platform.GetInstance().Plat_GetPlatformOrderID()); //Debug.Log("Platform.GetInstance().GetSessionID: " + Platform.GetInstance().Plat_GetSessionID()); //Debug.Log("Platform.GetInstance().GetUid: " + Platform.GetInstance().Plat_GetUid()); //Debug.Log("Platform.GetInstance().GetUserName: " + Platform.GetInstance().Plat_GetUserName()); //GameConfig.Username = Platform.GetInstance().Plat_GetUid(); //UIMgr.Instance.HidePanel(EUIPanelID.Panel_EnterGame); //UIMgr.Instance.ShowPanel(EUIPanelID.Panel_EnterGame, true, true); if (ChannelMgr.m_OnLoginCallBack != null) { ChannelMgr.m_OnLoginCallBack(msg); } }
protected override void LoadContent() { base.LoadContent(); // title channel titleChannel = ChannelMgr.CreateChannel(); ChannelMgr.ZapTo(titleChannel); // TODO function to create on it without seeing it. titleChannel.Screen.GetComponent <ScreenComp>().BackgroundColor = Color.Black; // add framerate counter FrameRateCounter.Create(Color.White); var t = Factory.CreateMovingTextlet(new Vector2(0.5f, 0.5f), "Title Screen"); t.GetComponent <DrawComp>().DrawColor = Color.LightGoldenrodYellow; t.GetComponent <ScaleComp>().Scale = 4; // game channel gameChannel = ChannelMgr.CreateChannel(); ChannelMgr.ZapTo(gameChannel); gameChannel.Screen.GetComponent <ScreenComp>().BackgroundColor = Color.White; // add framerate counter FrameRateCounter.Create(Color.Black); // add several sprites for (float x = 0.1f; x < 1.6f; x += 0.1f) { for (float y = 0.1f; y < 1f; y += 0.1f) { Factory.CreateHyperActiveBall(new Vector2(x, y)); Factory.CreateMovingTextlet(new Vector2(x, y), "This is the\nTTengine test. !@#$1234"); //break; } //break; } }