private Material GetMaterial(int id)
        {
            var useBI = EditorPrefs.GetBool("com.unity.lego.modelimporter.useBI");
            var path  = MaterialPathUtility.GetPath((MouldingColour.Id)id, false, useBI);

            if (File.Exists(path))
            {
                return(AssetDatabase.LoadAssetAtPath <Material>(path));
            }
            else
            {
                path = MaterialPathUtility.GetPath((MouldingColour.Id)id, true, useBI);
                return(AssetDatabase.LoadAssetAtPath <Material>(path));
            }
        }
Exemple #2
0
        private Material GetMaterial(int id)
        {
            // FIXME Remove when colour palette experiments are over.
            var useBI = MouldingColour.GetBI();
            var path  = MaterialPathUtility.GetPath((MouldingColour.Id)id, false, useBI);

            if (File.Exists(path))
            {
                return(AssetDatabase.LoadAssetAtPath <Material>(path));
            }
            else
            {
                path = MaterialPathUtility.GetPath((MouldingColour.Id)id, true, useBI);
                return(AssetDatabase.LoadAssetAtPath <Material>(path));
            }
        }