源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

37 rivejä
1.5 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MipmapsTest : MonoBehaviour
{
public static MeshRenderer mr;
public static Texture2D t1;
// Start is called before the first frame update
void Start()
{
mr = (MeshRenderer)GetComponent(typeof(MeshRenderer));
t1 = mr.material.mainTexture as Texture2D;
//t1.requestedMipmapLevel = 5; //加载第5等级mipmap
//t1.ClearRequestedMipmapLevel();可以清空加载mipmap的等级
}
void OnGUI()
{
GUILayout.Label("<size=40>requestedMipmapLevel " + t1.requestedMipmapLevel + "</size>");
GUILayout.Label("<size=40>当前实际加载的mipmap等级 " + t1.desiredMipmapLevel + "</size>");
GUILayout.Label("<size=40>streamingMipmaps " + t1.streamingMipmaps + "</size>");
GUILayout.Label("<size=40>loadedMipmapLevel" + t1.loadedMipmapLevel + "</size>");
GUILayout.Label("<size=40>loadingMipmapLevel " + t1.loadingMipmapLevel + "</size>");
GUILayout.Label("<size=40>streamingMipmapsPriority " + t1.streamingMipmapsPriority + "</size>");
GUILayout.Label("<size=40>mipMapBias " + t1.mipMapBias + "</size>");
if (GUILayout.Button("<size=40>调整mipmap等级(模糊) +</size>"))
{
t1.mipMapBias += 1f; //更模糊
}
if (GUILayout.Button("<size=40>调整mipmap等级(清楚) -</size>"))
{
t1.mipMapBias -= 1f; //更清楚
}
}
}