34 lines
867 B
C#
34 lines
867 B
C#
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace BrewMonster
|
|
{
|
|
public static class ResetStaticUtilityEditor
|
|
{
|
|
[MenuItem("Tools/Reset Static Fields/Run Now", priority = 10)]
|
|
public static void RunNow()
|
|
{
|
|
int count = ResetStaticUtility.ResetAll(logEach: true);
|
|
EditorUtility.DisplayDialog("Reset Static Fields", $"Reset completed.\nFields processed: {count}", "OK");
|
|
}
|
|
|
|
private const string AutoRunPath = "Tools/Reset Static Fields/Auto Reset On Play";
|
|
|
|
[MenuItem(AutoRunPath, priority = 11)]
|
|
public static void ToggleAutoRunOnPlay()
|
|
{
|
|
bool enabled = ResetStaticUtility.GetAutoRunOnPlay();
|
|
ResetStaticUtility.SetAutoRunOnPlay(!enabled);
|
|
}
|
|
|
|
[MenuItem(AutoRunPath, validate = true)]
|
|
public static bool ToggleAutoRunOnPlayValidate()
|
|
{
|
|
Menu.SetChecked(AutoRunPath, ResetStaticUtility.GetAutoRunOnPlay());
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
|