Skip to content

Instantly share code, notes, and snippets.

@danieldownes
Last active March 5, 2023 06:04
Show Gist options
  • Save danieldownes/20d599f5a6a3f917b62164145edf775e to your computer and use it in GitHub Desktop.
Save danieldownes/20d599f5a6a3f917b62164145edf775e to your computer and use it in GitHub Desktop.
Unity Tools Menu - Clear PlayPrefs and Screenshot
using System;
using UnityEngine;
using UnityEditor;
public class ToolsMenu
{
[MenuItem("Tools/Clear PlayerPrefs")]
private static void ClearPlayerPrefs()
{
PlayerPrefs.DeleteAll();
}
[MenuItem("Tools/Take Screenshot")]
private static void CaptureScreenshot()
{
ScreenCapture.CaptureScreenshot("Screenshot_"
+ DateTime.Now.ToString("yy-MM-dd_H-mm-ssf") + ".png");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment