File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Assets/Editor Toolbox/Editor/Utilities Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 22using System . Linq ;
33
44using UnityEditor ;
5+ using UnityEditor . Build ;
56
67namespace Toolbox . Editor
78{
89 public static class ScriptingUtility
910 {
1011 public static List < string > GetDefines ( )
1112 {
13+ #if UNITY_2023_1_OR_NEWER
14+ var target = NamedBuildTarget . FromBuildTargetGroup ( EditorUserBuildSettings . selectedBuildTargetGroup ) ;
15+ var defines = PlayerSettings . GetScriptingDefineSymbols ( target ) ;
16+ #else
1217 var defines = PlayerSettings . GetScriptingDefineSymbolsForGroup ( EditorUserBuildSettings . selectedBuildTargetGroup ) ;
18+ #endif
1319 return defines . Split ( ';' ) . ToList ( ) ;
1420 }
1521
1622 public static void SetDefines ( List < string > definesList )
1723 {
1824 var defines = string . Join ( ";" , definesList . ToArray ( ) ) ;
25+ #if UNITY_2023_1_OR_NEWER
26+ var target = NamedBuildTarget . FromBuildTargetGroup ( EditorUserBuildSettings . selectedBuildTargetGroup ) ;
27+ PlayerSettings . SetScriptingDefineSymbols ( target , defines ) ;
28+ #else
1929 PlayerSettings . SetScriptingDefineSymbolsForGroup ( EditorUserBuildSettings . selectedBuildTargetGroup , defines ) ;
30+ #endif
2031 }
2132
2233 public static void AppendDefine ( string define )
You can’t perform that action at this time.
0 commit comments