UnityEditor.TextureUtil.GetLinearSampled C# (CSharp) Méthode

GetLinearSampled() private méthode

private GetLinearSampled ( Texture t ) : bool
t UnityEngine.Texture
Résultat bool
        public static extern bool GetLinearSampled(Texture t);
        [MethodImpl(MethodImplOptions.InternalCall)]

Usage Example

 public static UnityEngine.Texture2D CreateTemporaryDuplicate(UnityEngine.Texture2D original, int width, int height)
 {
     UnityEngine.Texture2D result;
     if (!ShaderUtil.hardwareSupportsRectRenderTexture || !original)
     {
         result = null;
     }
     else
     {
         RenderTexture active          = RenderTexture.active;
         Rect          rawViewportRect = ShaderUtil.rawViewportRect;
         bool          flag            = !TextureUtil.GetLinearSampled(original);
         RenderTexture temporary       = RenderTexture.GetTemporary(width, height, 0, RenderTextureFormat.Default, (!flag) ? RenderTextureReadWrite.Linear : RenderTextureReadWrite.sRGB);
         GL.sRGBWrite = (flag && QualitySettings.activeColorSpace == ColorSpace.Linear);
         Graphics.Blit(original, temporary);
         GL.sRGBWrite         = false;
         RenderTexture.active = temporary;
         bool flag2 = width >= SystemInfo.maxTextureSize || height >= SystemInfo.maxTextureSize;
         UnityEngine.Texture2D texture2D = new UnityEngine.Texture2D(width, height, TextureFormat.RGBA32, original.mipmapCount > 1 || flag2);
         texture2D.ReadPixels(new Rect(0f, 0f, (float)width, (float)height), 0, 0);
         texture2D.Apply();
         RenderTexture.ReleaseTemporary(temporary);
         EditorGUIUtility.SetRenderTextureNoViewport(active);
         ShaderUtil.rawViewportRect    = rawViewportRect;
         texture2D.alphaIsTransparency = original.alphaIsTransparency;
         result = texture2D;
     }
     return(result);
 }
All Usage Examples Of UnityEditor.TextureUtil::GetLinearSampled