OSDN Git Service

add name property to Material
authorkobayasi <kobayasi@pscnet.co.jp>
Sat, 6 Jul 2013 06:09:05 +0000 (15:09 +0900)
committerkobayasi <kobayasi@pscnet.co.jp>
Sat, 6 Jul 2013 06:09:05 +0000 (15:09 +0900)
engine/src/core/com/jme3/material/Material.java

index 1a65c5d..1fda709 100644 (file)
@@ -104,6 +104,7 @@ public class Material implements Asset, Cloneable, Savable, Comparable<Material>
         additiveLight.setDepthWrite(false);
     }
     private AssetKey key;
+    private String name;
     private MaterialDef def;
     private ListMap<String, MatParam> paramValues = new ListMap<String, MatParam>();
     private Technique technique;
@@ -153,6 +154,23 @@ public class Material implements Asset, Cloneable, Savable, Comparable<Material>
         return key != null ? key.getName() : null;
     }
 
+    /**
+     * @return the name of the material (not the same as the asset name), the returned value can be null
+     */
+    public String getName() {
+        return name;
+    }
+    
+    /**
+     * This method sets the name of the material.
+     * The name is not the same as the asset name.
+     * It can be null and there is no guarantee of its uniqness.
+     * @param name the name of the material
+     */
+    public void setName(String name) {
+        this.name = name;
+    }
+
     public void setKey(AssetKey key) {
         this.key = key;
     }