Saltar al contenido principal

WorkParts Reference

WorkPart​

Vector3 PhysicScale​

  • Description: Get/Set the WorkPart Physics Scale.

int WorkPartType​

  • Description: Get/Set the WorkPart type (integer number to identify this workpart in the machine).

void ChangeTexture(string textName)​

  • Description: Set the textName Texture.

void SetModelPosition(Vector3 v3) / SetModelScale(Vector3 v3) / SetModelRotation(Vector3 v3)​

  • Description: Sets the Model position, scale, and rotation.

void MovePosition(Vector3 pos) / MoveRotation(Vector3 rot)​

  • Description: Moves or rotates the component to the target position/angles (with physics).

Vector3 CurrentPosition() / Vector3 CurrentRotation()​

  • Description: Returns the component's current position or rotation angles (with physics).

void PlaySingleSound(string clip, float volume) / void PlayLoopSound(...)​

  • Description: Plays a sound in the component's 3D position.

void StopSound()​

  • Description: Stops the currently playing sound.

bool MouseOverComponent()​

  • Description: Returns true if the mouse pointer is over the component.

bool ComponentCollision / ComponentBase _Component​

  • Description: Returns true if any component collides, and returns the reference of the colliding component.

bool ControllerVrTouch / ControllerVrTouchRight / ControllerVrTouchLeft​

  • Description: Returns true when VR controllers collide with the component.

void AddCollisionController()​

  • Description: Use this method at the Init script method in order for the component to recognize collisions for CollidesWith.

bool CollidesWith(string desc)​

  • Description: Returns true if the WorkPart collides with the component with description desc.

void ApplyForce(Vector3 force) / ApplyRelativeForce(Vector3 force)​

  • Description: Adds a force to the WorkPart.

void AddTorque(Vector3 force) / AddRelativeTorque(Vector3 force)​

  • Description: Adds a torque force to the WorkPart.

void OrbitTo(Vector3 pos, float sp)​

  • Description: Performs an orbital movement with respect to the point pos, at the sp speed.

void BreakUnion() / void MakeUnion(int WorkPartType)​

  • Description: Breaks or makes a joint between WorkParts.

void LightEmission(bool enabled, Color col)​

  • Description: If enabled is true, the component emits a light with col Color.

void AttachMe(Component.Space sp) / void DettachMe(Component.Space sp)​

  • Description: Manages the parent relationship between the WorkPart and other components.

void FixToWp(WorkPartLogic wp) / void FixToUCC(UCC uc, int comp) / void UnFix()​

  • Description: Attaches/Detaches the WorkPart to another WorkPart or UDC while maintaining physics.

void AttachToWP(WorkPartLogic wp) / void DettachToWP()​

  • Description: Inserts or releases a WorkPart inside another.

WorkPart Creator​

void CreateNewWorkPart() / void CreateNewWorkPart(int workPartType)​

  • Description: Creates a new WorkPart.

void CreateNewWorkPartUDC(int UDCId)​

  • Description: Creates a new UDC as a standard WorkPart.

void CreateByTime(float min, float max)​

  • Description: Creates a new WorkPart in a random time between min and max.

event CreatorHandler CreatorEvent / event CreatorUCCHandler CreatorUCCEvent​

  • Description: Fires when a WorkPart or UCC has been created.

WorkPart Destructor​

int WorkPartDestrType​

  • Description: Returns the WorkPart type of the currently destroyed WorkPart.

event DestructorEvent / event DestructorHandlerWP DestructorEventWP​

  • Description: Fires when a WorkPart has been destroyed.

WorkPart Trigger​

WorkPartLogic WorkPartCollision / List<ComponentBase> Collisions​

  • Description: Returns the WorkPart or a list of components colliding with the trigger.

int CollisionNumber​

  • Description: Returns the number of components that collide with the WorkPart Trigger.

event TriggerHandlerWP TriggerEventWP / event TriggerHandlerUDC TriggerEventUDC​

  • Description: Fires when a WorkPart or UDC has been detected.