void OnPress(GuiEventReceiver rcv, GuiTouchEventArg args) { if (args.State) { OnDrag(rcv, args); } }
void OnPress(GuiEventReceiver receiver, GuiTouchEventArg args) { if (!args.State) { ScrollView.Validate(); } }
static void OnDrawRootGizmo(GuiEventReceiver receiver, GizmoType gizmoType) { if (receiver.enabled) { var tr = receiver.transform; var oldColor = Gizmos.color; Gizmos.color = (gizmoType & GizmoType.InSelectionHierarchy) != 0 ? Color.green : new Color (0f, 0.5f, 0f); var oldMat = Gizmos.matrix; Gizmos.matrix = Matrix4x4.TRS (tr.position, tr.rotation, tr.lossyScale); Gizmos.DrawWireCube (Vector3.zero, new Vector3 (receiver.Width, receiver.Height)); Gizmos.matrix = oldMat; Gizmos.color = oldColor; } }
static void OnDrawRootGizmo(GuiEventReceiver receiver, GizmoType gizmoType) { if (receiver.enabled) { var tr = receiver.transform; var oldColor = Gizmos.color; Gizmos.color = (gizmoType & GizmoType.InSelectionHierarchy) != 0 ? Color.green : new Color(0f, 0.5f, 0f); var oldMat = Gizmos.matrix; Gizmos.matrix = Matrix4x4.TRS(tr.position, tr.rotation, tr.lossyScale); Gizmos.DrawWireCube(Vector3.zero, new Vector3(receiver.Width, receiver.Height)); Gizmos.matrix = oldMat; Gizmos.color = oldColor; } }
void OnDrag(GuiEventReceiver rcv, GuiTouchEventArg args) { var offset = _background.transform.InverseTransformPoint(args.WorldPosition).x / (float)_background.Width; Value = Mathf.Clamp(offset, -0.5f, 0.5f) + 0.5f; }
void OnEnable() { _receiver = GetComponent <GuiEventReceiver> (); Validate(); }
void OnDrag(GuiEventReceiver receiver, GuiTouchEventArg args) { ScrollView.ScrollRelative(args.Delta); }
void Awake() { _eventReceiver = GetComponent <GuiEventReceiver> (); }
void OnBtnPressed(GuiEventReceiver sender, GuiTouchEventArg tea) { TweeningScale.Begin(gameObject, tea.State ? Vector3.one : ScaleOnPress, tea.State ? ScaleOnPress : Vector3.one, TweenTime); UpdateAttachedWidgets(tea.State ? ActiveColor : (enabled ? EnableColor : DisableColor), TweenTime); }