コード例 #1
0
 void OnPress(GuiEventReceiver rcv, GuiTouchEventArg args)
 {
     if (args.State)
     {
         OnDrag(rcv, args);
     }
 }
コード例 #2
0
 void OnPress(GuiEventReceiver receiver, GuiTouchEventArg args)
 {
     if (!args.State)
     {
         ScrollView.Validate();
     }
 }
コード例 #3
0
 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;
     }
 }
コード例 #4
0
 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;
     }
 }
コード例 #5
0
        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;
        }
コード例 #6
0
 void OnEnable()
 {
     _receiver = GetComponent <GuiEventReceiver> ();
     Validate();
 }
コード例 #7
0
 void OnDrag(GuiEventReceiver receiver, GuiTouchEventArg args)
 {
     ScrollView.ScrollRelative(args.Delta);
 }
コード例 #8
0
 void Awake()
 {
     _eventReceiver = GetComponent <GuiEventReceiver> ();
 }
コード例 #9
0
 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);
 }