Unity动画UI按钮



此代码我在UI按钮上使用它用于更改动画(向上,向下)以获取平台,但是当我单击UP开始并仍在工作时,我再次单击DOSCON,但它再次开始工作切割动画。如何将其定义为白色动画并开始降低?

public Animator anim;
private bool move1;
void Start () {
    anim = GetComponent<Animator> ();
}
// Update is called once per frame
public void ChangePlatform () {
    if (move1==true) {
        anim.SetInteger ("animstate",1);
        move1 = false;
    }else if (move1==false) {
        anim.SetInteger ("animstate",2);
        move1 = true;
    }

我不理解您的问题中的所有内容,但我认为您正在寻找过渡的退出时间。

如果启用了"已退出时间",则此值表示过渡实施的确切时间

尝试将值设置为1,以便只有在当前状态完成时才能发生过渡。如果将值设置为0,则过渡可以随时"中断"当前状态。

最新更新