Base Components Script Reference
A reference for all functions available for each component is listed below.
Base Object: ComponentBase
ComponentBase.tag
- Description: Sets or gets an object in the tag property of the Base component.
Common for all components
These properties and methods are available in every single component of the library.
Vector3 Position
- Description: Get or Set the Component Position in World Space.
Vector3 Scale
- Description: Get or Set the Component Scale.
Vector3 Rotation
- Description: Get or Set the Component Rotation in World Space.
String Label
- Description: Get or Set the label text for the component.
Vector4 LabelPosition
- Description: Get or Set the label position & Y axis rotation for the component.
- Parameters:
(x: axis X position, y: axis Y position, z: axis Z position, w: axis Y rotation).
Color LabelColor
- Description: Get or Set the label color for the component.
void Link(Transform t)
- Description: Links or parents the component with the passed component Transform object.
void UnLink()
- Description: Unlinks/deparents the component from its parent.
Space Object
Methods to handle local transformations within a hierarchy.
Vector3 Component.Space.localPosition
- Description: Get or Set the Component local position with respect to its superior hierarchical element.
Vector3 Component.Space.localEulerAngles
- Description: Get or Set the Component local rotation with respect to its superior hierarchical element.
void Component.Space.RotateAround(Vector3 point, Vector3 axis, float angle)
- Description: Rotates the component around the axis passing through a point in world coordinates by angle degrees.
Inventory List
Returns all the components present in the machine.
- Example:
// Print on screen all the components the current machine has.
EditorUtils.ShowText(Inventory.Count.ToString());
Static Element: Movement & Rotation
Functions like AnimationMove, MovePh, AnimationMoveAcc, Move, AnimationRotate, AnimationRotateAcc, and Rotate must be called by trigger (once), not by level (every frame).
void AnimationMove(string direction, float speed, float dest)
- Description: Moves the component from the current position to the
destposition, atspeed, in the direction passed as string "X", "Y" or "Z". This function doesn't apply physics.
void MovePh(string dir, float dest, float speed)
- Description: Moves the component from the current position to the
destposition, atspeed, in the direction passed as string "X", "Y" or "Z". This function applies physics and uses collisions.
void MoveSmooth(Vector3 destPos, float smooth)
- Description: Moves the component to the destination position using physics and a smooth step algorithm.
void BreakMovement()
- Description: Stops the
AnimationMovemovement.
bool Pause
- Description: Pauses the Animation or Rotation movements.
void AnimationMoveAcc(string direction, float speed, float dest)
- Description: Moves the component from the current position to the
destposition, atspeed, in the direction passed as string "X", "Y" or "Z" applying acceleration/deceleration at the beginning and end of the movement. This function doesn't apply physics.
float GetAnimationPosition(string direction)
- Description: Returns the current position of the component for the axis passed as parameter (x, y, or z).
void Move(string direction, float speed, float dest)
- Description: Moves the component from the current position to the
destposition, atspeed, in the direction passed as string "X", "Y" or "Z". This function applies physics.
float GetMovePosition(string direction)
- Description: Returns the current position of the component for the axis passed as parameter (x, y, or z).
public void AnimationRotate(string axis, float deg, float speed, int sense)
- Description: Rotates the component from the current angle to the
degangle, atspeed, in the direction passed as string "X", "Y" or "Z". - Sense:
0: clockwise,1: anti-clockwise,2: absolute mode. (No physics).
float GetAnimationRotation(string axis)
- Description: Returns the current angle for the axis passed as parameter (x, y, or z).
void AnimationRotateAcc(string direction, float speed, float dest)
- Description: Rotates the component in axis "x", "y" or "z" at speed to destination angles. This function doesn't apply physics.
void MoveTowards(Vector3 destPos, float speed)
- Description: Moves the component from the current position to the
destPosposition at the passedspeedin the three axes (no physics applied).
bool MoveEnded
- Description: Returns
truewhen the movement is finished.
bool IsMoving
- Description: Returns
truewhile the component is moving.
void Rotate(string axis, float deg, float speed, int sense)
- Description: Rotates the component from the current angle to the
degangle, atspeed, in the direction passed as string "X", "Y" or "Z". - Sense:
0: clockwise,1: anti-clockwise,2: absolute mode. This function applies physics.
float GetRotation(string axis)
- Description: Returns the current angle for the axis passed as parameter (x, y, or z).
void AnimationRotateAngles(Vector3 value)
- Description: Rotates the component to a local angle position Vector3 value and speed. This function doesn't apply physics. Must be called by level.
void AnimationRotations(Vector3 speed)
- Description: Rotates the component at a Vector3 axis and speed. This function doesn't apply physics. Must be called by level.
void Rotations(Vector3 angleAxis, float speed)
- Description: Rotates the component at a Vector3 axis and speed. This function applies physics. Must be called by level.
void AnimationOrbit(Vector3 orig, Vector3 axis, float deg, float speed)
- Description: Orbits the component around the origin
origalong the axisaxisatspeedfordegdegrees. This function doesn't apply physics. Must be called by level.
void Orbit(Vector3 orig, Vector3 axis, float angles)
- Description: Orbits the component around the origin
origalong the axisaxisat the speed and degrees indicated by angles. This function doesn't apply physics.
bool RotateEnded
- Description: Returns
truewhen the rotation is finished.
bool IsRotating
- Description: Returns
truewhile the component is rotating.
Vector3 PhysicScale
- Description: Get/Set the Component Physics Scale.
float Opacity
- Description: Get/Set the Component opacity (0 to 1).
void ChangeTexture(string textName)
- Description: Set the
textNameTexture.
Vector2 TextureTile
- Description: Sets/Gets the component texture tile for axis X and Z.
void TextureMovementX(float sp)
- Description: Sets the component texture movement on X axis at
spspeed.
void TextureMovementZ(float sp)
- Description: Sets the component texture movement on Z axis at
spspeed.
void SetModel(string mod)
- Description: Set the
modname Model.
void SetModelPosition(Vector3 v3)
- Description: Set the Model position.
void SetModelScale(Vector3 v3)
- Description: Set the Model scale.
void SetModelRotation(Vector3 v3)
- Description: Set the Model Rotation.
Vector3 CurrPos()
- Description: Returns the component current position (without physics).
Vector3 CurrRot()
- Description: Returns the component current rotation (without physics).
void Translate(Vector3 pos)
- Description: Translates the component to
posposition in local coordinates (without physics).
void TranslateWorld(Vector3 pos)
- Description: Translates the component to
posposition in world coordinates (without physics).
void Rotate(Vector3 pos)
- Description: Rotates the component to
posposition in local coordinates (without physics).
void RotateWorld(Vector3 pos)
- Description: Rotates the component to
posposition in world coordinates (without physics).
void MovePosition(Vector3 pos)
- Description: Moves component to
posposition (with physics).
Vector3 CurrentPosition()
- Description: Returns the component current position (with physics).
void MoveRotation(Vector3 rot)
- Description: Rotates the component to
rotangles (with physics).
Vector3 CurrentRotation()
- Description: Returns the component current rotation angles (with physics).
void PlaySingleSound(string clip, float volume)
- Description: Plays the
clipsound in the component 3D position, with volume (0 to 1).
void PlayLoopSound(string clip, float volume)
- Description: Plays the
clipsound in the component 3D position, with volume (0 to 1) in loop mode.
void StopSound()
- Description: Stops the current playing sound.
bool SoundPlaying()
- Description: Returns true if a sound is playing.
bool MouseOverComponent()
- Description: Returns true if mouse pointer is over the component.
bool MouseClickDownOverComponent()
- Description: Returns true if the user presses left mouse button over the component.
bool MouseClickUpOverComponent()
- Description: Returns true if the user releases left mouse button over the component.
bool ComponentCollision
- Description: Returns true if any component collides with the component.
void ApplyForce(Vector3 force)
- Description: Applies the force to the Dynamic Element or Work Part that collides with the component.
bool ControllerVrTouch
- Description: Returns true when the Right or Left VR controller collides with the component.
bool ControllerVrTouchRight
- Description: Returns true when the Right VR hand controller collides with the component.
bool ControllerVrTouchLeft
- Description: Returns true when the Left VR hand controller collides with the component.
WorkPartLogic WorkPartCollision
- Description: Returns the WorkPart Object that collides with the component.
List<WorkPartLogic> WorkPartCollisionList
- Description: Returns a list with all the WorkPart objects that collide with the Static Component or inside the StaticComponent area (when Ghost method is true).
AddCollisionController() must be called at Init().
bool RayCollision(Vector3 origin, Vector3 direction, float distance)
- Description: Returns true if any component collides with the ray with origin in
Vector3 origin, pointing toVector3 direction, and with the distance passed byfloat distance.
WorkPartLogic RayCollisionWorPart(Vector3 origin, Vector3 direction, float distance)
- Description: Returns the WorkPart reference that collides with the ray with origin in
Vector3 origin, pointing toVector3 direction, and with the distance passed byfloat distance.
ComponentBase RayCollisionComponent(Vector3 origin, Vector3 direction, float distance)
- Description: Returns the ComponentBase object (common object for all components) reference that collides with the ray with origin in
Vector3 origin, pointing toVector3 direction, and with the distance passed byfloat distance.
ComponentBase _Component
- Description: Returns the ComponentBase (base object from which all other components derive) object that collides with the component.
void AddCollisionController()
- Description: Use this method if you use the
CollidesWithfunction,WorkPartCollisionList, or when a Component is assigned as a model. This method must be called at theInitscript method in order for the component to recognize collisions.
bool CollidesWith(string desc)
- Description: Returns true if the Static Element collides with the component with description
desc, false if it does not collide.
void Ghost(bool value)
- Description: If true, the static element has no collision but is detected by other components' scripts.
void IsVisible(bool value)
- Description: Sets whether the element is visible or not.
void IsEnabled(bool value)
- Description: Sets whether the element is enabled or not. If not enabled, the collision will be disabled.
void LightEmission(bool enabled, Color col)
- Description: If enabled is true, the component emits a light with
colColor.
void LightEmission(bool enabled, Color col, float intensity)
- Description: If enabled is true, the component emits a light with
colColor with the intensity passed.
void SetMaterialColor(Color col)
- Description: Changes the material color to the passed color parameter.
void LoadExternalTexture(string path, Vector2 ttile)
- Description: Loads a jpg/png file located in
path, and repeatsttileon the component.
void Active(bool v)
- Description: Activates or deactivates the component (not visible and not collidable).
void PlayExternalSound(string wav)
- Description: Plays a wav file located in the
wavpath.
void LoadUpdatableModel(string name)
- Description: Sets the
nameModel from the updatable model folder; the name must be passed as "StreamingAssets/ModelName".
void DisableCollision(WorkPartLogic wp, bool v)
- Description: Disables or enables collision (parameter
v) between the passed WorkPart and the current StaticElement.
Collider Collis()
- Description: Returns the collider object.
Transform Transf
- Description: Returns the component Transform object (position, rotation, and scale).
Dynamic Element
These methods and properties apply specifically to components that have dynamic physics behavior (mass, gravity, forces, etc.).
Vector3 PhysicScale
- Description: Get/Set the Component Physics Scale.
void ChangeTexture(string textName)
- Description: Set the
textNameTexture.
void SetModel(string mod)
- Description: Set the
modname Model.
void SetModelPosition(Vector3 v3)
- Description: Set the Model position.
void SetModelScale(Vector3 v3)
- Description: Set the Model scale.
void SetModelRotation(Vector3 v3)
- Description: Set the Model Rotation.
Vector3 CurrPos()
- Description: Returns the component's current position (without physics).
Vector3 CurrRot()
- Description: Returns the component's current rotation (without physics).
void MoveSmooth(Vector3 destPos, float smooth)
- Description: Moves the component to the destination position using physics and a smooth step algorithm.
Translate(Vector3 pos)
- Description: Translates the component to
posposition in local coordinates (without physics).
TranslateWorld(Vector3 pos)
- Description: Translates the component to
posposition in world coordinates (without physics).
Rotate(Vector3 pos)
- Description: Rotates the component to
posposition in local coordinates (without physics).
RotateWorld(Vector3 pos)
- Description: Rotates the component to
posposition in world coordinates (without physics).
void MovePosition(Vector3 pos)
- Description: Moves the component to
posposition (with physics).
Vector3 CurrentPosition()
- Description: Returns the component's current position (with physics).
MoveRotation(Vector3 rot)
- Description: Rotates the component to
rotangles (with physics).
Vector3 CurrentRotation()
- Description: Returns the component's current rotation angles (with physics).
void PlaySingleSound(string clip, float volume)
- Description: Plays the
clipsound in the component's 3D position, with volume (0 to 1).
void PlayLoopSound(string clip, float volume)
- Description: Plays the
clipsound in the component's 3D position, with volume (0 to 1) in loop mode.
void StopSound()
- Description: Stops the currently playing sound.
bool SoundPlaying()
- Description: Returns true if a sound is playing.
bool MouseOverComponent()
- Description: Returns true if the mouse pointer is over the component.
bool ComponentCollision
- Description: Returns true if any component collides with the component.
void Ghost(bool value)
- Description: If true, the dynamic element has no collision and is not affected by gravity, but is detected by other components' scripts.
bool ControllerVrTouch
- Description: Returns true when the Right or Left VR controller collides with the component.
bool ControllerVrTouchRight
- Description: Returns true when the Right VR hand controller collides with the component.
bool ControllerVrTouchLeft
- Description: Returns true when the Left VR hand controller collides with the component.
WorkPartLogic WorkPartCollision
- Description: Returns the WorkPart Object that collides with the component.
bool RayCollision(Vector3 origin, Vector3 direction, float distance)
- Description: Returns true if any component collides with the ray with origin in
Vector3 origin, pointing toVector3 direction, and with the distance passed byfloat distance.
WorkPartLogic RayCollisionWorPart(Vector3 origin, Vector3 direction, float distance)
- Description: Returns the WorkPart reference that collides with the ray with origin in
Vector3 origin, pointing toVector3 direction, and with the distance passed byfloat distance.
ComponentBase _Component
- Description: Returns the ComponentBase (base object from which all other components derive) object that collides with the component.
void AddCollisionController()
- Description: Use this method if you use the
CollidesWithfunction or when a Component is assigned as a model.
This method must be called at the Init script method in order for the component to recognize collisions.
bool CollidesWith(string desc)
- Description: Returns true if the Dynamic Element collides with the component with description
desc, false if it does not collide.
void IsVisible(bool value)
- Description: Sets whether the element is visible or not.
void IsEnabled(bool value)
- Description: Sets whether the element is enabled or not. If not enabled, the collision will be disabled.
void ApplyForce(Vector3 force)
- Description: Adds a force to the Dynamic element.
void ApplyRelativeForce(Vector3 force)
- Description: Adds a force to the Dynamic element relative to its coordinate system.
void AddTorque(Vector3 force)
- Description: Adds a torque force to the Dynamic element.
void AddRelativeTorque(Vector3 force)
- Description: Adds a torque force to the Dynamic element relative to its coordinate system.
void RelativeForceTo(string axis, float dest, float force)
- Description: Applies a force on the axis indicated by the
axisparameter (X, Y, Z) to move to the position indicated in thedestparameter (in local mode) and with an intensity indicated byforce.
void LoadExternalTexture(string path, Vector2 ttile)
- Description: Loads a jpg/png file located in
path, and repeatsttileon the component.
void LightEmission(bool enabled, Color col)
- Description: If enabled is true, the component emits a light with
colColor.
void LightEmission(bool enabled, Color col, float intensity)
- Description: If enabled is true, the component emits a light with
colColor with the intensity passed.
void SetMaterialColor(Color col)
- Description: Changes the material color to the passed color parameter.
void Active(bool v)
- Description: Activates or deactivates the component (not visible and not collidable).
void PlayExternalSound(string wav)
- Description: Plays a wav file located in the
wavpath.
void AttachMe(Component.Space sp)
- Description: Sets the dynamic object as the parent of the passed component; in this way, the passed component will be moved & rotated as the dynamic element object.
void DettachMe(Component.Space sp)
- Description: Breaks the parent relationship between the dynamic object and the passed component.
void LoadUpdatableModel(string name)
- Description: Sets the
nameModel from the updatable model folder; the name must be passed as "StreamingAssets/ModelName".
void DisableCollision(WorkPartLogic wp, bool v)
- Description: Disables or enables collision (parameter
v) between the passed WorkPart and the current DynamicElement.
Collider Collis()
- Description: Returns the collider object.
Transform Transf
- Description: Returns the component Transform object (position, rotation, and scale).
Plane Element
These properties and methods apply to Plane components, often used for flat surfaces, sensors, or basic conveyors.
void MoveSmooth(Vector3 destPos, float smooth)
- Description: Moves the component to the destination position using physics and a smooth step algorithm.
public void AnimationRotate(string axis, float deg, float speed, int sense)
- Description: Rotates the component from the current angle to the
degangle, atspeed, in the direction passed as string "X", "Y", or "Z". This function doesn't apply physics.
The function must be called by trigger, not by level.
void AnimationRotateAcc(string direction, float speed, float dest)
- Description: Rotates the component on axis "x", "y", or "z" at speed to destination angles. This function doesn't apply physics. The function must be called by trigger.
float GetAnimationRotation(string axis)
- Description: Returns the current angle for the axis passed as a parameter (x, y, or z).
float Speed
- Description: Get/Set the Plane speed (if Collisionable Property is true).
float OffsetSpeed
- Description: Get/Set the Plane texture speed.
void Advance(bool value)
- Description: Sets whether the Plane moves forwards or is stopped.
void Reverse(bool value)
- Description: Sets whether the Plane moves backwards or is stopped.
float MovementAmount
- Description: Returns the amount of movement the plane is making; useful for creating movements with encoder control.
float TotalMovementAmount
- Description: Returns the total amount of movement the plane is making; useful for creating conveyors with encoder control.
void ResetTotalMovementAmount()
- Description: Resets the total amount of movement.
Vector2 PlaneScale
- Description: Get/Set the Plane Scale.
void ChangeTexture(string textName)
- Description: Set the
textNameTexture.
Vector3 CurrPos()
- Description: Returns the component's current position (without physics).
Vector3 CurrRot()
- Description: Returns the component's current rotation (without physics).
Translate(Vector3 pos)
- Description: Translates the component to
posposition in local coordinates (without physics).
TranslateWorld(Vector3 pos)
- Description: Translates the component to
posposition in world coordinates (without physics).
Rotate(Vector3 pos)
- Description: Rotates the component to
posposition in local coordinates (without physics).
RotateWorld(Vector3 pos)
- Description: Rotates the component to
posposition in world coordinates (without physics).
void MovePosition(Vector3 pos)
- Description: Moves the component to
posposition (with physics).
Vector3 CurrentPosition()
- Description: Returns the component's current position (with physics).
MoveRotation(Vector3 rot)
- Description: Rotates the component to
rotangles (with physics).
Vector3 CurrentRotation()
- Description: Returns the component's current rotation angles (with physics).
void PlaySingleSound(string clip, float volume)
- Description: Plays the
clipsound in the component's 3D position, with volume (0 to 1).
void PlayLoopSound(string clip, float volume)
- Description: Plays the
clipsound in the component's 3D position, with volume (0 to 1) in loop mode.
void StopSound()
- Description: Stops the currently playing sound.
bool SoundPlaying()
- Description: Returns true if a sound is playing.
bool MouseOverComponent()
- Description: Returns true if the mouse pointer is over the component.
bool ComponentCollision
- Description: Returns true if any component collides with the component.
void AddCollisionController()
- Description: Use this method if you use the
CollidesWithfunction orWorkPartCollisionList. This method must be called at theInitscript method in order for the component to recognize collisions.
bool CollidesWith(string desc)
- Description: Returns true if the Plane Element collides with the component with description
desc, false if it does not collide.
void Ghost(bool value)
- Description: If true, the plane element has no collision but is detected by other components' scripts.
void ApplyForce(Vector3 force)
- Description: Applies the force to the Dynamic Element or Work Part that collides with the component.
bool ControllerVrTouch
- Description: Returns true when the Right or Left VR controller collides with the component.
bool ControllerVrTouchRight
- Description: Returns true when the Right VR hand controller collides with the component.
bool ControllerVrTouchLeft
- Description: Returns true when the Left VR hand controller collides with the component.
WorkPartLogic WorkPartCollision
- Description: Returns the WorkPart Object that collides with the component.
List<WorkPartLogic> WorkPartCollisionList
- Description: Returns a list with all the WorkPart objects colliding with the plane.
AddCollisionController() must be called at Init().
bool RayCollision(Vector3 origin, Vector3 position, float distance)
- Description: Returns true if any component collides with the ray with origin in
Vector3 origin, pointing toVector3 direction, and with the distance passed byfloat distance.
ComponentBase _Component
- Description: Returns the ComponentBase (base object from which all other components derive) object that collides with the component.
WorkPartLogic RayCollisionWorPart(Vector3 origin, Vector3 position, float distance)
- Description: Returns the WorkPart reference that collides with the ray with origin in
Vector3 origin, pointing toVector3 direction, and with the distance passed byfloat distance.
void IsVisible(bool value)
- Description: Sets whether the element is visible or not.
void IsEnabled(bool value)
- Description: Sets whether the element is enabled or not. If not enabled, the collision will be disabled.
void LoadExternalTexture(string path, Vector2 ttile)
- Description: Loads a jpg/png file located in
path, and repeatsttileon the component.
void LightEmission(bool enabled, Color col)
- Description: If enabled is true, the component emits a light with
colColor.
void LightEmission(bool enabled, Color col, float intensity)
- Description: If enabled is true, the component emits a light with
colColor with the intensity passed.
void SetMaterialColor(Color col)
- Description: Changes the material color to the passed color parameter.
void Active(bool v)
- Description: Activates or deactivates the component (not visible and not collidable).
void PlayExternalSound(string wav)
- Description: Plays a wav file located in the
wavpath.
void DisableCollision(WorkPartLogic wp, bool v)
- Description: Disables or enables collision (parameter
v) between the passed WorkPart and the current Plane element.
Collider Collis()
- Description: Returns the collider object.
Transform Transf
- Description: Returns the component Transform object (position, rotation, and scale).
3D Model
Methods and properties specifically tailored for interacting with and animating imported 3D Models.
void MoveSmooth(Vector3 destPos, float smooth)
- Description: Moves the component to the destination position using physics and a smooth step algorithm.
void AnimationMove(string direction, float speed, float dest)
- Description: Moves the component from the current position to the
destposition, atspeed, in the direction passed as string "X", "Y", or "Z". The function must be called by trigger, not by level.
void BreakMovement()
- Description: Stops the
AnimationMovemovement.
float GetAnimationPosition(string direction)
- Description: Returns the current position of the component for the axis passed as a parameter (x, y, or z).
void AnimationRotate(string axis, float deg, float speed, int sense)
- Description: Rotates the component from the current angle to the
degangle, atspeed, in the direction passed as string "X", "Y", or "Z". If sense is 0, it rotates clockwise; if 1, it rotates anti-clockwise; if 2, it rotates in absolute mode. The function must be called by trigger, not by level.
void AnimationRotateAcc(string direction, float speed, float dest)
- Description: Rotates the component on axis "x", "y", or "z" at speed to destination angles. The function must be called by trigger.
float GetAnimationRotation(string axis)
- Description: Returns the current angle for the axis passed as a parameter (x, y, or z).
void Rotate(Vector3 v)
- Description: Rotates the component according to the passed vector.
void AnimationRotations(Vector3 speed)
- Description: Rotates the component at a Vector3 axis and speed. The function must be called by level.
void AnimationOrbit(Vector3 orig, Vector3 axis, float deg, float speed)
- Description: Orbits the component around origin
origon axisaxiswithspeedfordegdegrees. The function must be called by level.
void Orbit(Vector3 orig, Vector3 axis, float angles)
- Description: Orbits the component around origin
origon axisaxisat the speed and degrees indicated by angles.
Vector3 CurrPos()
- Description: Returns the component's current position.
Vector3 CurrRot()
- Description: Returns the component's current rotation.
Vector3 ModelScale
- Description: Get/Set the Component Scale.
float Opacity
- Description: Get/Set the Component opacity (0 to 1).
bool Transparent
- Description: Get/Set whether the Component is transparent.
void ChangeTexture(string textName)
- Description: Set the
textNameTexture.
Vector2 TextureTile
- Description: Sets/Gets the component texture tile for axis X and Z.
void TextureMovementX(float sp)
- Description: Sets the component texture movement on X axis at
spspeed.
void TextureMovementZ(float sp)
- Description: Sets the component texture movement on Z axis at
spspeed.
void ApplyMovement(bool force, float speed, bool adv, bool rev)
- Description: Applies movement to the WorkParts that are in contact with the Model3D. Model3D must be set as Collisionable.
void SetModel(string mod)
- Description: Set the
modname Model.
void PlaySingleSound(string clip, float volume)
- Description: Plays the
clipsound in the component's 3D position, with volume (0 to 1).
void PlayLoopSound(string clip, float volume)
- Description: Plays the
clipsound in the component's 3D position, with volume (0 to 1) in loop mode.
void StopSound()
- Description: Stops the currently playing sound.
bool SoundPlaying()
- Description: Returns true if a sound is playing.
void IsVisible(bool value)
- Description: Sets whether the element is visible or not.
void LightEmission(bool enabled, Color col)
- Description: If enabled is true, the component emits a light with
colColor.
void LightEmission(bool enabled, Color col, float intensity)
- Description: If enabled is true, the component emits a light with
colColor with the intensity passed.
void SetMaterialColor(Color col)
- Description: Changes the material color to the passed color parameter.
void LoadExternalTexture(string path, Vector2 ttile)
- Description: Loads a jpg/png file located in
path, and repeatsttileon the component.
void PlayExternalSound(string wav)
- Description: Plays a wav file located in the
wavpath.
void LoadUpdatableModel(string name)
- Description: Sets the
nameModel from the updatable model folder; the name must be passed as "StreamingAssets/ModelName".
WorkPartLogic WorkPartCollision
- Description: Returns the WorkPart object that collides with the component (only if collisionable property is true).
List<WorkPartLogic> WorkPartCollisionList
- Description: Returns a list with all the WorkPart objects colliding with the 3D Model (only if collisionable property is true).
Transform Transf
- Description: Returns the component Transform object (position, rotation, and scale).