Example #1
0
    private void Awake()
    {
        if (Instance != null)
        {
            Destroy(gameObject);
            return;
        }

        Instance = this;
        DontDestroyOnLoad(gameObject);

        Environment = gameObject.GetComponentInChildren <Environment>();
        Camera      = player.GetComponent <CameraBehaviour>();
        UI          = gameObject.GetComponentInChildren <UserInterface>();
        PostProcessing.Initialize(GetComponent <Volume>());

        SceneManager.sceneLoaded += OnSceneLoaded;
    }