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

            base.Dispose();
        }
Exemple #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);
 }
Exemple #3
0
 /// <summary>
 /// Called by framework. Do not call directly.
 /// </summary>
 public static void Destroy()
 {
     if (_instance != null)
     {
         GameFramework.UnregisterFromUpdate(_instance);
         _instance = null;
     }
 }
Exemple #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();
 }
Exemple #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;
     }
 }
Exemple #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();
        }
Exemple #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;
     }
 }
Exemple #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();
        }
Exemple #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();
        }
Exemple #10
0
 public DeferredMouseListener(Mouse mouse)
 {
     _mouse = mouse;
     GameFramework.RegisterForUpdate(this);
     Global.gEnv.pHardwareMouse.AddListener(this);
 }
Exemple #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");
 }
Exemple #12
0
 /// <summary>
 /// Called by framework. Do not call directly.
 /// </summary>
 public static void Destroy()
 {
     GameFramework.UnregisterFromUpdate(_instance);
     _scenes.Clear();
     _instance = null;
 }
Exemple #13
0
 /// <summary>
 /// Called by framework. Do not call directly.
 /// </summary>
 public static void Instantiate()
 {
     _instance = new SceneManager();
     GameFramework.RegisterForUpdate(_instance);
 }
Exemple #14
0
 public void Destroy()
 {
     GameFramework.UnregisterFromUpdate(this);
     _onTimerExpired = null;
 }
Exemple #15
0
 void AddListener()
 {
     GameFramework.RegisterForUpdate(this);
     Global.gEnv.pHardwareMouse.AddListener(this);
 }