コード例 #1
0
 void OnApplicationQuit()
 {
     PlayerManager.GetSingleton().Clear();
     ClientService.GetSingleton().Disconnect();
     SceneMachine.GetSingleton().Destroy();
     Application.Quit();
 }
コード例 #2
0
        public void GotoScene(SceneType type)
        {
            m_CurrentSceneType = type;
            string tmpSceneName = type.ToString();

            if (SceneMachine == null)
            {
                SceneMachine = SceneMachine.GetSingleton();
            }

            GameScene tmpScene = SceneMachine.GetState(tmpSceneName) as GameScene;

            if (tmpScene == null)
            {
                return;
            }
            GameScene tmpCurrentScene = SceneMachine.GetCurrentScene() as GameScene;

            if (tmpCurrentScene == tmpScene)
            {
                //两次跳转的场景相同,则返回;
                return;
            }
            SceneMachine.SetNextState(tmpScene.pStateName);
        }
コード例 #3
0
ファイル: Player.cs プロジェクト: l2xin/graduation-design
        private void NotifyCharacterEnd()
        {
            GameScene mScene = SceneMachine.GetCurrentScene() as GameScene;

            if (mScene != null)
            {
                mScene.NotifySceneEvent(new EventEX <Player>((int)SceneEventType.SE_CharacterEnd, this));
            }
        }
コード例 #4
0
    // Update is called once per frame
    void Update()
    {
        TimerHeap.Tick();

        ClientService.GetSingleton().Update();

        SceneMachine.GetSingleton().OnUpdate();

        PlayerManager.GetSingleton().OnUpdate();
    }
コード例 #5
0
    void Awake()
    {
        DontDestroyOnLoad(gameObject);


        WindowManager.GetSingleton();

        SceneMachine.GetSingleton().Init();

        SceneMachine.GetSingleton().ChangeScene(GameSceneType.FrameScene);
    }
コード例 #6
0
        private void RegisterSceneEvent()
        {
            mScene = SceneMachine.GetCurrentScene() as GameScene;

            if (mScene != null)
            {
                mScene.RegisterSceneEvent(SceneEventType.SE_NotifyTSDKLoginSucceed, TSDKLoginSuccees);
                mScene.RegisterSceneEvent(SceneEventType.SE_NotifyTSDKLoginFail, OnLoginFail);
                mScene.RegisterSceneEvent(SceneEventType.SE_NotifyStartTSDKLogin, OnStartLogin);
                mScene.RegisterSceneEvent(SceneEventType.SE_NotifyVersionUpdate, OnStatrVersionCheck);
                mScene.RegisterSceneEvent(SceneEventType.SE_NotifyConfigCheck, StartConfigCheck);
            }

            mGlobalEventQueue = new EventHandlerQueue(CrossContextEventProcessor.GetInstance());
            mGlobalEventQueue.Add((int)CrossContextEventType.GE_NetWorkState, OnNetWorkState);
        }
コード例 #7
0
        /// <summary>
        /// Initilize our game here.
        /// </summary>
        void InitGame()
        {
            Application.targetFrameRate = 30;              // disable vsync and set target frame rate to 30fps

            Screen.sleepTimeout = SleepTimeout.NeverSleep; // keep the screen always display

            // initiaize SceneMachine and register scenes
            SceneMachine = SceneMachine.GetSingleton();
            SceneMachine.RegisterState(new LoginScene());
            SceneMachine.RegisterState(new MainScene());

            //  ModuleManager.GetInstance().CreateContext<LoginContext>();

            //LoginContext<LoginModuleController, LoginViewController> context = ModuleManager.GetInstance().CreateViewContext<LoginModuleController, LoginViewController>() as LoginContext<LoginModuleController, LoginViewController>;

            //LoginContext<LoginController, LoginViewController> loginContext = ContextManager.GetInstance().Add<LoginContext<LoginController, LoginViewController>>();
            //ContextManager.GetInstance().Add<ResContext<ResController>>();

            Air2000.Res.ResContext.ListenInitializeFinish += OnResourceManagerInitialized;
            Air2000.Res.ResContext.Initialize();
        }
コード例 #8
0
ファイル: LoginModel.cs プロジェクト: l2xin/graduation-design
 public void RegisterSceneEvent()
 {
     mScene = SceneMachine.GetCurrentScene() as GameScene;
 }