예제 #1
0
        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;
        }
예제 #2
0
 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));
     //}
 }
예제 #3
0
 void onPayFailed(string msg)
 {
     Debug.Log("onPayFailed: " + msg);
     if (ChannelMgr.m_OnPayCallBack != null)
     {
         ChannelMgr.m_OnPayCallBack(msg);
     }
 }
예제 #4
0
 void onPayUnknown(string msg)
 {
     Debug.Log("onPayUnknown: " + msg);
     if (ChannelMgr.m_OnPayCallBack != null)
     {
         ChannelMgr.m_OnPayCallBack(msg);
     }
 }
예제 #5
0
 void onPaySuccess(string msg)
 {
     Debug.Log("onPaySuccess: " + msg);
     if (ChannelMgr.m_OnPayCallBack != null)
     {
         ChannelMgr.m_OnPayCallBack(msg);
     }
 }
예제 #6
0
 void onSwitchUsered(string msg)
 {
     //yxyLog.Log("onSwitchUsered: " + msg);
     //GameConfig.Username = Platform.GetInstance().Plat_GetUid();
     ChannelMgr.UpdateLogoutSrc();
     //if (ChannelMgr.LogoutSrc == LogOutSrc.InGame)
     //{
     //    StartCoroutine(SwitchAccountCoroutinue(true));
     //}
 }
예제 #7
0
        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]);

        }       
예제 #8
0
 static int Logout(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 0);
         ChannelMgr.Logout();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #9
0
 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));
     }
 }
예제 #10
0
 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));
     }
 }
예제 #11
0
        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);
            }
        }
예제 #12
0
 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));
     }
 }
예제 #13
0
 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);
     }
 }
예제 #14
0
        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);

        }
예제 #15
0
        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();
        }
예제 #16
0
    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);
        }
    }
예제 #17
0
        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;
            }
        }