Ejemplo n.º 1
0
        private static void importAssetsForDevice(VROneSDKSupportedDeviceModel supportedDevice)
        {
            foreach (char dimension in new char[] {'X', 'Y'}) {
                foreach (char color in new char[] {'R', 'G', 'B'}) {
                    // load texture
                    var fileName = "LUTs/" + supportedDevice.ToString () + "/" + "LUT_" + dimension + color;
                    Texture2D texture = Resources.Load (fileName) as Texture2D;

                    if (texture != null) {
                        string path = AssetDatabase.GetAssetPath(texture);
                        // apply default texture importer if required
                        TextureImporter importer = (TextureImporter)TextureImporter.GetAtPath(path);
                        if (   importer.textureType != TextureImporterType.Advanced
                            || importer.npotScale != TextureImporterNPOTScale.None
                            || importer.wrapMode != TextureWrapMode.Clamp
                            || importer.mipmapEnabled != false
                            || importer.filterMode != FilterMode.Bilinear
                            || importer.maxTextureSize != 2048
                            || importer.textureFormat != TextureImporterFormat.RGB24) {
                            importer.textureType = TextureImporterType.Advanced;
                            importer.npotScale = TextureImporterNPOTScale.None;
                            importer.wrapMode = TextureWrapMode.Clamp;
                            importer.mipmapEnabled = false;
                            importer.filterMode = FilterMode.Bilinear;
                            importer.maxTextureSize = 2048;
                            importer.textureFormat = TextureImporterFormat.RGB24;
                            AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private static void importAssetsForDevice(VROneSDKSupportedDeviceModel supportedDevice)
        {
            foreach (char dimension in new char[] { 'X', 'Y' })
            {
                foreach (char color in new char[] { 'R', 'G', 'B' })
                {
                    // load texture
                    var       fileName = "LUTs/" + supportedDevice.ToString() + "/" + "LUT_" + dimension + color;
                    Texture2D texture  = Resources.Load(fileName) as Texture2D;

                    if (texture != null)
                    {
                        string path = AssetDatabase.GetAssetPath(texture);
                        // apply default texture importer if required
                        TextureImporter importer = (TextureImporter)TextureImporter.GetAtPath(path);
                        if (importer.textureType != TextureImporterType.Advanced ||
                            importer.npotScale != TextureImporterNPOTScale.None ||
                            importer.wrapMode != TextureWrapMode.Clamp ||
                            importer.mipmapEnabled != false ||
                            importer.filterMode != FilterMode.Bilinear ||
                            importer.maxTextureSize != 2048 ||
                            importer.textureFormat != TextureImporterFormat.RGB24)
                        {
                            importer.textureType    = TextureImporterType.Advanced;
                            importer.npotScale      = TextureImporterNPOTScale.None;
                            importer.wrapMode       = TextureWrapMode.Clamp;
                            importer.mipmapEnabled  = false;
                            importer.filterMode     = FilterMode.Bilinear;
                            importer.maxTextureSize = 2048;
                            importer.textureFormat  = TextureImporterFormat.RGB24;
                            AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate);
                        }
                    }
                }
            }
        }