public void Activate(bool activate, bool force = false) { if((activate && !Activated) || force) { Activated = true; var lightParams = new LightParams(); lightParams.lightStyle = LightStyle; lightParams.origin = Vec3.Zero; lightParams.lightFrustumAngle = 45; lightParams.radius = Radius; lightParams.coronaScale = CoronaScale; lightParams.coronaIntensity = CoronaIntensity; lightParams.coronaDistSizeFactor = CoronaDistSizeFactor; lightParams.coronaDistIntensityFactor = CoronaDistIntensityFactor; lightParams.color = DiffuseColor; lightParams.specularMultiplier = SpecularMultiplier; lightParams.hdrDynamic = HDRDynamic; LoadLight(lightParams, LightSlot); } else { Activated = false; FreeSlot(LightSlot); } }
public override void OnSpawn() { var light = new LightParams { radius = 5, color = Color.Red, hdrDynamic = 2 }; LoadLight(light); LoadObject("objects/effects/particle_effects/bubble/3dbubble.cgf"); ReceiveUpdates = true; }
/// <summary> /// Loads a light source to the specified slot, or to the next available slot. /// </summary> /// <param name="parameters">New params of the light source we wish to load</param> /// <param name="slot">Slot we want to load the light into, if -1 chooses the next available slot.</param> /// <returns>The slot where the light source was loaded, or -1 if loading failed.</returns> public int LoadLight(LightParams parameters, int slot = 1) { return(NativeEntityMethods.LoadLight(this.GetIEntity(), slot, parameters)); }
/// <summary> /// Loads a light source to the specified slot, or to the next available slot. /// </summary> /// <param name="parameters">New params of the light source we wish to load</param> /// <param name="slot">Slot we want to load the light into, if -1 chooses the next available slot.</param> /// <returns>The slot where the light source was loaded, or -1 if loading failed.</returns> public int LoadLight(LightParams parameters, int slot = 1) { return NativeEntityMethods.LoadLight(this.GetIEntity(), slot, parameters); }
public void SwitchToLightObject(ref LightParams lightParams) { NativeEntityMethods.BindAttachmentToLight(Handle, ref lightParams); }