mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-13 22:09:53 -05:00
24 lines
480 B
C#
24 lines
480 B
C#
using UnityEngine;
|
|
|
|
namespace VRMShaders
|
|
{
|
|
public static class TextureExtensions
|
|
{
|
|
public static bool HasMipMap(this Texture texture)
|
|
{
|
|
if (texture is Texture2D t2)
|
|
{
|
|
return t2.mipmapCount > 1;
|
|
}
|
|
else if (texture is RenderTexture rt)
|
|
{
|
|
return rt.useMipMap;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|