Ver código fonte

[spline] Fix loading calling updateInstance multiple times

Clément Espeute 11 meses atrás
pai
commit
0b7bb4df0a
1 arquivos alterados com 13 adições e 0 exclusões
  1. 13 0
      hrt/prefab/l3d/Spline.hx

+ 13 - 0
hrt/prefab/l3d/Spline.hx

@@ -151,6 +151,11 @@ class SplinePoint extends Object3D {
 
 
 	#if editor
 	#if editor
 
 
+	override function editorRemoveInstanceObjects() : Void {
+		shared.editor.queueRebuild(spline);
+		super.editorRemoveInstanceObjects();
+	}
+
 	public function computeName() {
 	public function computeName() {
 		if( local3d == null ) return;
 		if( local3d == null ) return;
 		var index = spline.points.indexOf(this);
 		var index = spline.points.indexOf(this);
@@ -327,12 +332,20 @@ class Spline extends Object3D {
 
 
 		#if editor
 		#if editor
 		lineGraphics = null;
 		lineGraphics = null;
+		loading = true;
 		#end
 		#end
+	}
 
 
+	override function postMakeInstance() : Void {
+		loading = false;
 		updateInstance();
 		updateInstance();
 	}
 	}
 
 
 	override function updateInstance(?propName : String ) {
 	override function updateInstance(?propName : String ) {
+		#if editor
+		if (loading)
+			return;
+		#end
 		super.updateInstance(propName);
 		super.updateInstance(propName);
 		#if editor
 		#if editor
 		if( editor != null )
 		if( editor != null )