コード例 #1
0
ファイル: GLTFTexture.cs プロジェクト: BrandXR/GLTFUtility
 /// <summary> Create or return cached texture </summary>
 public IEnumerator GetTextureCached(bool linear, Action <Texture2D, GLTFImage.TextureOrientation> onFinish, Action <float> onProgress = null)
 {
     if (cache == null)
     {
         yield return(StaticCoroutine.Start(image.CreateTextureAsync(linear, (x, y) => { cache = x; orientation = y; }, image.mimeType, onProgress)));
     }
     onFinish(cache, orientation);
 }
コード例 #2
0
 /// <summary> Create or return cached texture </summary>
 public IEnumerator GetTextureCached(bool linear, Action <Texture2D> onFinish, Action <float> onProgress = null)
 {
     if (cache == null)
     {
         IEnumerator en = image.CreateTextureAsync(linear, x => cache = x, onProgress);
         while (en.MoveNext())
         {
             yield return(null);
         }
         ;
     }
     onFinish(cache);
 }