public static Material MatWithEnding(string dirPath, string ending)
        {
            Material material = (from mat in MaterialLoader.MatsFromTexturesInFolder(dirPath)
                                 where mat.mainTexture.name.ToLower().EndsWith(ending)
                                 select mat).FirstOrDefault();

            if ((UnityEngine.Object)material == (UnityEngine.Object)null)
            {
                Log.Warning("MatWithEnding: Dir " + dirPath + " lacks texture ending in " + ending);
                return(BaseContent.BadMat);
            }
            return(material);
        }
Exemplo n.º 2
0
        public static Material MatWithEnding(string dirPath, string ending)
        {
            Material material = (from mat in MaterialLoader.MatsFromTexturesInFolder(dirPath)
                                 where mat.mainTexture.name.ToLower().EndsWith(ending)
                                 select mat).FirstOrDefault <Material>();
            Material result;

            if (material == null)
            {
                Log.Warning("MatWithEnding: Dir " + dirPath + " lacks texture ending in " + ending, false);
                result = BaseContent.BadMat;
            }
            else
            {
                result = material;
            }
            return(result);
        }