Skip to Content

Animation

Engine-side registry of feedback and particle ids plus bus requests for playback. Unity UnityAnimationAdapter registers ids and listens for events.

Adapter: UnityAnimationAdapter.

State

Mostly in-memory lists (_registeredIds, _registeredParticleIds); not a large Persistent subtree for the registry.

How it looks in persistent.json

There is no standard registry subtree in persistent.json for this service — ids are registered at runtime (RegisterFeedbackIds, particle pools, …). Effects are driven by CallService and bus events consumed by UnityAnimationAdapter.

Events

Particle-related string ids are in GnosisAnimationEvents (Runtime/GnosisEngine/Source/Services/Persistent/Services/Animation/). Feedback uses a literal id in GnosisAnimationService.

Event idRole
REQUEST_FEEDBACK_PLAYAdapter plays registered feedback
REQUEST_PARTICLE_INSTANTIATESpawn / pool particle instance
REQUEST_PARTICLE_CONTROLPlay, Stop, Pause, Emit, Reset, … (see function descriptors)

Payload keys such as id, action, emitCount, moveToPosition, activateGameObject are PAYLOAD_* on GnosisAnimationEvents where applicable.

Functions (summary)

FunctionRole
RegisterFeedbackIds{ ids: [string] } replaces registered feedback set
GetRegisteredFeedbackIdsOk (inspect via adapter/C# in practice)
HasFeedbackfeedbackId
PlayFeedbackid, optional transform / transformFromStorePath / sourceId
InstantiateParticleRich JSON: id, registry/inline recipe, transform options, matchAnchorRotation / matchAnchorScale, …
ControlParticleid, action, optional emitCount, position, …
HasParticleparticleId

Full parameter semantics are in GnosisFunctionDescriptor strings in GnosisAnimationService.cs.

Usage example — PlayFeedback

AnimationService.Example1.cs
private void PlayHitFeedback() { if (Context?.Store == null || Context.CallService == null) return; var args = GnosisNode.CreateObject(Context.Store); args.Set("id", "player_hit_feedback"); CallService("Animation", "PlayFeedback", args); }

Statistics

None.

Last updated on