Scripting Input Types
These are the basic property types usable in scripts with //@input
.
See also: Scripting Overview, Custom Script UI.
Input | Type |
---|---|
//@input SceneObject | SceneObject |
//@input float | Number |
//@input int | Number |
//@input bool | Boolean |
//@input vec2 | vec2 |
//@input vec3 | vec3 |
//@input vec4 | vec4 |
//@input mat2 | mat2 |
//@input mat3 | mat3 |
//@input mat4 | mat4 |
//@input quat | quat |
//@input string | String |
//@input SceneObject[] | SceneObject [] |
//@input float[] | Number[] |
//@input bool[] | Boolean[] |
//@input int[] | Number[] |
//@input vec2[] | vec2 [] |
//@input vec3[] | vec3 [] |
//@input vec4[] | vec4 [] |
//@input mat2[] | mat2 [] |
//@input mat3[] | mat3 [] |
//@input mat4[] | mat4 [] |
//@input string[] | String[] |
//@input Object[] | Object[] |
Examples
In addition, Component types and Asset types can be used.
// Print a string property
//@input string myText
print('here is my string value: ' + script.myText);
// Print a string repeatedly
//@input string myText
//@input int numTimes
for (var i = 0; i < script.numTimes; i++) {
print(script.myText);
}
// Disable an object
//@input SceneObject targetObject
script.targetObject.enabled = false;
// Play a sound
//@input Component.AudioComponent audio
script.audio.play(-1);
Was this page helpful?