示例#1
0
 void Start()
 {
     _comboHandler = GameObject.FindGameObjectWithTag(Constants.Tags.GameMaster).GetComponent <ComboHandler>();
     _comboHandler.StartCombo();
     _leftButtonLook  = LeftButton.GetComponent <ButtonLook>();
     _rightButtonLook = RightButton.GetComponent <ButtonLook>();
 }
示例#2
0
 public SuperButtons(Texture2D normalButtonTexture, Texture2D HoverButtonTexture, Vector2 position)
 {
     this.normalButtonTexture = normalButtonTexture;
     this.HoverButtonTexture  = HoverButtonTexture;
     whichButtonTexture       = normalButtonTexture;
     buttonPotisiton          = position;
     mouseButtonLook          = ButtonLook.normalButton;
 }
示例#3
0
        public void Update(ButtonLook thisButtonInFocus)
        {
            mouseButtonLook = thisButtonInFocus;

            if (mouseButtonLook == ButtonLook.lookingButton)
            {
                whichButtonTexture = HoverButtonTexture;
            }

            else
            {
                whichButtonTexture = normalButtonTexture;
            }
        }
示例#4
0
        public ButtonLook MouseOnButton()
        {
            nowMousestate   = Mouse.GetState();
            mouseButtonLook = ButtonLook.normalButton;

            if (MouseHitbox.Intersects(ButtonHitbox))
            {
                mouseButtonLook = ButtonLook.lookingButton;

                if (mouseButtonLook == ButtonLook.lookingButton && nowMousestate.LeftButton == ButtonState.Pressed)
                {
                    return(ButtonLook.clickingButton);
                }
                lastmousestate = nowMousestate;
                return(ButtonLook.lookingButton);
            }
            lastmousestate = nowMousestate;
            return(ButtonLook.normalButton);
        }
示例#5
0
        public ButtonLook MouseOnButton()
        {
            nowMousestate   = Mouse.GetState();
            mouseButtonLook = ButtonLook.normalButton;

            if (MouseHitbox.Intersects(ButtonHitbox))
            {
                mouseButtonLook = ButtonLook.lookingButton;

                if (mouseButtonLook == ButtonLook.lookingButton && nowMousestate.LeftButton == ButtonState.Pressed)
                {
                    lastMousestate   = nowMousestate;
                    wasButtomPressed = true;
                    return(ButtonLook.clickingButton);
                }

                if (wasButtomPressed == true && lastMousestate.LeftButton == ButtonState.Released)
                {
                    lastMousestate   = nowMousestate;
                    wasButtomPressed = false;
                    return(ButtonLook.releasedButton);
                }

                else
                {
                    lastMousestate = nowMousestate;
                    return(ButtonLook.lookingButton);
                }
            }

            else
            {
                lastMousestate = nowMousestate;
                return(ButtonLook.normalButton);
            }
        }
 void Start()
 {
     _comboHandler = GameObject.FindGameObjectWithTag(Constants.Tags.GameMaster).GetComponent<ComboHandler>();
     _comboHandler.StartCombo ();
     _leftButtonLook = LeftButton.GetComponent<ButtonLook>();
     _rightButtonLook = RightButton.GetComponent<ButtonLook>();
 }