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
textNametexture 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
spspeed.
void TextureMovementZ(float sp)
- Description: Sets the texture movement on the Z axis at
spspeed.
void PlaySingleSound(string clip, float volume)
- Description: Plays the
clipsound once at the component position.
void PlayLoopSound(string clip, float volume)
- Description: Plays the
clipsound in loop mode.
void StopSound()
- Description: Stops any current playing sound.
bool SoundPlaying()
- Description: Returns
trueif 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
vposition (local coordinates, no physics).
void Translate(Vector3 v, float sp)
- Description: Translates the component to
vposition atspspeed.
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
nameatspspeed. - 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
trueif 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;
}