Astra Child

Mody Action

Estimated reading: 2 minutes 0 views

Mody Actions are building blocks of the Mody system that allow the creation of dynamic behaviors. They are simple and easy to use scripts that contain an action that can be executed when a signal is received.

Mody comes with a set of built-in Mody Actions that cover common use cases, such as changing a bool value, a color, a float or executing a UnityAction. These built-in Mody Actions can be used as-is or can be extended and customized to fit the project’s specific needs.

Here are the built-in Mody Actions:

  • BoolModyAction
  • Color32ModyAction
  • ColorModyAction
  • DoubleModyAction
  • FloatModyAction
  • GameObjectModyAction
  • GenericModyAction
  • IntModyAction
  • LongModyAction
  • MonoBehaviourModyAction
  • ScriptableObjectModyAction
  • SimpleModyAction
  • SpriteModyAction
  • StringModyAction
  • Texture2DModyAction
  • TextureModyAction
  • Vector2ModyAction
  • Vector3ModyAction
  • Vector4ModyAction

Users can create their own Mody Actions by extending the MetaModyAction class, which allows for more customized and specific actions. The SimpleModyAction class is a special case of Mody Action that does not have a value and is used for valueless actions.

To create a new Mody Action, users can simply derive a class from the MetaModyAction class, specify the value type, and implement the action’s logic. Once created, the new Mody Action can be added to a Mody Module and used like any other Mody Action.

Mody Actions provide a flexible way to create dynamic behaviors in Unity projects, and with the ability to create custom actions, the possibilities are endless.

Share this Doc
CONTENTS
Scroll to Top