示例#1
0
        private static Material GetMaterial(int colourId)
        {
            var materialExistence = MaterialUtility.CheckIfMaterialExists(colourId);

            if (materialExistence == MaterialUtility.MaterialExistence.Legacy)
            {
                Debug.LogWarning("Legacy material " + colourId);
            }
            else if (materialExistence == MaterialUtility.MaterialExistence.None)
            {
                Debug.LogError("Missing material " + colourId);
            }

            if (materialExistence != MaterialUtility.MaterialExistence.None)
            {
                return(MaterialUtility.LoadMaterial(colourId, materialExistence == MaterialUtility.MaterialExistence.Legacy));
            }

            return(null);
        }