File tree Expand file tree Collapse file tree 4 files changed +24
-13
lines changed Expand file tree Collapse file tree 4 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " com.quabug.entities-bt.codegen" ,
3
3
"description" : " Behavior Tree for Unity Entities - ILCodeGen" ,
4
- "version" : " 1.0.0 " ,
4
+ "version" : " 1.0.1 " ,
5
5
"unity" : " 2020.2" ,
6
6
"displayName" : " EntitiesBT - IL CodeGen" ,
7
- "dependencies" : {
8
- "com.quabug.entities-bt.essential" : " 1.1.0"
9
- },
10
7
"samples" : [
11
8
{
12
9
"displayName" : " [Test] tests" ,
13
10
"description" : " test cases of il codegen" ,
14
11
"path" : " Test~"
15
12
}
16
13
]
17
- }
14
+ }
Original file line number Diff line number Diff line change 4
4
using System . Reflection ;
5
5
using EntitiesBT . Core ;
6
6
using UnityEditor . Callbacks ;
7
+ using UnityEngine ;
7
8
using static EntitiesBT . Core . Utilities ;
8
9
9
10
namespace EntitiesBT . Editor
@@ -16,12 +17,25 @@ public static void OnReload()
16
17
var dictionary = new Dictionary < int , ( Type type , BehaviorNodeAttribute attribute ) > ( 128 ) ;
17
18
foreach ( var type in BEHAVIOR_TREE_ASSEMBLY_TYPES . Value )
18
19
{
20
+ if ( type . IsInterface
21
+ || type . IsAbstract
22
+ || type . IsGenericType
23
+ || ! typeof ( INodeData ) . IsAssignableFrom ( type ) )
24
+ continue ;
25
+
19
26
var attributes = type . GetCustomAttributes ( typeof ( BehaviorNodeAttribute ) ) ;
20
- if ( ! attributes . Any ( ) ) continue ;
21
-
27
+ if ( ! attributes . Any ( ) )
28
+ {
29
+ Debug . LogError ( $ "{ type . FullName } must have a BehaviorNodeAttribute") ;
30
+ continue ;
31
+ }
32
+
22
33
var behaviorNodeAttribute = attributes . First ( ) as BehaviorNodeAttribute ;
23
34
if ( dictionary . TryGetValue ( behaviorNodeAttribute . Id , out var other ) )
24
- throw new Exception ( $ "{ other . type . FullName } has same id { behaviorNodeAttribute . Id } with { type . FullName } ") ;
35
+ {
36
+ Debug . LogError ( $ "{ other . type . FullName } has same id { behaviorNodeAttribute . Id } with { type . FullName } ") ;
37
+ continue ;
38
+ }
25
39
dictionary . Add ( behaviorNodeAttribute . Id , ( type , behaviorNodeAttribute ) ) ;
26
40
}
27
41
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " com.quabug.entities-bt.essential" ,
3
3
"description" : " Behavior Tree for Unity Entities - Essential" ,
4
- "version" : " 1.1.1 " ,
4
+ "version" : " 1.1.2 " ,
5
5
"unity" : " 2020.2" ,
6
6
"displayName" : " EntitiesBT - Essential" ,
7
7
"dependencies" : {
8
8
"com.unity.entities" : " 0.14.0-preview.19" ,
9
- "com.quabug.entities-bt.codegen" : " 1.0.0 "
9
+ "com.quabug.entities-bt.codegen" : " 1.0.1 "
10
10
}
11
- }
11
+ }
Original file line number Diff line number Diff line change 1
- m_EditorVersion: 2020.2.4f1
2
- m_EditorVersionWithRevision: 2020.2.4f1 (becced5a802b )
1
+ m_EditorVersion: 2020.2.6f1
2
+ m_EditorVersionWithRevision: 2020.2.6f1 (8a2143876886 )
You can’t perform that action at this time.
0 commit comments