|
@@ -143,9 +143,9 @@ class Prefab {
|
|
return p;
|
|
return p;
|
|
}
|
|
}
|
|
|
|
|
|
- public function makeInstanceRec( ctx : Context ) {
|
|
|
|
|
|
+ public function makeInstanceRec( ctx : Context ) : Context {
|
|
if(!enabled)
|
|
if(!enabled)
|
|
- return;
|
|
|
|
|
|
+ return ctx;
|
|
if( ctx == null ) {
|
|
if( ctx == null ) {
|
|
ctx = new Context();
|
|
ctx = new Context();
|
|
ctx.init();
|
|
ctx.init();
|
|
@@ -153,6 +153,7 @@ class Prefab {
|
|
ctx = makeInstance(ctx);
|
|
ctx = makeInstance(ctx);
|
|
for( c in children )
|
|
for( c in children )
|
|
c.makeInstanceRec(ctx);
|
|
c.makeInstanceRec(ctx);
|
|
|
|
+ return ctx;
|
|
}
|
|
}
|
|
|
|
|
|
#if castle
|
|
#if castle
|
|
@@ -232,6 +233,13 @@ class Prefab {
|
|
return arr;
|
|
return arr;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function visitChildren(func: hide.prefab.Prefab->Bool) {
|
|
|
|
+ for(c in children) {
|
|
|
|
+ if(func(c))
|
|
|
|
+ c.visitChildren(func);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public function getParent<T:Prefab>( c : Class<T> ) : Null<T> {
|
|
public function getParent<T:Prefab>( c : Class<T> ) : Null<T> {
|
|
var p = parent;
|
|
var p = parent;
|
|
while(p != null) {
|
|
while(p != null) {
|