void Start() { _comboHandler = GameObject.FindGameObjectWithTag(Constants.Tags.GameMaster).GetComponent <ComboHandler>(); _comboHandler.StartCombo(); _leftButtonLook = LeftButton.GetComponent <ButtonLook>(); _rightButtonLook = RightButton.GetComponent <ButtonLook>(); }
public SuperButtons(Texture2D normalButtonTexture, Texture2D HoverButtonTexture, Vector2 position) { this.normalButtonTexture = normalButtonTexture; this.HoverButtonTexture = HoverButtonTexture; whichButtonTexture = normalButtonTexture; buttonPotisiton = position; mouseButtonLook = ButtonLook.normalButton; }
public void Update(ButtonLook thisButtonInFocus) { mouseButtonLook = thisButtonInFocus; if (mouseButtonLook == ButtonLook.lookingButton) { whichButtonTexture = HoverButtonTexture; } else { whichButtonTexture = normalButtonTexture; } }
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); }
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>(); }