public override void Initialize() { LightId = LightEngine.CreateDirectionalLight(Direction, Color.R / 255f, this.Color.G / 255f, this.Color.B / 255f); LightEngine.SetLightProperties(LightId, true, false, false); // Register object in Lua. ScriptManager.SetGlobal(Name, this); }
private void Awake() { if (Instance != null) { throw new System.Exception(); } Instance = this; }
void Awake() { if (instance != null) { return; } instance = this; InitGame(); StartLevel(); }
public override void Dispose() { LightEngine.DeleteLight(LightId); }
public void SetColor(float r, float g, float b) { LightEngine.SetLightColor(LightId, r / 255f, g / 255f, b / 255f); }
public void SetDirection(float x, float y, float z) { LightEngine.SetLightDirection(LightId, x, y, z); }
public void Disable() { LightEngine.EnableLight(LightId, false); }
public void Enable() { LightEngine.EnableLight(LightId, true); }
public void SetPosition(float x, float y, float z) { Position = new TV_3DVECTOR(x, y, z); LightEngine.SetLightPosition(LightId, x, y, z); }
public void SetRadius(float radius) { LightEngine.SetLightRange(LightId, radius); }
void Start() { LightEngine.Register(this); }
private void OnDestroy() { LightEngine.Unregister(this); }