Пример #1
0
        private static void UpdateEnviroment()
        {
            if (Time >= _fpsTime)
            {
                _fpsTime = Time + 1000;
                FPS      = _fps;
                _fps     = 0;
                DXManager.Clean(); // Clean once a second.
            }
            else
            {
                _fps++;
            }

            Network.Process();

            if (MirScene.ActiveScene != null)
            {
                MirScene.ActiveScene.Process();
            }

            for (int i = 0; i < MirAnimatedControl.Animations.Count; i++)
            {
                MirAnimatedControl.Animations[i].UpdateOffSet();
            }

            for (int i = 0; i < MirAnimatedButton.Animations.Count; i++)
            {
                MirAnimatedButton.Animations[i].UpdateOffSet();
            }

            CreateHintLabel();
            CreateDebugLabel();
        }
Пример #2
0
        //Enviroment:更新系统,更新画面,每秒更新一次,同时计算帧数,这个帧数计算很不准吧?通过空闲调用计算
        private static void UpdateEnviroment()
        {
            //更新系统,更新画面,每秒更新一次,同时计算帧数
            if (Time >= _fpsTime)
            {
                _fpsTime = Time + 1000;
                FPS      = _fps;
                _fps     = 0;
                DXManager.Clean(); // Clean once a second.
                //这里加入游戏名称的更新
                if (GameScene.User != null && GameScene.User.Name != null && Program.Form.Text != null && !Program.Form.Text.Contains(GameScene.User.Name))
                {
                    Program.Form.Text = Settings.serverName != null ? Settings.serverName + " -- " + GameScene.User.Name : "夜火传奇";
                }
            }
            else
            {
                _fps++;
            }
            //网络数据处理
            Network.Process();

            //场景处理
            if (MirScene.ActiveScene != null)
            {
                MirScene.ActiveScene.Process();
            }

            //动画要一直更新么
            for (int i = 0; i < MirAnimatedControl.Animations.Count; i++)
            {
                MirAnimatedControl.Animations[i].UpdateOffSet();
            }


            for (int i = 0; i < MirAnimatedButton.Animations.Count; i++)
            {
                MirAnimatedButton.Animations[i].UpdateOffSet();
            }

            //这个是鼠标移动到物体,菜单上显示的提示信息
            CreateHintLabel();
            //FPS等信息输出
            CreateDebugLabel();
        }