Esempio n. 1
0
        public static Material LoadMat(string matPath, int renderQueue = -1)
        {
            Material material = (Material)Resources.Load("Materials/" + matPath, typeof(Material));

            if (material == null)
            {
                Log.Warning("Could not load material " + matPath, false);
            }
            MatLoader.Request key = new MatLoader.Request
            {
                path        = matPath,
                renderQueue = renderQueue
            };
            Material material2;

            if (!MatLoader.dict.TryGetValue(key, out material2))
            {
                material2 = MaterialAllocator.Create(material);
                if (renderQueue != -1)
                {
                    material2.renderQueue = renderQueue;
                }
                MatLoader.dict.Add(key, material2);
            }
            return(material2);
        }
Esempio n. 2
0
 public bool Equals(MatLoader.Request other)
 {
     return(other.path == this.path && other.renderQueue == this.renderQueue);
 }