Skip to main content

Meshes and Animations Reference

Methods and properties for managing editable meshes and animation containers.

EditableMesh

The EditableMesh component allows for advanced texture manipulation and movement without full physics simulation.

void ChangeTexture(string textName)

  • Description: Sets the textName texture to the component.

Vector2 TextureTile

  • Description: Sets or gets the component texture tile for axis X and Z.

void TextureMovementX(float sp)

  • Description: Sets the texture movement on the X axis at sp speed.

void TextureMovementZ(float sp)

  • Description: Sets the texture movement on the Z axis at sp speed.

void PlaySingleSound(string clip, float volume)

  • Description: Plays the clip sound once at the component position.

void PlayLoopSound(string clip, float volume)

  • Description: Plays the clip sound in loop mode.

void StopSound()

  • Description: Stops any current playing sound.

bool SoundPlaying()

  • Description: Returns true if a sound is currently playing.

void Visible(bool value)

  • Description: Sets the visibility of the element.

void LightEmission(bool enabled, Color col)

  • Description: If enabled, the component emits light with the specified color.

void LightEmission(bool enabled, Color col, float intensity)

  • Description: Emits light with specific color and intensity.

void SetMaterialColor(Color col)

  • Description: Changes the material color.

void ApplyMovement(bool force, float speed, bool adv, bool rev)

  • Description: Applies movement to WorkParts in contact with the mesh.
  • Note: Component must be set as Collisionable.

void Translate(Vector3 v)

  • Description: Translates the component to v position (local coordinates, no physics).

void Translate(Vector3 v, float sp)

  • Description: Translates the component to v position at sp speed.

Transform Transf

  • Description: Returns the Transform object (position, rotation, and scale).

Empty

Used as a container for animations and logic points.

void PlayAnim(string name, float sp)

  • Description: Plays the animation name at sp speed.
  • Constraint: Must be called by trigger, not by level.

void StopAnim(string name)

  • Description: Stops the animation.

void PauseAnim(string name)

  • Description: Pauses the animation.

void RewindAnim(string name, float sp)

  • Description: Rewinds the animation at specified speed.

bool AnimationEnded(string name)

  • Description: Returns true if the animation has finished.

event AnimatorHandler AnimatorEvent

  • Description: Fires when a KeyFrame Event is activated in the animation.

Example: Animator Events

public void Init()
{
Empty0.AnimatorEvent += AnimEvent;
}

private void AnimEvent(float v)
{
EditorUtils.ShowText(v.ToString());
}

public void Finish()
{
Empty0.AnimatorEvent -= AnimEvent;
}