public PopupData(string msg, Action okAction = null, Action cancelAction = null, BUTTON_TYPE type = BUTTON_TYPE.TWO) { Msg = msg; OkAction = okAction; CancelAction = cancelAction; ButtonType = type; }
public override void SetData(PopupBaseData data) { var popupData = data as PopupData; if (popupData == null) { return; } Msg.text = popupData.Msg; OkAction = popupData.OkAction; CancelAction = popupData.CancelAction; ButtonType = popupData.ButtonType; switch (ButtonType) { case BUTTON_TYPE.ONE: OK.gameObject.SetActive(false); Cancel.gameObject.SetActive(false); Big_OK.gameObject.SetActive(true); break; case BUTTON_TYPE.TWO: OK.gameObject.SetActive(true); Cancel.gameObject.SetActive(true); Big_OK.gameObject.SetActive(false); break; default: break; } }
public void BindListener(Button button, Action callback, BUTTON_TYPE type = BUTTON_TYPE.CLICK) { if (button != null) { button.onClick.RemoveAllListeners(); button.onClick.AddListener(delegate { switch (type) { case BUTTON_TYPE.CLICK: //AudioManager.PlayEffect("音效.点击"); break; case BUTTON_TYPE.SWITCH: //AudioManager.PlayEffect("音效.切换界面"); break; default: break; } callback(); }); var nav = Navigation.defaultNavigation; nav.mode = Navigation.Mode.None; button.navigation = nav; } }
// Property #region Property #endregion // MonoBehaviour #region MonoBehaviour #endregion // Private Method #region Private Method #endregion // Public Method #region Public Method public void OnClick(BUTTON_TYPE eType) { //System Manager한태 enum값을 전달하는경우 //여기서 바로 처리하는 경우 switch (eType) { case BUTTON_TYPE.START: Application.LoadLevel((string)"MainScene"); break; } }
public void applyButton(BUTTON_TYPE t) { switch (t) { case BUTTON_TYPE.Plus: type = enemy.TYPE.Addition; break; case BUTTON_TYPE.Minus: type = enemy.TYPE.Subtraction; break; case BUTTON_TYPE.Multiply: type = enemy.TYPE.Multiplication; break; case BUTTON_TYPE.Division: type = enemy.TYPE.Division; break; } gameObject.GetComponent <SpriteRenderer>().sprite = towerSprites[(int)type]; towerClicked(); }
public void ChangeSlime(BUTTON_TYPE type) { EndDieAnimation(); ResetIdleAnimation(); _nowSelectedSlime.transform.rotation = _originRotation; _nowSelectedSlime.SetActive(false); _slimeNames [_slimeIndex].SetActive(false); _nowSlimeType = SlimeType.TYPE_A; _colorIndex = 0; if (type == BUTTON_TYPE.NEXT) { _slimeIndex = (_slimeIndex + 1) % SLIME_COUNT; } else if (type == BUTTON_TYPE.PREV) { _slimeIndex = (_slimeIndex == 0) ? SLIME_COUNT - 1 : (_slimeIndex - 1) % SLIME_COUNT; } CheckSlime(); }
/* * Given the button type enum, this button will be enabled */ public static void EnableButton(BUTTON_TYPE buttontype) { buttonsDict[buttontype].enabled = true; buttonsDict[buttontype].interactable = true; buttonsDict[buttontype].gameObject.SetActive(true); }
/* * Given the button type enum, this button will be disabled and become shadowed */ public static void DisableButton(BUTTON_TYPE buttontype) { buttonsDict[buttontype].enabled = false; buttonsDict[buttontype].interactable = false; buttonsDict[buttontype].gameObject.SetActive(false); }