how i can use the same UI button to play animation1 and if y press immediately the same button can activethe animation2? like a combo

I am using a UI button and i have 2 values onclick but i dont know how active one for one.

@darkbatu21 bool isAnimation1Played = false; public void OnClickMethod() { if(!isAnimation1Played) { PlayAnimation1(); isAnimation1Played = true; } else { PlayAnimation2(); isAnimation1Played = false; } }

1 Answer

1

@darkbatu21

bool isAnimation1Played = false;
    
    public void OnClickMethod()
    {
        if(!isAnimation1Played)
        {
            PlayAnimation1();
            isAnimation1Played = true;
        }
        else
        { 
             PlayAnimation2();
             isAnimation1Played = false;
        }
    
    }

ty so much i am not really think very well and now i can see its very simple and now just i need put a time to refresh the hits ty so much!

Edited so the actual Answer was accepted.