示例#1
0
        public override void Dispose()
        {
            GameFramework.UnregisterFromUpdate(this);
            Global.gEnv.pHardwareMouse.RemoveListener(this);

            base.Dispose();
        }
示例#2
0
 /// <summary>
 /// Called by framework. Do not call directly.
 /// </summary>
 public static void Instanciate()
 {
     _instance             = new Screen();
     _instance._lastWidth  = Width;
     _instance._lastHeight = Height;
     GameFramework.RegisterForUpdate(_instance);
 }
示例#3
0
 /// <summary>
 /// Called by framework. Do not call directly.
 /// </summary>
 public static void Destroy()
 {
     if (_instance != null)
     {
         GameFramework.UnregisterFromUpdate(_instance);
         _instance = null;
     }
 }
示例#4
0
 /// <summary>
 /// Called by framework. Do not call directly.
 /// </summary>
 public static void Instantiate()
 {
     _instance = new Mouse();
     Global.gEnv.pHardwareMouse.AddListener(_instance);
     GameFramework.RegisterForUpdate(_instance);
     HitEntityId = 0;
     HitEntityUV = new Vec2();
 }
示例#5
0
 /// <summary>
 /// Called by framework. Do not call directly.
 /// </summary>
 public static void Destroy()
 {
     if (_instance != null)
     {
         GameFramework.UnregisterFromUpdate(_instance);
         Global.gEnv.pHardwareMouse.RemoveListener(_instance);
         _instance.Dispose();
         _instance = null;
     }
 }
示例#6
0
        public Timer(float time, bool looping, Action onTimerExpired = null)
        {
            GameFramework.RegisterForUpdate(this);

            this._timeToLive     = time;
            this._onTimerExpired = onTimerExpired;
            this.Looping         = looping;

            _startTime = Engine.Timer.GetCurrTime();
        }
示例#7
0
 /// <summary>
 /// Called by framework. Do not call directly.
 /// </summary>
 public static void Destroy()
 {
     _updateReceivers.Clear();
     if (_instance != null)
     {
         if (Global.gEnv != null && Env.Game != null && Env.Game.GetIGameFramework() != null)
         {
             Env.Game.GetIGameFramework().UnregisterListener(_instance);
         }
         _instance.Dispose();
         _instance = null;
     }
 }
示例#8
0
        }                                                                               ///< Indicates whether CryEngine is run in Editor mode.

        /// <summary>
        /// Called by framework. Do not call directly.
        /// </summary>
        public static void Initialize()
        {
            if (_isInitialized)
            {
                return;
            }
            _isInitialized = true;

            SystemHandler.Instantiate();
            CryEngine.Input.Instanciate();
            Screen.Instanciate();
            CryEngine.Mouse.Instantiate();
            SceneManager.Instantiate();
            GameFramework.Instantiate();
            LevelSystem.Instantiate();
        }
示例#9
0
        /// <summary>
        /// Called by framework. Do not call directly.
        /// </summary>
        public static void Shutdown()
        {
            if (!_isInitialized)
            {
                return;
            }
            _isInitialized = false;

            //EntityFramework.Destroy ();
            GameFramework.Destroy();
            SceneManager.Destroy();
            LevelSystem.Destroy();
            CryEngine.Mouse.Destroy();
            Screen.Destroy();
            CryEngine.Input.Destroy();
            SystemHandler.Destroy();
        }
示例#10
0
 public DeferredMouseListener(Mouse mouse)
 {
     _mouse = mouse;
     GameFramework.RegisterForUpdate(this);
     Global.gEnv.pHardwareMouse.AddListener(this);
 }
示例#11
0
 /// <summary>
 /// Called by framework. Do not call directly.
 /// </summary>
 public static void Instantiate()
 {
     _instance = new GameFramework();
     Env.Game.GetIGameFramework().RegisterListener(_instance, "MonoGameFramework", EFRAMEWORKLISTENERPRIORITY.FRAMEWORKLISTENERPRIORITY_DEFAULT);
     _instance._monoTargetFps = Env.Console.GetCVar("mono_targetfps");
 }
示例#12
0
 /// <summary>
 /// Called by framework. Do not call directly.
 /// </summary>
 public static void Destroy()
 {
     GameFramework.UnregisterFromUpdate(_instance);
     _scenes.Clear();
     _instance = null;
 }
示例#13
0
 /// <summary>
 /// Called by framework. Do not call directly.
 /// </summary>
 public static void Instantiate()
 {
     _instance = new SceneManager();
     GameFramework.RegisterForUpdate(_instance);
 }
示例#14
0
 public void Destroy()
 {
     GameFramework.UnregisterFromUpdate(this);
     _onTimerExpired = null;
 }
示例#15
0
 void AddListener()
 {
     GameFramework.RegisterForUpdate(this);
     Global.gEnv.pHardwareMouse.AddListener(this);
 }