public void OnPointerUp(PointerEventData eventData) { joystick.localPosition = originalPosition; thumb.localPosition = originalThumbPosition; speedChange = true; speedScale = new DecimalVector3(); InputTouch.LOCK_TOUCH = false; }
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; } }
public EventInteractionTick(TYPE t, DecimalVector3 dv) { T = t; DV = dv; }
public int tag; //NOTE: 单位tag public EventLogicTick() { v3 = new DecimalVector3(); actionTag = 0; tag = (1 << 13) ^ (1 << 9) ^ (1 << 5); //NOTE: 主角的tag }
public void DoMove(WarPb.Move move) { DV = new DecimalVector3(move.Speed); }