Example #1
0
    /// <summary>
    /// Ends the game, and returns to the title screen
    /// </summary>
    public static void EndGame()
    {
        Events.OnGameEnd.Invoke();

        //Creates a new game state instance with the same settings
        GameSettings settings = Settings;

        _this.RemoveComponent <GameState>();
        _this.AddComponent <GameState>();

        _this._settings = settings;

        UnityEngine.SceneManagement.SceneManager.LoadScene(1);
    }
Example #2
0
 public static void AddDebugLayer(this GameState state, float defaultLineWidth, Renderer.ViewportPolicy viewportPolicy, SpriteFont font)
 {
     state.AddComponent(new DebugLayer(defaultLineWidth, viewportPolicy, font));
 }