void DragButton(Transform hit) { MText_UI_Button button = hit.gameObject.GetComponent <MText_UI_Button>(); if (!InteractWithButton(button)) { return; } button.ButtonBeingPressed(); }
void UnselectButton(Transform hit) { MText_UI_Button button = hit.gameObject.GetComponent <MText_UI_Button>(); if (!InteractWithButton(button)) { return; } button.UnselectButton(); }
void PressButton(Transform hit) { MText_UI_Button button = hit.gameObject.GetComponent <MText_UI_Button>(); if (!InteractWithButton(button)) { return; } button.PressButtonClick(); }
bool InteractWithButton(MText_UI_Button button) { if (!button) { return(false); } if (button.interactable && button.interactableByMouse) { return(true); } return(false); }
void DragEndOnButton(Transform hit, Transform currentTarget) { MText_UI_Button button = hit.gameObject.GetComponent <MText_UI_Button>(); if (!InteractWithButton(button)) { return; } if (currentTarget != hit) { button.selectedVisual = false; } button.PressedButtonClickStopped(); }
void OnEnable() { myTarget = (MText_UI_Button)target; soTarget = new SerializedObject(target); onSelectEvents = soTarget.FindProperty("onSelectEvents"); whileBeingClickedEvents = soTarget.FindProperty("whileBeingClickedEvents"); onUnselectEvents = soTarget.FindProperty("onUnselectEvents"); onClickEvents = soTarget.FindProperty("onClickEvents"); interactable = soTarget.FindProperty("interactable"); interactableByMouse = soTarget.FindProperty("interactableByMouse"); text = soTarget.FindProperty("text"); background = soTarget.FindProperty("background"); useStyles = soTarget.FindProperty("useStyles"); normalFontSize = soTarget.FindProperty("normalFontSize"); normalFontMaterial = soTarget.FindProperty("normalFontMaterial"); normalBackgroundMaterial = soTarget.FindProperty("normalBackgroundMaterial"); applySelectedVisual = soTarget.FindProperty("applySelectedVisual"); selectedFontSize = soTarget.FindProperty("selectedFontSize"); selectedFontMaterial = soTarget.FindProperty("selectedFontMaterial"); selectedBackgroundMaterial = soTarget.FindProperty("selectedBackgroundMaterial"); applyPressedVisual = soTarget.FindProperty("applyPressedVisual"); pressedFontSize = soTarget.FindProperty("pressedFontSize"); pressedFontMaterial = soTarget.FindProperty("pressedFontMaterial"); pressedBackgroundMaterial = soTarget.FindProperty("pressedBackgroundMaterial"); pressedItemReturnToSelectedVisuaAfterDelay = soTarget.FindProperty("pressedItemReturnToSelectedVisuaAfterDelay"); pressedItemReturnToSelectedVisualTime = soTarget.FindProperty("pressedItemReturnToSelectedVisualTime"); disabledFontSize = soTarget.FindProperty("disabledFontSize"); disabledFontMaterial = soTarget.FindProperty("disabledFontMaterial"); disabledBackgroundMaterial = soTarget.FindProperty("disabledBackgroundMaterial"); useModules = soTarget.FindProperty("useModules"); unSelectModuleContainers = soTarget.FindProperty("unSelectModuleContainers"); applyUnSelectModuleContainers = soTarget.FindProperty("applyUnSelectModuleContainers"); onSelectModuleContainers = soTarget.FindProperty("onSelectModuleContainers"); applyOnSelectModuleContainers = soTarget.FindProperty("applyOnSelectModuleContainers"); onPressModuleContainers = soTarget.FindProperty("onPressModuleContainers"); applyOnPressModuleContainers = soTarget.FindProperty("applyOnPressModuleContainers"); onClickModuleContainers = soTarget.FindProperty("onClickModuleContainers"); applyOnClickModuleContainers = soTarget.FindProperty("applyOnClickModuleContainers"); showEvents = myTarget.showEvents; showStyles = myTarget.showStyles; showNormalStyles = myTarget.showNormalStyles; showSelectedStyles = myTarget.showSelectedStyles; showPressedStyles = myTarget.showPressedStyles; showDisabledStyles = myTarget.showDisabledStyles; showModuleSettings = myTarget.showModuleSettings; }