お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close
clip
として clip
をアニメーションとして追加します。
var walkClip : AnimationClip; animation.AddClip(walkClip, "walk");
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { public AnimationClip walkClip; void Example() { animation.AddClip(walkClip, "walk"); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): public walkClip as AnimationClip def Example() as void: animation.AddClip(walkClip, 'walk')
addLoopFrame | 特別なフレームを最初のフレームに一致するように最後に挿入しますか?もしループアニメーションを作成する場合はtrueに設定します。 |
firstFrame
の firstFrame
から lastFrame
までの再生のみを追加します。新しいクリップは newName
の名前でアニメーションに追加されます。
もし既に存在する名のクリップの場合、新しいクリップに入れ替わります。
// Split the default clip into a shoot, walk and idle animation animation.AddClip(animation.clip, "shoot", 0, 10); // walk and idle will add an extra looping frame at the end animation.AddClip(animation.clip, "walk", 11, 20, true); animation.AddClip(animation.clip, "idle", 21, 30, true);
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Example() { animation.AddClip(animation.clip, "shoot", 0, 10); animation.AddClip(animation.clip, "walk", 11, 20, true); animation.AddClip(animation.clip, "idle", 21, 30, true); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def Example() as void: animation.AddClip(animation.clip, 'shoot', 0, 10) animation.AddClip(animation.clip, 'walk', 11, 20, true) animation.AddClip(animation.clip, 'idle', 21, 30, true)