public UIButton(string label, Rectangle frame, UIButtonStyleSet styles, OnPressDelegate onPress) { this.label = label; this.frame = frame; this.styles = styles; this.onPress = onPress; }
public UIButton(string label, Rectangle frame, UIButtonStyle styles, OnPressDelegate onPress) { this.label = label; this.frame = frame; this.styles = styles; this.onPress = onPress; }
public UIButton(string label, Rectangle frame, UIButtonStyle styles, OnPressDelegate onPress, List <OnPressDelegate> onPressActions = null) { this.label = label; this.frame = frame; this.styles = styles; this.onPress = onPress; this.onPressActions = onPressActions; }
/// <summary> /// Tries to create hotkey. This will return null if something goes wrong. /// </summary> /// <param name="input">The input.</param> /// <param name="function">The function.</param> /// <returns></returns> public static HotkeyPress TryCreateHotkey(string input, OnPressDelegate function) { VirtualKeys[] vk; if (HotkeyBase.TryParse(input, out vk) && vk != null && vk.Length != 0) { return(new HotkeyPress(function, vk)); } return(null); }
/// <summary> /// Initializes this instance /// </summary> /// <param name="onPress">On press.</param> public void Initialize(OnPressDelegate onPress) { m_onPress = onPress; InitializeInput(); InitializeMovement(); // Use the unpressed sprite if (m_unpressedSprite != null) { m_spriteRenderer.sprite = m_unpressedSprite; } // Ensure that the instance is upright transform.SetScaleY(Mathf.Abs(transform.localScale.y)); }
/// <summary> /// 添加按下事件 /// </summary> public void AddOnPressEvent(GameObject go, OnPressDelegate onPressFunc) { if (go == null) { return; } if (m_dicOnPressDelegate.ContainsKey(go)) { m_dicOnPressDelegate[go] = onPressFunc; } else { m_dicOnPressDelegate.Add(go, onPressFunc); } }
/// <summary> /// Initializes a new instance of the <see cref="HotkeyPress"/> class. /// </summary> /// <param name="function">The function.</param> /// <param name="keys">The keys.</param> public HotkeyPress(OnPressDelegate function, params VirtualKeys[] keys) : base(keys) { this.Function = function; }
public void SetPressCallBack(OnPressDelegate pressDelegate) { base.PressBtnCallBack = pressDelegate; }
/// <summary> /// Sets the press delegate. /// </summary> /// <param name="onPress">On press.</param> public void SetPressDelegate(OnPressDelegate onPress) { m_onPress = onPress; }
/// <summary> /// Initializes this instance /// </summary> /// <param name="onPress">On press.</param> public void Initialize(OnPressDelegate onPress) { m_onPress = onPress; InitializeInput(); }
public UIBuyButton(string label, int price, Rectangle frame, UIButtonStyle style, OnPressDelegate onPress) : base(label, frame, style, onPress) { this.baseLabel = label; this.price = price; }
public UIRadioButton(string label, T value, UIRadioButtonGroup <T> group, Rectangle frame, UIButtonStyle styles, UIButtonAppearance activeAppearance, OnPressDelegate onPress) : base(label, frame, styles, onPress) { this.group = group; this.value = value; this.activeAppearance = activeAppearance; }