源战役客户端
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.

36 lines
700 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. [ExecuteInEditMode]
  5. public class CustomFog : MonoBehaviour
  6. {
  7. public float FogHeightStart = 0;
  8. public float FogHeightEnd = 30;
  9. public Color FogColor = Color.white;
  10. void Awake()
  11. {
  12. UpdateFog();
  13. }
  14. void Start()
  15. {
  16. }
  17. // Update is called once per frame
  18. void Update()
  19. {
  20. }
  21. void UpdateFog()
  22. {
  23. if (FogHeightStart > (FogHeightEnd - 1))
  24. FogHeightStart = FogHeightEnd - 1;
  25. Shader.SetGlobalFloat("_GlobalFogHeightStart", FogHeightStart);
  26. Shader.SetGlobalFloat("_GlobalFogHeightEnd", FogHeightEnd);
  27. }
  28. }