quakeball/Assets/Scripts/Util/RenderTextureSetter.cs

19 lines
601 B
C#
Raw Normal View History

2020-08-10 22:50:29 +02:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace NeonTea.Quakeball.Util {
public class RenderTextureSetter : MonoBehaviour {
public RenderTexture RenderTextureToCopy;
public Camera Camera;
public MeshRenderer Renderer;
public int MaterialIndex;
private void Awake() {
RenderTexture RenderTexture = new RenderTexture(RenderTextureToCopy);
Camera.targetTexture = RenderTexture;
Renderer.materials[MaterialIndex].SetTexture("Texture2D_471BDC5", RenderTexture);
}
}
}