源战役客户端
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

36 рядки
700 B

1 місяць тому
  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. }