CustomMe.cs 944 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class CustomMe : SCRtcMe
  6. {
  7. public GameObject myQuad;
  8. public override void setMyCamera(RenderTexture myRenderTexture)
  9. {
  10. base.setMyCamera(myRenderTexture);
  11. RawImage ri = myQuad.GetComponent<RawImage>();
  12. if (ri != null)
  13. {
  14. ri.material = (Material)Resources.Load("renderMat");
  15. }
  16. else
  17. {
  18. myQuad.GetComponent<MeshRenderer>().material = (Material)Resources.Load("renderMat");
  19. }
  20. if (ri != null)
  21. {
  22. ri.texture = myRenderTexture;
  23. }
  24. else
  25. {
  26. myQuad.GetComponent<MeshRenderer>().material.mainTexture = myRenderTexture;
  27. }
  28. }
  29. public void init()
  30. {
  31. // this.Quad.GetComponent<MeshRenderer>().material.mainTexture = SCRtcFactory.Instance.mSCRtcMe.tex;
  32. }
  33. }