| 123456789101112131415161718 |
- using UnityEngine;
- public class TimeChanger : MonoBehaviour
- {
- [SerializeField] Material skybox;
- [SerializeField] float rotationSpeed = 100f;
- private static readonly int Rotation = Shader.PropertyToID("_Rotation");
- private static readonly int Exposure = Shader.PropertyToID("_Exposure");
- public void UpdateSkybox(float normalizedTime)
- {
- skybox.SetFloat(Rotation, normalizedTime * rotationSpeed);
- float exposureValue = Mathf.Lerp(5f, 0.15f, normalizedTime);
- skybox.SetFloat(Exposure, exposureValue);
- }
- }
|