public void TakeScreenshot() { string path = ""; #if UNITY_EDITOR path = Application.dataPath; #else path = Application.persistentDataPath; #endif string screenShotPath = path + "/" + ScreenshotName; if (File.Exists(screenShotPath)) { Debug.Log("old screenshot deetcted ==> deleting..."); File.Delete(screenShotPath); } #if UNITY_EDITOR AssetDatabase.Refresh(); #endif self.StartCoroutine(self.getScreenshot()); }
public void TakeScreenshot() { self.StartCoroutine(self.getScreenshot()); }