Esempio n. 1
0
        public void OnPointerUp(PointerEventData eventData)
        {
            joystick.localPosition = originalPosition;
            thumb.localPosition    = originalThumbPosition;

            speedChange = true;
            speedScale  = new DecimalVector3();

            InputTouch.LOCK_TOUCH = false;
        }
Esempio n. 2
0
        public void OnDrag(PointerEventData eventData)
        {
            Vector2 position = RectTransformUtility.WorldToScreenPoint(cam, joystick.position);
            Vector2 radius   = joystick.sizeDelta / 2;

            input = (eventData.position - position) / (radius * canvas.scaleFactor);

            HandleInput(input.magnitude, input.normalized, radius, cam);
            thumb.anchoredPosition = input * radius * handleRange;

            Vector2 pos = thumb.localPosition;
            Vector2 tmp = (pos - originalThumbPosition).normalized;

            DecimalVector3 curScale = new DecimalVector3(new decimal(tmp.x), 0, new decimal(tmp.y));

            speedChange = curScale != speedScale;
            if (speedChange)
            {
                speedScale = curScale;
            }
        }
Esempio n. 3
0
 public EventInteractionTick(TYPE t, DecimalVector3 dv)
 {
     T  = t;
     DV = dv;
 }
Esempio n. 4
0
        public int tag;             //NOTE: 单位tag

        public EventLogicTick()
        {
            v3        = new DecimalVector3();
            actionTag = 0;
            tag       = (1 << 13) ^ (1 << 9) ^ (1 << 5); //NOTE: 主角的tag
        }
Esempio n. 5
0
 public void DoMove(WarPb.Move move)
 {
     DV = new DecimalVector3(move.Speed);
 }