File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Assets/Editor Toolbox/Editor Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,11 @@ internal static void UpdateDrawers(IToolboxInspectorSettings settings)
261
261
/// </summary>
262
262
internal static bool HasNativeTypeDrawer ( Type type )
263
263
{
264
+ #if UNITY_2023_3_OR_NEWER
265
+ var parameters = new object [ ] { type , null , false } ;
266
+ #else
264
267
var parameters = new object [ ] { type } ;
268
+ #endif
265
269
var result = getDrawerTypeForTypeMethod . Invoke ( null , parameters ) as Type ;
266
270
return result != null && typeof ( PropertyDrawer ) . IsAssignableFrom ( result ) ;
267
271
}
Original file line number Diff line number Diff line change 2
2
using System . Linq ;
3
3
4
4
using UnityEditor ;
5
+ using UnityEditor . Build ;
5
6
6
7
namespace Toolbox . Editor
7
8
{
8
9
public static class ScriptingUtility
9
10
{
10
11
public static List < string > GetDefines ( )
11
12
{
13
+ #if UNITY_2023_1_OR_NEWER
14
+ var target = NamedBuildTarget . FromBuildTargetGroup ( EditorUserBuildSettings . selectedBuildTargetGroup ) ;
15
+ var defines = PlayerSettings . GetScriptingDefineSymbols ( target ) ;
16
+ #else
12
17
var defines = PlayerSettings . GetScriptingDefineSymbolsForGroup ( EditorUserBuildSettings . selectedBuildTargetGroup ) ;
18
+ #endif
13
19
return defines . Split ( ';' ) . ToList ( ) ;
14
20
}
15
21
16
22
public static void SetDefines ( List < string > definesList )
17
23
{
18
24
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
19
29
PlayerSettings . SetScriptingDefineSymbolsForGroup ( EditorUserBuildSettings . selectedBuildTargetGroup , defines ) ;
30
+ #endif
20
31
}
21
32
22
33
public static void AppendDefine ( string define )
You can’t perform that action at this time.
0 commit comments