ResumeUpdateEventOfAllPrefabInstances

Definition

ResumeUpdateEventOfAllPrefabInstances([optional] string exception_1, [optional] string exception_2,..., [optional] string exception_n)

Description

This function resumes the script’s Update() event of all prefab instances except the script’s Update() event of prefab instances passed to the function.

Parameters

[optional] string exception_1, [optional] string exception_2,, [optional] string exception_n
Specifies the name of the prefab instances whose script’s Update() event should not be resumed by this function. If no name is passed to the function, Update() events of all prefab instance scripts will be resumed.

Example

function OnTriggerEnter(otherActorName)
    --nil means main character controller
    if otherActorName == nil then
          PauseUpdateEventOfAllPrefabInstances()
    end
end

function OnTriggerStay(otherActorName)

end

function OnTriggerExit(otherActorName)
    --nil means main character controller
    if otherActorName == nil then
          ResumeUpdateEventOfAllPrefabInstances("1_animation_test_boy""1_animation_test_plane")
    end
end
Assume that the above script is attached to a trigger named “trigger1”. Also assume that “1_animation_test_boy” and “1_animation_test_plane” in the example above are the name of prefab instances.
Whenever the main character enters “trigger1”, script’s Update() event of all prefab instances will be paused.
Whenever the main character exits “trigger1”, script’s Update() event of all prefab instances except script’s Update() event of “1_animation_test_boy” and “1_animation_test_plane” prefab instances will be resumed.
adminResumeUpdateEventOfAllPrefabInstances