Exemplo n.º 1
0
    public void LoadSceneNewGame()
    {
        var startState = CreateStartState();

        DataManager.instance.CurrentState = startState;
        DataManager.instance.LoadNextScene(SceneFinder.GetSceneFromName(startState.CurrentScene));
    }
Exemplo n.º 2
0
    void OnGUI()
    {
        if (window == null)
        {
            window = GetWindow(typeof(SceneSearchHistory));
        }

        disableHistoryLogging = GUILayout.Toggle(disableHistoryLogging, new GUIContent("Disable History Logging", "If enabled, both the Scene Search and Scene Switcher will stop logging search results."));
        historyCacheSize      = Mathf.Clamp(EditorGUILayout.IntField(new GUIContent("History Cache Size", "Cache Size represents the max number of logged search results, for both Scene Search and Scene Switcher. Between " + MIN_CACHE_SIZE + " and " + MAX_CACHE_SIZE), historyCacheSize), MIN_CACHE_SIZE, MAX_CACHE_SIZE);
        if (GUILayout.Button(new GUIContent("Clear Cache", "Clears the cache for both Scene Search and Scene Switcher.")))
        {
            sceneFinderHistory.Clear();
            sceneFinderHistory = new List <SearchHistory>();
        }

        EditorGUILayout.Space();

        scrollPos = GUILayout.BeginScrollView(scrollPos);
        if (historyForWindow.GetType() == typeof(SceneFinder))
        {
            for (int i = 0; i < sceneFinderHistory.Count; i++)
            {
                GUILayout.Label("\"" + sceneFinderHistory[i].search + "\"", EditorStyles.boldLabel);
                GUILayout.Label("Search Filter: " + sceneFinderHistory[i].searchFilter.ToString());
                GUILayout.Toggle(sceneFinderHistory[i].allScenes, "Search All Scenes");
                GUILayout.Label("Search Results Found: " + sceneFinderHistory[i].resultsFound);

                if (GUILayout.Button("Search Again"))
                {
                    SceneFinder.SearchFromHistory(sceneFinderHistory[i]);
                    window.Close();
                }

                EditorGUILayout.Space();
            }
        }
        else if (historyForWindow.GetType() == typeof(SceneSwitcher))
        {
            for (int i = 0; i < sceneSwitcherHistory.Count; i++)
            {
                GUILayout.Label("\"" + sceneSwitcherHistory[i].search + "\"", EditorStyles.boldLabel);
                GUILayout.Toggle(sceneSwitcherHistory[i].searchByPath, "Search By Path");
                GUILayout.Label("Search Results Found: " + sceneSwitcherHistory[i].resultsFound);

                if (GUILayout.Button("Search Again"))
                {
                    SceneSwitcher.SearchFromHistory(sceneSwitcherHistory[i]);
                    window.Close();
                }

                EditorGUILayout.Space();
            }
        }
        GUILayout.EndScrollView();
    }
Exemplo n.º 3
0
    private void Start()
    {
        // TESTING
        Debug.Log("Starting Battle Scene with test data");
        DataManager.instance.LoadDataFromSlot(1, loadScene: false);
        DataManager.instance.CurrentState.CurrentScene = "Battle_Blue1";
        // TESTING END

        CurrentScene = SceneFinder.GetBattleSceneFromName(DataManager.instance.CurrentState.CurrentScene);
        CurrentScene.SetUpScene();

        Debug.Log("Set up done, starting Turn System");
        ModalBlocker.transform.Find("LoadingOverlay").gameObject.SetActive(false);
        ModalBlocker.SetActive(false);
        TurnSystem.GetComponent <TurnSystem>().StartTurns();
    }
Exemplo n.º 4
0
    void Awake()
    {
        Debug.Log("Loading NarrationSceneController");
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        if (DataManager.instance.CurrentState.CurrentScene == null)
        {
            currentScene = new Narration_Intro();
            DataManager.instance.CurrentState.CurrentScene = currentScene.SceneName;
        }
        else
        {
            currentScene = SceneFinder.GetSceneFromName(DataManager.instance.CurrentState.CurrentScene);
        }
    }
Exemplo n.º 5
0
    public void LoadDataFromSlot(int slotNumber, bool loadScene = true)
    {
        string slotLocation = GetSlotLocation(slotNumber);

        Debug.Log($"Loading data from {slotLocation}");
        if (!File.Exists(slotLocation))
        {
            Debug.Log($"No file found at {slotLocation}");
            return;
        }
        BinaryFormatter bf   = new BinaryFormatter();
        SaveData        data = new SaveData();

        using (FileStream file = File.Open(slotLocation, FileMode.Open))
        {
            data = (SaveData)bf.Deserialize(file);
        }
        CurrentState = data;
        if (loadScene == true)
        {
            LoadNextScene(SceneFinder.GetSceneFromName(data.CurrentScene));
        }
    }
Exemplo n.º 6
0
    private void Awake()
    {
        Debug.Log("Loading TownSceneController");
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        if (DataManager.instance.CurrentState.CurrentScene == null)
        {
            // Testing
            currentScene = new Town_Initial();
        }
        else
        {
            currentScene = (TownSceneBase)SceneFinder.GetSceneFromName(DataManager.instance.CurrentState.CurrentScene);
        }

        IsRunningDialogue = false;
    }
Exemplo n.º 7
0
    public void Awake()
    {
        Debug.Log("Loading DialogueSceneController");
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        if (DataManager.instance.CurrentState.CurrentScene == null)
        {
            //Debug.Log("No scene to play. Returning to Title.");
            //DataManager.instance.LoadNextScene(new TitleScene());
            Debug.Log("Playing test scene");
            _currentScene = SceneFinder.GetSceneFromName("TestScene");
        }
        else
        {
            _currentScene = SceneFinder.GetSceneFromName(DataManager.instance.CurrentState.CurrentScene);
        }
    }