Beispiel #1
0
    public void Awake()
    {
     #if !UNITY_EDITOR
        Destroy(gameObject);
        return;
     #endif

        /// singleton ///
        if (Instance != null && Instance != this)
        {
            DestroyImmediate(gameObject);
            return;
        }
        Instance = this;
        DontDestroyOnLoad(gameObject);
        localDir = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);
        #if UNITY_EDITOR
        localDir = Application.dataPath;
        #endif
        basepath = System.IO.Path.Combine(localDir, screenshotDirectory);
        if (!System.IO.Directory.Exists(basepath))
        {
            System.IO.Directory.CreateDirectory(basepath);
        }
    }
    public void Awake() {
     #if !UNITY_EDITOR
     Destroy(gameObject);
     return;
     #endif
     
        /// singleton ///
        if (Instance != null && Instance != this) {
            DestroyImmediate(gameObject);
            return;
        }
        Instance = this;
		DontDestroyOnLoad(gameObject);
        localDir = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData);
        #if UNITY_EDITOR
        localDir = Application.dataPath;
        #endif
        basepath = System.IO.Path.Combine(localDir, screenshotDirectory);
        if (!System.IO.Directory.Exists(basepath)) {
            System.IO.Directory.CreateDirectory(basepath);
        }
    }