Definition
double GetPrefabInstanceShininess(string prefabInstanceName)
Description
This function returns the shininess value of prefab instance prefabInstanceName.
Parameter
prefabInstanceName
Specifies the name of the prefab instance. You can also use the name “this” for this parameter. In this case, “this” refers to the prefab instance that this script is attached to.
Return Value
This function returns the shininess of prefab instance. This value is greater than or equal to 0.0.
Example 1
value = 0.0 function Init() value = GetPrefabInstanceShininess("1_VandaEngine17-SamplePack1_wood_pile") message = string.format("\nShininess is : (%.2f)", value) PrintConsole(message) end function Update() end
First we get the shininess of prefab instance “1_VandaEngine17-SamplePack1_wood_pile”. Then we display the result in the console using PrintConsole function.
Example 2
--Name of script is GetPrefabInstanceShininess2.lua value = 0.0 function Init() value = GetPrefabInstanceShininess("this") message = string.format("\nShininess is : (%.2f)", value) PrintConsole(message) end function Update() end
If, in the Prefab Editor, you attach GetPrefabInstanceShininess2.lua script to a Prefab, then “this” parameter in the GetPrefabInstanceShininess function will point to instances of that Prefab in current VScene. For example, if you have an Instance named instance1_a from a Prefab named a to which this script is attached, “this” in GetPrefabInstanceShininess function refers to the name instance1_a.
In this example, we get the shininess of current prefab instance (for example, instance1_a). Then we display the result in the console using PrintConsole function.
GetPrefabInstanceShininess