Item class
On Vket Cloud, each non-Player objects on the world are defined as Items.
For example, objects defined as items are HEOField, HEOObject, HEOPlane, HEOActivity, and other objects.
The Item class is for handling such Items, and "Nodes" which are child objects of HEOField on HeliScript.
An Item class object is obtainable by specifying the item name with hsItemGet() or running hsItemGetSelf().
Item class has various methods to operate the obtained Item object.
How to get Item class object from component
The Item class object held by the component is obtainable by making the following call from the method in the component.
Item myItem = hsItemGet("Item name");
Calling hsItemGetSelf() will obtain the Item instance of the script's current component.
Item myitem = hsItemGetSelf();
Item utility functions
hsItemGet
Item hsItemGet(string itemName)
Global function. Obtains the Item located under HEOField and returns it as an Item instance.
hsItemGetSelf
Item hsItemGetSelf()
Global function. Gets the Item object of where this component itself is attached, by calling this function in the component's constructor, or methods such as Update, OnClickNode, etc.
Methods
Equals
public bool Equals(Item obj)
Judges whether this class is identical to the argument obj.
When obtaining Item objects using hsItemGet(), etc., a different instance may be obtained despite being the same Item. For checking identity, use Equals() instead of "===" operator.
Available object types for this method
GetName
public string GetName()
Get the name of the Item.
Available object types for this method
SetPos
public void SetPos(Vector3 pos)
Move Item to the designated position.
Available object types for this method
GetPos
public Vector3 GetPos()
Get the local position of Item.
Available object types for this method
GetWorldPos
public Vector3 GetWorldPos()
Get the world position of Item.
SetQuaternion
public bool SetQuaternion(Quaternion Rotate)
Set the quaternion rotation of Item.
Available object types for this method
GetQuaternion
public Quaternion GetQuaternion()
Get the local rotation of Item by quaternion.
Available object types for this method
GetWorldQuaternion
public Quaternion GetWorldQuaternion()
Get the world rotation of Item by quaternion.
GetWorldRotate
public Vector3 GetWorldRotate()
Get the world rotation of Item by Vector3.
GetScale
public Vector3 GetScale()
Get the scale of Item by Vector3.
Available object types for this method
SetScale
public void SetScale(Vector3 Scale)
Set the scale of Item by Vector3.
Available object types for this method
MovePos
public void MovePos(Vector3 pos, float time, bool CollisionDetection = false)
Moves the Item over [time] seconds to the coordinates specified by pos.
If CollisionDetection is set to true, collision detection will be enabled as like the player avatar.
Available object types for this method
IsMoving
public bool IsMoving()
Returns true if the Item is moving.
Available object types for this method
Play
public bool Play()
Start playing a sound or particle. Returns true if the playback process has started successfully. Returns false on failure.
Available object types for this method
Stop
public void Stop()
Stop the sound or particle that is playing.
Available object types for this method
IsPlay
public bool IsPlay()
Returns true if the sound or particle is playing.
Available object types for this method
Different return values for IsPlay
- HEOAudio: Returns true if the designated audio clip is playing
- HEOObject: Returns true if designated hem in Motion list is playing, when object mode is Motion
- HEOParticle: Returns true if designated .hep particle is playing
SetShow
public void SetShow(bool flag)
Display Item with true. Hide the Item with false.
Available object types for this method
IsShow
public bool IsShow()
Returns true if the Item is visible, false otherwise.
Available object types for this method
ChangeMotion
public bool ChangeMotion(string MotionName)
Change the motion according to the designated MotionName.
Available object types for this method
Load
public bool Load()
Start loading the Item. Returns false if the loading process fails to start.
Available object types for this method
Unload
public bool Unload()
Unload the Item. Returns false if the unloading process fails.
Available object types for this method
IsLoading
public bool IsLoading()
Returns true if the Item is loading, false otherwise.
Available object types for this method
IsLoaded
public bool IsLoaded()
Returns true if the Item has finished loading, false otherwise.
Available object types for this method
GetNodeIndexByName
public int GetNodeIndexByName(string nodeName)
Finds a node by name and returns an index identifying that node.
GetNodeNameByIndex
public string GetNodeNameByIndex(int nodeIndex)
Given a node by index, return the name of that node.
GetNodePosByIndex
public Vector3 GetNodePosByIndex(int nodeIndex)
Specify a node by index and return the coordinates of that node.
Available object types for this method
SetShowNode
public bool SetShowNode(string nodeName, bool flag)
Specify a node by name, show it if flag is true and hide it if flag is false.
IsShowNode
public bool IsShowNode(string nodeName)
Specify a node by name, returns true if the node is visible and false if it is hidden.
SetRotateNode
public bool SetRotateNode(string nodeName, Vector3 rotate)
Specify a node by name and rotate that node.
Available object types for this method
SetEnableCollider
public bool SetEnableCollider(string nodeName, bool flag)
Specify a collider by name, true to enable it, false to disable it.
Available object types for this method
IsEnableCollider
public bool IsEnableCollider(string nodeName)
Specify a collider by name, returns true if the collider is enabled, false otherwise.
Available object types for this method
SetClickableNode
public bool SetClickableNode(string nodeName, bool flag)
Specify a clickable node by name, enable clicks if flag is set to true and disable clicks if flag is set to false.
Available object types for this method
IsClickableNode
public bool IsClickableNode(string nodeName)
Specify a node by name and returns true if the node is clickable, false otherwise.
Available object types for this method
SetUVOffset
public bool SetUVOffset(string materialName, float u, float v)
Specify a material by name and change the uv offset of that material starting from the top-left origin. Returns false if the change fails.
Origin coordinate of UV
While Unity considers the bottom-left coordinate of the UV as the origin, note that HeliScript considers the top-left as the origin.
PlayVideo
public void PlayVideo(string materialName, string url, bool loop)
Specifies the material to play and starts playing the video. Loop playback is performed if loop is set to true.
StopVideo
public void StopVideo()
Stop the video that is playing.
IsPlayVideo
public bool IsPlayVideo()
Returns true if a video is playing.
ClearTextPlane
public void ClearTextPlane()
Delete the text.
Available object types for this method
WriteTextPlane
public void WriteTextPlane(string text)
Set the text.
Available object types for this method
SetCamera
public bool SetCamera()
Set the camera type Item as a camera. Refer to HEOCamera for usage.
Available object types for this method
ResetCamera
public void ResetCamera()
Detach camera set by SetCamera. Refer to HEOCamera for usage.
Available object types for this method
ReplaceItem
public bool ReplaceItem(string URL)
Replace the Item by the designated model data.
Available object types for this method
ReplaceTexture
public bool ReplaceTexture(string MaterialName, string URL)
Replace the texture attached to the MaterialName's material by the designated URL content.
Available object types for this method
SetPhysicsEnable
public bool SetPhysicsEnable(string NodeName, bool Flag)
Enable physics for Node designated by NodeName if Flag is true, disable if Flag is false.
Available object types for this method
IsPhysicsFixed
public bool IsPhysicsFixed(string NodeName)
When physics is enabled, returns true if this Item is fixed.
Available object types for this method
GetPhysicsIDByNodeName
public int GetPhysicsIDByNodeName(string NodeName)
Get the PhysicsId for the designated Node.
When physics is enabled, returns true if this Item is fixed.
Available object types for this method
SetProperty
public bool SetProperty(string Key, string Value)
Set property by Key and Value.
Available object types for this method
GetProperty
public string GetProperty(string Key)
Get property by Key. If the Key does not exist, an empty string will return.
Available object types for this method
CallComponentMethod
public void CallComponentMethod(string ComponentName, string MethodName, string Params)
Calls the component method set to the item.
The method can be called by designating the Componentname and MethodName. the Params will be used as arguments.
The callable methods must follow the limits below:
- Has one and only String type as an argument
- Return value is void
Available object types for this method
SetOverridesProperty
public bool SetOverridesProperty(string Key, string Value, string ItemName)
Sets overrides property. If the same Key exists, its value will be overwritten, otherwise the Key and Value will be appended. If Key does not use "itemname", enter an empty string as an argument.
Available object types for this method
GetOverridesProperty
public bool GetOverridesProperty(string Key, ref string Value, ref string ItemName)
Get the overrides property.