Skip to content

Components

Ilia Petrov-Komotskii edited this page Sep 24, 2026 · 5 revisions

Components

Scene components under Add Component → Mane Tools.

Position followers

Both follow a Transform target every Update.

  • PositionFollowerSimple — Speed is a catch-up factor (0 = stay, 1 = snap this frame). Vector3.Lerp.
  • PositionFollowerByDistance — catch-up from an AnimationCurve sampled by world distance (X = distance, Y = factor). 0 stays, 1 snaps this frame. Values in between are frame-rate compensated around 60 fps, not passed straight to Lerp.
simple.Target = player;
simple.Speed = .2f;          // PositionFollowerSimple

byDistance.Target = player;
byDistance.AnimationCurve = curve; // X = world lag, Y = catch-up

Screenshot: position-follower.png — inspector with target and speed / curve. Host at https://raw.githubusercontent.com/wiki/ManeFunction/ManeTools-Unity/position-follower.png.

StateSyncComponent

Mirrors this object's enabled state onto a list of GameObjects. Null list and missing entries are skipped.

// Enable this component → bound objects SetActive(true)
// Disable → SetActive(false)

Screenshot: state-sync.png — bind array on a ManeStyle inspector. Host at https://raw.githubusercontent.com/wiki/ManeFunction/ManeTools-Unity/state-sync.png.

StateChangeDetector

Raises OnStateChanged with (GameObject, State) on enable, disable, and destroy. State is [Flags]: Enabled, Disabled, Destroyed.

detector.OnStateChanged += (go, state) =>
{
    if (state == StateChangeDetector.State.Disabled)
        pool.Return(go);
};

Clone this wiki locally