Add animation store for pre-made clips
aac.AnimationStore(folder) seeds a clip from an existing .anim asset and returns a normal ClipBuilder, so pre-made clips work anywhere generated clips do and can still be edited (looping, keyframes, toggles, blend shapes). The Unity side clones the asset into the container and applies the script's changes to the clone, leaving the original untouched. - ClipData gains optional source; looping becomes Option<bool> so an untouched store clip keeps the asset's own looping setting. - Add rust/examples/animation_store.rhai, a worked store example.
This commit is contained in:
@@ -35,6 +35,14 @@ let run_clip = aac.clip("run_anim");
|
||||
run_clip.looping(true);
|
||||
run_clip.toggle("Body/Props", false);
|
||||
|
||||
// A pre-made clip: it is cloned into the container at generation time, so it can be edited here
|
||||
// without touching the asset stored in Assets/Doloro/Clips.
|
||||
let store = aac.AnimationStore("Assets/Doloro/Clips");
|
||||
let crouch_clip = store.clip("Crouch");
|
||||
crouch_clip.looping(true);
|
||||
crouch_clip.toggle("Body/Props", true);
|
||||
sit.set_clip(crouch_clip);
|
||||
|
||||
idle.set_clip(idle_clip);
|
||||
walk.set_clip(walk_clip);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user