Version: 2020.3
언어: 한국어
public void Stop ();

설명

Stops all playing animations that were started with this Animation.

Stopping an animation also Rewinds it to the Start.

using UnityEngine;

public class ExampleScript : MonoBehaviour { Animation anim;

void Start() { anim = GetComponent<Animation>(); }

void Update() { if (Input.GetButtonDown("Jump") &amp;&amp; anim.isPlaying) { anim.Stop(); } } }

public void Stop (string name);

설명

Stops an animation named name.

Stopping an animation also Rewinds it to the Start.

using UnityEngine;

public class ExampleScript : MonoBehaviour { Animation anim;

void Start() { anim = GetComponent<Animation>(); }

void Update() { if (Input.GetButtonDown("Jump") &amp;&amp; anim.isPlaying) { anim.Stop("CubeJump"); } } }