public static void Import(string path, out Texture2D spotlightCookie, out Cubemap pointLightCookie, int resolution = 128, bool enhancedImport = false, bool applyVignette = true) { spotlightCookie = null; pointLightCookie = null; if (!RuntimeIESImporter.IsFileValid(path)) { return; } GameObject obj; IESConverter iesConverter; RuntimeIESImporter.GetIESConverterAndCubeSphere(enhancedImport, resolution, out obj, out iesConverter); RuntimeIESImporter.ImportIES(path, iesConverter, true, applyVignette, out spotlightCookie, out pointLightCookie); UnityEngine.Object.Destroy(obj); }
public static Cubemap ImportPointLightCookie(string path, int resolution = 128, bool enhancedImport = false) { if (!RuntimeIESImporter.IsFileValid(path)) { return(null); } GameObject obj; IESConverter iesConverter; RuntimeIESImporter.GetIESConverterAndCubeSphere(enhancedImport, resolution, out obj, out iesConverter); Texture2D texture2D; Cubemap result; RuntimeIESImporter.ImportIES(path, iesConverter, false, false, out texture2D, out result); UnityEngine.Object.Destroy(obj); return(result); }
public static Texture2D ImportSpotlightCookie(string path, int resolution = 128, bool enhancedImport = false, bool applyVignette = true) { if (!RuntimeIESImporter.IsFileValid(path)) { return(null); } GameObject obj; IESConverter iesConverter; RuntimeIESImporter.GetIESConverterAndCubeSphere(enhancedImport, resolution, out obj, out iesConverter); Texture2D result; Cubemap cubemap; RuntimeIESImporter.ImportIES(path, iesConverter, true, applyVignette, out result, out cubemap); UnityEngine.Object.Destroy(obj); return(result); }