I am making a menu without any GUIs cause GUIs SUCK. Just kidding, I find it easier and a little cooler to do it all with pictures. I have a button to the side that scrolls out when you click it. It has an idle animation attached and in the controller I added another animation with a bool requirement, so that way it doesnt play until the script tells it to. Here is the script…
#pragma strict
function OnMouseOver(){
if(Input.GetMouseButtonDown(0)){
var myAnimator: Animator= GetComponent(Animator);
myAnimator.SetBool("open",true);
}
}
It works great, except that I have no idea how to close the menu once it’s open. Is there a way to make the script recognize that the button has been pressed twice? I thought about that… if the script could do that and make a counter, then it would stop playing any animations after it counts to two. See my problem? So how can I get the menu to open and close? Thanks.
Edit: I was going to add a close button, but the menu is a parent of the open button and has the animations on it. So I couldn’t do that to my knowledge. I’ll attach a photo, in case there is any confusion.
The “Alpha Tools” button is what I’m working with.