format
typescript
Animation.SetClips(clips)class: Animation
description
Sets the animation clips controlled by this Animation component.
parameter
| param_name | type | description |
|---|---|---|
| clips | AnimationClipItem[] | Animation clips |
reture
| type | description |
|---|---|
void |
code example
typescript
let obj = new GameObject();
let animation = obj.AddComponent<Animation>(Animation);
let uuid = "3AC29F7036DD40B642A9388F35BA5442";
let clip = Resources.Load<AnimationClip>(AnimationClip, uuid);
let item = new AnimationClipItem();
item.clip = clip;
let clip_arr = [item];
animation.SetClips(clip_arr);