mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-13 15:04:35 +01:00
34 lines
475 B
C#
34 lines
475 B
C#
using UnityEngine;
|
|
|
|
[ExecuteInEditMode]
|
|
public class CharacterRender : MonoBehaviour
|
|
{
|
|
public Texture[] textures;
|
|
|
|
public float mipMapBias = -1f;
|
|
|
|
private void Start()
|
|
{
|
|
SetMipMapBias(mipMapBias);
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
SetMipMapBias(mipMapBias);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
SetMipMapBias(0f);
|
|
}
|
|
|
|
private void SetMipMapBias(float bias)
|
|
{
|
|
Texture[] array = textures;
|
|
foreach (Texture texture in array)
|
|
{
|
|
texture.mipMapBias = bias;
|
|
}
|
|
}
|
|
}
|