Browse Source

Fix issue with sub mesh inspector material fields

Josh Engebretson 10 years ago
parent
commit
d569fbe2be
1 changed files with 5 additions and 8 deletions
  1. 5 8
      Script/AtomicEditor/ui/frames/inspector/ComponentAttributeUI.ts

+ 5 - 8
Script/AtomicEditor/ui/frames/inspector/ComponentAttributeUI.ts

@@ -319,20 +319,17 @@ class SubmeshAttributeEdit extends AttributeInfoEdit {
                     var text = "";
 
                     if (resource) {
-                        if (resource instanceof Atomic.Animation) {
 
-                            text = (<Atomic.Animation>resource).animationName;
+                        if (resource instanceof Atomic.Material) {
 
-                        } else {
+                            text = (<Atomic.Material>resource).name;
 
-                            text = resource.name;
-                            var asset = ToolCore.assetDatabase.getAssetByCachePath(resource.name);
-                            if (asset)
-                                text = asset.name;
+                        } else {
+                            text = "???";
                         }
                     }
-                    var pathinfo = Atomic.splitPath(text);
 
+                    var pathinfo = Atomic.splitPath(text);
                     matEdit.editField.text = pathinfo.fileName;
                 }