スプライトをアニメーション化しないで、スプライトを使用してコンポーネント(SpriteRenderer)をアニメートします。スプライトは特別な属性を持つテクスチャなので、特別に考慮されます。
テクスチャをアニメーション化しないでください。単なるイメージです。アニメーションの効果を作り出すためにスワップするテクスチャのセットがあります。
3-2-1-Goをアニメーション化するには、まずSprite gameObjectを作成してからスプライトテクスチャを割り当て、次にAnimatorクリップとAnimationクリップを作成する必要があります。
あなたのアニメーションは特定の時間に、おそらくアニメーションイベントで現在のテクスチャをスワップします。
実際には、スクリプトでそれを行うことが容易であるかもしれない:
// Drag sprites, make sure they are in order (3->2->1->Go)
public Sprite[] sprites;
public SpriteRenderer sp;
int index = 0;
void Start()
{
// Check your sprites and sp
InvokeRepeating("SwapSprite", 1.0f,1.0f); // Start timer to swap each second
sp.sprite = sprites[index]; // Set initial sprite
}
private void SwapSprite()
{
if(++index == sprites.Length) // Increase the index and check we run out of sprites
{
CancelInvoke();
sp.enabled = false; // Remove the counter
this.enabled = false; // That scripts is no more useful (could be destroyed)
return;
}
sp.sprite = sprites[index]; // Set new sprite
}
あなたはユニティでタイマーのための呼び出しを使用します。 – Fattie
4つのサブ画像間を遷移する1つのアニメーションを作成しようとしていますか? – LeftRight92
ねえ、私はそれを考え出した。これは私の愚かさでした。あなたの返信をありがとう、私はあなたのコメントをupvoteします@JoeBlow –