Last active
January 3, 2016 00:49
-
-
Save p-chin/8384799 to your computer and use it in GitHub Desktop.
プロジェクトで良く切り替えるScriptDefineSymbolのグループをEditorToolからサクっと切り替えられると便利
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
indent崩れてるの渋い