VirtualFramework/Assets/Scripts/Tools/BackgroundRenderer.cs

16 lines
378 B
C#
Raw Normal View History

2025-03-18 15:22:05 +08:00
using UnityEngine;
[RequireComponent(typeof(Camera))]
public class BackgroundRenderer : MonoBehaviour
{
public Texture2D backgroundTexture;
void OnGUI()
{
if (Event.current.type == EventType.Repaint)
{
Graphics.DrawTexture(new Rect(0, 0, Screen.width, Screen.height),
backgroundTexture);
}
}
}