RenderTexSaveInObject.cs 401 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using UnityEngine;
  3. public class RenderTexSaveInObject : MonoBehaviour
  4. {
  5. private void Start()
  6. {
  7. }
  8. private void Update()
  9. {
  10. if (Input.GetKeyDown(KeyCode.T))
  11. {
  12. this.m_bKeyPress = true;
  13. }
  14. }
  15. public void OnPreRender()
  16. {
  17. }
  18. private void SaveRt()
  19. {
  20. UTY.SaveImage(base.GetComponent<Camera>().targetTexture, null, TextureFormat.ARGB32);
  21. }
  22. private bool m_bKeyPress;
  23. }