Skip to main content

MLCelestialData

info

MLCelestialData inherits from Component

Lua interface for MLCelestialData component. MLCelestialData provides a machine independent UTC time and topocentric position of the sun and moon. If a directional light source is provided, it will rotate it based on the calculated sun position every frame.

Members

Properties

NameDescription
MLCelestialData.LunarAltitudeThe angle of the moon relative to the Earth’s horizon in degrees.
MLCelestialData.LunarAzimuthThe moon’s horizontal angle with respect to north in degrees.
MLCelestialData.LunarIlluminationFractionThe illuminated fraction of the moon’s disk. A value between 0 and 1.
MLCelestialData.LunarPhaseThe current phase of the moon is indicated by a value between 0 and 1. 0 or 1 indicates the new moon, 0.25 indicates the quarter moon, 0.5 half-moon.
MLCelestialData.SunAltitudeThe angle of the sun relative to the Earth's horizon in degrees.
MLCelestialData.SunAzimuthThe sun’s horizontal angle with respect to north. Clockwise positive. For example, sun’s azimuth angle is 90 degrees during full eastern sunrise, until midway.
MLCelestialData.SunMovementEnabledIndicates if the movement of directional light (sun) by the component enabled.

Methods

NameDescription
MLCelestialData.ApplyTimeOffset(offset)Applies a time offset to current time in seconds. You can use this function to change time, speed up or slow down time and solar/lunar calculations. (no relation to system time, frame rate or any other time parameters)
MLCelestialData.EnableSunMovement(enabled)Enables or disables the movement of the directional light (sun) by the component.
MLCelestialData.GetLocalTime()Get current machine independent local time based on specified time zone (in seconds since epoch, similar format as os.time()).
MLCelestialData.GetUTCTime()Current local machine independent UTC time (in seconds since epoch, similar format with os.time).

Inherited Members

Inherited Properties

NameDescription
MLCelestialData.gameObjectThe game object this component is attached to. A component is always attached to a game object.
MLCelestialData.tagThe tag of this game object.
MLCelestialData.transformThe Transform attached to this GameObject.
MLCelestialData.hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
MLCelestialData.nameThe name of the object.

Inherited Methods

NameDescription
MLCelestialData.BroadcastMessage(methodName, parameter=nil)Calls the method named methodName on every Lua Script in this game object or any of its children.
MLCelestialData.CompareTag(tag)Is this game object tagged with tag ?
MLCelestialData.GetAllLuaScripts()Returns an array of all Lua scripts that attached to the game object.
MLCelestialData.GetComponent(type)Returns the component of Type type if the game object has one attached, nil if it doesn't.
MLCelestialData.GetComponentInChildren(t)Returns the component of Type type in the GameObject or any of its children using depth first search.
MLCelestialData.GetComponentInParent(t)Returns the component of Type type in the GameObject or any of its parents.
MLCelestialData.GetComponents(type)Returns all components of Type type in the GameObject.
MLCelestialData.GetComponentsInChildren(t)Returns all components of Type type in the GameObject or any of its children.
MLCelestialData.GetComponentsInParent(t)Returns all components of Type type in the GameObject or any of its parents.
MLCelestialData.SendMessage(methodName, value=nil)Calls the method named methodName on every Lua Script in this game object.
MLCelestialData.SendMessageUpwards(methodName, value=nil)Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour.
MLCelestialData.TryGetComponent(type)Gets the component of the specified type, if it exists.
MLCelestialData.GetInstanceID()Returns the instance id of the object.