Commit 60902e7 aaron.winter
committed
1 parent 8b4cd1d commit 60902e7 Copy full SHA for 60902e7
File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ public interface ISpawnable
13
13
void Spawn ( EntityBuilder entityBuilder ) ;
14
14
}
15
15
16
+ public class Marshallable < T > : Reference where T : class
17
+ {
18
+ public T Value ;
19
+ public Marshallable ( T value ) => Value = value ;
20
+ }
21
+
16
22
public static class GodotExtensions
17
23
{
18
24
public static Entity Spawn ( this World world , Node root )
@@ -25,7 +31,8 @@ public static Entity Spawn(this World world, Node root)
25
31
public static void AttachNode ( this World world , Entity entity , Node root )
26
32
{
27
33
world . AddComponent ( entity . Identity , new Root { Node = root } ) ;
28
-
34
+ root . SetMeta ( "Entity" , new Marshallable < Entity > ( entity ) ) ;
35
+
29
36
var nodes = root . GetChildren ( ) . Cast < Node > ( ) . Prepend ( root ) . ToList ( ) ;
30
37
31
38
foreach ( var node in nodes )
You can’t perform that action at this time.
0 commit comments