コード例 #1
0
ファイル: MaterialUtility.cs プロジェクト: b0101520154/legoAI
        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);
        }
コード例 #2
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
            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);
        }
コード例 #3
0
ファイル: MaterialUtility.cs プロジェクト: b0101520154/legoAI
        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
        }
コード例 #4
0
        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
        }