PauseUpdateEventOfLight

Definition

PauseUpdateEventOfLight(string lightName)

Description

This function pauses the script’s Update() event of light lightName.

Parameters

lightName
Specifies the name of the light. You can also use the name “this” for this parameter. In this case, “this” refers to the light name that this script is attached to.

Example 1

function OnTriggerEnter(otherActorName)
    --nil means main character controller
    if otherActorName == nil then
          PauseUpdateEventOfLight("light1")
    end
end

function OnTriggerStay(otherActorName)

end

function OnTriggerExit(otherActorName)

end
Assume that the above script is attached to a trigger named trigger1. Whenever the main character enters “trigger1”, script’s Update() event of light “light1” will be paused.

Example 2

--Name of script is PauseUpdateEventOfLight2.lua

function Init()
    PauseUpdateEventOfLight("this")
end

function Update()

end
Assume that the above script named PauseUpdateEventOfLight2.lua is attached to a light object named “light1”. In this case, string “this”  in the PauseUpdateEventOfLight function will be equal to “light1”. In our example, the function PauseUpdateEventOfLight pauses the script’s Update() event of current light, which is “light1”.
adminPauseUpdateEventOfLight