private void ButtonTypeChanged(ButtonSizeType buttonType) { if (buttonType == ButtonSizeType.Small) { btnSmall.Visible = true; btnLarge.Visible = false; btnSmall.ButtonName = txtName.Text; btnSmall.ButtonColor = (Color)(ddlColor.EditValue); if (_hotButtonSettingFinish) { btnSmall.MainHotKey = _mainKey; btnSmall.SubHotKey = _subKey; } if (_useButtonGraphic) { btnSmall.BackgroundImage = _buttonImage; } else { btnSmall.BackgroundImage = null; } _returnButtonControl = btnSmall; } else if (buttonType == ButtonSizeType.Large) { btnSmall.Visible = false; btnLarge.Visible = true; btnLarge.ButtonName = txtName.Text; btnLarge.ButtonColor = (Color)(ddlColor.EditValue); if (_hotButtonSettingFinish) { btnLarge.MainHotKey = _mainKey; btnLarge.SubHotKey = _subKey; } if (_useButtonGraphic) { btnLarge.BackgroundImage = _buttonImage; } else { btnLarge.BackgroundImage = null; } _returnButtonControl = btnLarge; } }
static public GUILayoutOption[] GetButtonStyle(ButtonSizeType pType) { switch (pType) { case ButtonSizeType.Small: return(new GUILayoutOption[] { GUILayout.Width(20) }); case ButtonSizeType.Normal: return(new GUILayoutOption[] { GUILayout.Width(50) }); case ButtonSizeType.Large: return(new GUILayoutOption[] { GUILayout.Width(100) }); default: return(new GUILayoutOption[] { GUILayout.Width(50) }); } }