Class WorldDayNightCycle
MonoBehaviour for managing the day/night cycle in a scene. Handles skybox transitions, object rotations, object activations/deactivations, and material alpha fading based on the current game time of day. Supports ECA triggers for scene-load, day-start, and night-start events.
public class WorldDayNightCycle : MonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourWorldDayNightCycle
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Fields
DayCycleDuration
The duration of the day cycle in seconds.
[Tooltip("The duration of the day cycle in seconds.")]
public int DayCycleDuration
Field Value
DayFadeObjects
These objects slowly fade away during the day and return at night.
[Tooltip("The objects that will fade away during the day.")]
public List<GameObject> DayFadeObjects
Field Value
- List<GameObject>
DayNightCycle
True if the day night cycle should run. False if not.
[Tooltip("Enable/Disable the day night cycle.")]
public bool DayNightCycle
Field Value
DayObjects
These objects are enabled during the day and disabled at night.
[Tooltip("These objects will be enabled during the day.")]
public List<GameObject> DayObjects
Field Value
- List<GameObject>
DaySkyboxMaterial
The skybox material used during the day cycle.
public Material DaySkyboxMaterial
Field Value
- Material
FadeThreshold
Duration in seconds for fading.
[Tooltip("The time in seconds that objects will take to fade in or out.")]
public float FadeThreshold
Field Value
NightCycleDuration
The duration of the night cycle in seconds.
[Tooltip("The duration of the night cycle in seconds.")]
public int NightCycleDuration
Field Value
NightFadeObjects
These objects slowly fade away during the night and return during the day.
[Tooltip("The objects that will fade away at night.")]
public List<GameObject> NightFadeObjects
Field Value
- List<GameObject>
NightObjects
These objects are enabled during the night and disabled during the day.
[Tooltip("These objects will be enabled at night.")]
public List<GameObject> NightObjects
Field Value
- List<GameObject>
NightSkyBoxMaterial
The skybox material used during the night cycle.
public Material NightSkyBoxMaterial
Field Value
- Material
RotateObjects
These objects are constantly rotating based on current time of day.
[Tooltip("Objects that will rotate constantly with the day night cycle.")]
public List<GameObject> RotateObjects
Field Value
- List<GameObject>