Exemplo n.º 1
0
        public static MaterialExistence CheckIfMaterialExists(MouldingColour.Id id)
        {
            if (File.Exists(MaterialPathUtility.GetPath(id)))
            {
                return(MaterialExistence.Current);
            }

            if (File.Exists(MaterialPathUtility.GetPath(id, true)))
            {
                return(MaterialExistence.Legacy);
            }
// FIXME Remove when colour palette experiments are over.
#if UNITY_EDITOR
            if (MouldingColour.GetBI())
            {
                if (File.Exists(MaterialPathUtility.GetPath(id, false, true)))
                {
                    return(MaterialExistence.Current);
                }

                if (File.Exists(MaterialPathUtility.GetPath(id, true, true)))
                {
                    return(MaterialExistence.Legacy);
                }
            }
#endif

            return(MaterialExistence.None);
        }
        public static MaterialExistence CheckIfMaterialExists(MouldingColour.Id id)
        {
            if (File.Exists(MaterialPathUtility.GetPath(id)))
            {
                return(MaterialExistence.Current);
            }

            if (File.Exists(MaterialPathUtility.GetPath(id, true)))
            {
                return(MaterialExistence.Legacy);
            }
// FIXME Remove when colour palette experiments are over.
#if UNITY_EDITOR
            var useBI = EditorPrefs.GetBool("com.unity.lego.modelimporter.useBI");
            if (useBI)
            {
                if (File.Exists(MaterialPathUtility.GetPath(id, false, true)))
                {
                    return(MaterialExistence.Current);
                }

                if (File.Exists(MaterialPathUtility.GetPath(id, true, true)))
                {
                    return(MaterialExistence.Legacy);
                }
            }
#endif

            return(MaterialExistence.None);
        }
Exemplo n.º 3
0
        public static Material LoadMaterial(MouldingColour.Id id, bool legacy)
        {
// FIXME Remove when colour palette experiments are over.
#if UNITY_EDITOR
            if (MouldingColour.GetBI())
            {
                var biMaterial = AssetDatabase.LoadAssetAtPath <Material>(MaterialPathUtility.GetPath(id, legacy, true));
                if (biMaterial)
                {
                    return(biMaterial);
                }
            }
#endif

#if UNITY_EDITOR
            return(AssetDatabase.LoadAssetAtPath <Material>(MaterialPathUtility.GetPath(id, legacy)));
#else
            return(null);
#endif
        }
        public static Material LoadMaterial(MouldingColour.Id id, bool legacy)
        {
// FIXME Remove when colour palette experiments are over.
#if UNITY_EDITOR
            var useBI = EditorPrefs.GetBool("com.unity.lego.modelimporter.useBI");
            if (useBI)
            {
                var biMaterial = AssetDatabase.LoadAssetAtPath <Material>(MaterialPathUtility.GetPath(id, legacy, true));
                if (biMaterial)
                {
                    return(biMaterial);
                }
            }
#endif

#if UNITY_EDITOR
            return(AssetDatabase.LoadAssetAtPath <Material>(MaterialPathUtility.GetPath(id, legacy)));
#else
            return(null);
#endif
        }