Skip to content

Instantly share code, notes, and snippets.

@p-chin
Last active January 3, 2016 00:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p-chin/8384799 to your computer and use it in GitHub Desktop.
Save p-chin/8384799 to your computer and use it in GitHub Desktop.
プロジェクトで良く切り替えるScriptDefineSymbolのグループをEditorToolからサクっと切り替えられると便利
using UnityEditor;
public static class DefineSymbolSwitcher
{
private static BuildTargetGroup CurrentPlatform = EditorUserBuildSettings.selectedBuildTargetGroup;
private static void Log() {
UnityEngine.Debug.Log(string.Format("done! Platform: {0}, DefineSymbol: {1}",
CurrentPlatform, PlayerSettings.GetScriptingDefineSymbolsForGroup(CurrentPlatform)));
}
#region DEBUG
[MenuItem("MyProject/SwitchDefineSymbol/CurrentPlatform/DEBUG;")]
public static void Debug()
{
PlayerSettings.SetScriptingDefineSymbolsForGroup(CurrentPlatform, string.Format("{0};",
"DEBUG"));
Log();
}
[MenuItem("MyProject/SwitchDefineSymbol/CurrentPlatform/DEBUG;AB;")]
public static void DebugAB()
{
PlayerSettings.SetScriptingDefineSymbolsForGroup(CurrentPlatform, string.Format("{0};{1};",
"DEBUG", "AB"));
Log();
}
#endregion
}
@p-chin
Copy link
Author

p-chin commented Jan 12, 2014

indent崩れてるの渋い

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment