浏览代码

added getNamed

ncannasse 7 年之前
父节点
当前提交
a9b8d19e07
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      h3d/impl/TextureCache.hx

+ 7 - 0
h3d/impl/TextureCache.hx

@@ -20,6 +20,13 @@ class TextureCache {
 		return cache[index];
 	}
 
+	public function getNamed( name : String ) {
+		for( i in 0...position )
+			if( cache[i].name == name )
+				return cache[i];
+		return null;
+	}
+
 	public function set( t, index ) {
 		cache[index] = t;
 	}