コード例 #1
0
    public override void Run(List <string> arguments)
    {
        if (arguments.Count == 0)
        {
            EditorManager.ToggleEditorMode();

            if (EditorManager.InEditor)
            {
                Console.Instance.PrintToReportText("Opened editor");
            }
            else
            {
                Console.Instance.PrintToReportText("Closed editor");
            }
            return;
        }

        if (arguments[0] == "open")
        {
            EditorManager.OpenEditor();
            Console.Instance.PrintToReportText("Opened editor");
        }
        else if (arguments[0] == "close")
        {
            EditorManager.CloseEditor();
            Console.Instance.PrintToReportText("Closed editor");
        }
        else
        {
            Console.Instance.PrintToReportText("Possible arguments for the editor command are 'open' and 'close'");
        }
    }
コード例 #2
0
    public static void LoadMazeLevel(MazeLevelData mazeLevelData)
    {
        //If we are in the editor, first close the editor mode before loading a maze through the consule
        if (EditorManager.InEditor)
        {
            EditorManager.CloseEditor();
        }

        if (PersistentGameManager.CurrentSceneType == SceneType.Overworld)
        {
            Logger.Warning("We are currently in the overworld scene. Do not load maze but return.");
            return;
        }

        // Make checks such as if there are starting locations for the players
        MazeLevelGameplayManager.Instance.UnloadLevel();
        MazeLevelGameplayManager.Instance.SetupLevel(mazeLevelData); // sets new Level in MazeLevelManager
    }
コード例 #3
0
    public static void LoadOverworld(OverworldData overworldData)
    {
        //If we are in the editor, first close the editor mode before loading an overworld through the consule
        if (EditorManager.InEditor)
        {
            EditorManager.CloseEditor();
        }

        if (PersistentGameManager.CurrentSceneType == SceneType.Maze)
        {
            Logger.Warning("We are currently in the maze scene. Do not load overworld but return.");
            return;
        }

        // Make checks such as if there are starting locations for the players
        OverworldGameplayManager.Instance.UnloadOverworld();
        OverworldGameplayManager.Instance.SetupOverworld(overworldData); // sets new Overworld in OverworldManager
    }