16 lines
378 B
C#
16 lines
378 B
C#
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);
|
|
}
|
|
}
|
|
} |