Bläddra i källkod

Fix for updating sections when unbreaking prefab (only temporary has changed)

Josh Engebretson 10 år sedan
förälder
incheckning
38bbbdc760

+ 13 - 0
Script/AtomicEditor/ui/frames/inspector/SelectionInspector.ts

@@ -498,6 +498,19 @@ class SelectionInspector extends ScriptWidget {
 
         if (!ev.removed) {
 
+            for (var i in this.sections) {
+
+                var section = this.sections[i];
+
+                if (section.contains(ev.component)) {
+
+                    // this happens on a prefab break/unbreak
+                    // when only temporary is changing
+                    return;
+
+                }
+            }
+
             editType = this.addSerializable(ev.component);
             editType.addNode(ev.node);
 

+ 6 - 0
Script/AtomicEditor/ui/frames/inspector/SelectionSection.ts

@@ -33,6 +33,12 @@ abstract class SelectionSection extends Atomic.UISection {
 
     }
 
+    contains(serial:Atomic.Serializable):boolean {
+
+        return this.editType.objects.indexOf(serial) == -1;
+
+    }
+
     refresh() {
 
         for (var name in this.attrEdits) {