/// <summary> /// Callback sent to all game objects when the player pauses. /// </summary> /// <param name="pauseStatus">The pause state of the application.</param> private void OnApplicationPause(bool pauseStatus) { this.OnPauseEvent?.Invoke(pauseStatus); if (pauseStatus) { // Flush the pending queue on app pause otherwise these events wont reach // the subscribers until after the app has been resumed. MLThreadDispatch.DispatchAll(); } }
/// <summary> /// Calls OnUpdateActions event and dispatches all queued callbacks. /// </summary> protected override void Update() { base.Update(); if (!this.isReady && !(this.isReady = MLDevice.IsReady())) { return; } this.OnUpdateEvent?.Invoke(); MLThreadDispatch.DispatchAll(); }