2
0
ncannasse 7 жил өмнө
parent
commit
3a1ba59ef0

+ 8 - 1
hide/prefab/EditContext.hx

@@ -16,8 +16,15 @@ class EditContext {
 	function get_ide() return hide.Ide.inst;
 	function get_ide() return hide.Ide.inst;
 	public function onChange(p : Prefab, propName : String) {
 	public function onChange(p : Prefab, propName : String) {
 		var ctx = getContext(p);
 		var ctx = getContext(p);
-		if(ctx != null)
+		if(ctx != null) {
 			p.updateInstance(ctx, propName);
 			p.updateInstance(ctx, propName);
+			var parent = p.parent;
+			while( parent != null ) {
+				var pr = parent.getHideProps();
+				if( pr.onChildUpdate != null ) pr.onChildUpdate(p);
+				parent = parent.parent;
+			}
+		}
 
 
 		var refs = rootContext.shared.references.get(p);
 		var refs = rootContext.shared.references.get(p);
 		if(refs != null) {
 		if(refs != null) {

+ 1 - 0
hide/prefab/HideProps.hx

@@ -6,4 +6,5 @@ typedef HideProps = {
 	@:optional var fileSource : Array<String>;
 	@:optional var fileSource : Array<String>;
 	@:optional dynamic function allowChildren( type : String ) : Bool;
 	@:optional dynamic function allowChildren( type : String ) : Bool;
 	@:optional dynamic function allowParent( p : Prefab ) : Bool;
 	@:optional dynamic function allowParent( p : Prefab ) : Bool;
+	@:optional dynamic function onChildUpdate( p : Prefab ) : Void;
 }
 }