private OcclusionTextureInfo ExportOcclusionTextureInfo(UnityEngine.Texture texture, UnityEngine.Material material)
        {
            var info = new OcclusionTextureInfo();

            info.Index = ExportTexture(texture);

            if (material.HasProperty("_OcclusionStrength"))
            {
                info.Strength = material.GetFloat("_OcclusionStrength");
            }

            return(info);
        }
Example #2
0
        private Schema.MaterialOcclusionTextureInfo ConvertOcclusionTextureInfo(OcclusionTextureInfo runtimeTextureInfo)
        {
            var textureInfo = CreateInstance <Schema.MaterialOcclusionTextureInfo>();

            textureInfo.Index = ConvertTexture(runtimeTextureInfo.Texture);

            if (runtimeTextureInfo.TexCoord.HasValue)
            {
                textureInfo.TexCoord = runtimeTextureInfo.TexCoord.Value;
            }

            if (runtimeTextureInfo.Strength.HasValue)
            {
                textureInfo.Strength = runtimeTextureInfo.Strength.Value;
            }

            return(textureInfo);
        }