public void Init(Touch touch) { this.fingerID = touch.fingerId; this.stateTime = touch.deltaTime; this.totalTime = touch.deltaTime; this.pos = touch.position; this.deltaPos = touch.deltaPosition; this.totalVec = touch.deltaPosition; this.state = TouchStateUtil.PhaseToState(touch.phase); }
public void Update(Touch touch) { this.stateTime += touch.deltaTime; this.pos = touch.position; this.deltaPos = touch.deltaPosition; this.totalVec += this.DeltaPos; this.totalTime += touch.deltaTime; TouchState state = TouchStateUtil.PhaseToState(touch.phase); if (this.state != state) { this.state = state; this.stateTime = touch.deltaTime; } }