コード例 #1
0
    // Loads a new scene
    public void LoadScene(SCENE_POSITION scene)
    {
        _currentScene = scene;
        GameInput.DetachInput();

        // In single mode, the current scene is automatically unloaded when a
        // new one is loaded
        SceneManager.LoadSceneAsync(SCENE_LIST[( int )_currentScene]);

        if (_currentScene != SCENE_POSITION.DUMMY_SCENE)
        {
            Debug.Log("GameSceneSwitcher.LoadScene(): " +
                      SCENE_LIST[( int )_currentScene]);
        }
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        // This script will load everything for the game
        Debug.Log("MainScript.cs");

        // Disable mouse controls
        Cursor.visible   = false;
        Cursor.lockState = CursorLockMode.Locked;

        // Input responder, should be loaded before scene loader
        GameInput.DetachInput();

        // State machine
        RequestStateChange(GameStateLoader.GAME_STATES.MAIN_MENU);
    }