GetPrefabInstanceScriptIntVariable

Definition

int GetPrefabInstanceScriptIntVariable(string PrefabInstanceName, string variable)

Description

This function gets the value of the Integer variable defined in the script attached to the PrefabInstanceName prefab instance.

Parameters

PrefabInstanceName
Specifies the name of the prefab instance.

variable
Specifies the name of the Integer variable defined in the script attached to the PrefabInstanceName prefab instance.

Return Value

Returns the value of the Integer variable defined in the script attached to the PrefabInstanceName prefab instance.

Example

--script name is GetPrefabInstanceScriptIntVariable.lua attached a to game object such as water

return_value = 0

function Init()
    return_value = GetPrefabInstanceScriptIntVariable("1_VandaEngine17-SamplePack1_birdcage""a")
end

function Update()

end
Assuming that the variable “a” is defined with the value in the script attached to the prefab instance “1_VandaEngine17-SamplePack1_birdcage”GetPrefabInstanceScriptIntVariable function returns the value 1.
adminGetPrefabInstanceScriptIntVariable