源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
642 B

  1. /// author:Saber
  2. /// desc:用来对摄像机中的对象进行替换渲染
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using UnityEngine;
  6. [ExecuteInEditMode]
  7. public class ChangeShaderRender : MonoBehaviour
  8. {
  9. private Camera m_camera;
  10. [SerializeField]
  11. public Shader target_shader;
  12. // Start is called before the first frame update
  13. void Start()
  14. {
  15. m_camera = this.gameObject.GetComponent<Camera>();
  16. }
  17. // Update is called once per frame
  18. void LateUpdate()
  19. {
  20. if(target_shader != null){
  21. m_camera.RenderWithShader(target_shader, "RenderType");
  22. }
  23. }
  24. }