private static void ProcessKeyEvent(BrushOptionPanel panel, UnityEngine.EventType eventType, KeyCode keyCode, EventModifiers modifiers) { if (eventType != UnityEngine.EventType.KeyDown) { return; } var mBrushSizeSlider = Util.GetPrivate <UISlider>(panel, "m_BrushSizeSlider"); var sizeInterval = GetSliderValue(mBrushSizeSlider) < 50f ? 1f : 50f; if (Util.GetPrivate <SavedInputKey>(panel, "m_IncreaseBrushSize").IsPressed(eventType, keyCode, modifiers)) { SetSliderValue(mBrushSizeSlider, GetSliderValue(mBrushSizeSlider) + sizeInterval); } else if (Util.GetPrivate <SavedInputKey>(panel, "m_DecreaseBrushSize").IsPressed(eventType, keyCode, modifiers)) { SetSliderValue(mBrushSizeSlider, GetSliderValue(mBrushSizeSlider) - sizeInterval); } else { var mBrushStrengthSlider = Util.GetPrivate <UISlider>(panel, "m_BrushStrengthSlider"); var strengthInterval = 0.1f; if (Util.GetPrivate <SavedInputKey>(panel, "m_IncreaseBrushStrength").IsPressed(eventType, keyCode, modifiers)) { mBrushStrengthSlider.value = mBrushStrengthSlider.value + strengthInterval; } else { if (!Util.GetPrivate <SavedInputKey>(panel, "m_DecreaseBrushStrength").IsPressed(eventType, keyCode, modifiers)) { return; } mBrushStrengthSlider.value = mBrushStrengthSlider.value - strengthInterval; } } }
static void Event_type(JSVCall vc) { if (vc.bGet) { UnityEngine.Event _this = (UnityEngine.Event)vc.csObj; var result = _this.type; JSApi.setEnum((int)JSApi.SetType.Rval, (int)result); } else { UnityEngine.EventType arg0 = (UnityEngine.EventType)JSApi.getEnum((int)JSApi.GetType.Arg); UnityEngine.Event _this = (UnityEngine.Event)vc.csObj; _this.type = arg0; } }
static public int GetTypeForControl(IntPtr l) { try{ UnityEngine.Event self = (UnityEngine.Event)checkSelf(l); System.Int32 a1; checkType(l, 2, out a1); UnityEngine.EventType ret = self.GetTypeForControl(a1); pushEnum(l, (int)ret); return(1); } catch (Exception e) { LuaDLL.luaL_error(l, e.ToString()); return(0); } }
/// <summary>A convenience method which looks out for mousedown/mouseup events and runs them as Click() and Release(). /// You'd use this from an OnGUI method.</summary> /// <param name='current'>An optional event - usually just Event.current.</param> /// <returns>True if it did something with the event.</returns> public virtual bool HandleEvent(UnityEngine.Event current) { UnityEngine.EventType type = current.type; // Look out for mouse events: if (type == UnityEngine.EventType.MouseUp) { // Release it: SetPressure(current.button, 0f); } else if (type == UnityEngine.EventType.MouseDown) { // Press it down: SetPressure(current.button, 1f); } else { return(false); } return(true); }