// Start is called before the first frame update void Start() { text = this.gameObject.GetComponent <TextMeshProUGUI>(); TouchInputManager touchInputManager = TouchInputManager.getInstance(); touchInputManager.SubscribeSwipeListener(this, 0); touchInputManager.SubscribeTapListener(this, 0); touchInputManager.SubscribeDragListener(this, 0); }
public void ToggleMovement(bool toggle) { if (toggle) { canMove = true; //touchInputManager.SubscribeTapListener(this, touchToFollow); touchInputManager.SubscribeDragListener(this, touchToFollow); } else { canMove = false; //touchInputManager.UnsubscribeTapListener(this, touchToFollow); touchInputManager.UnsubscribeDragListener(this, touchToFollow); if (tap) { TapEnded(); } if (drag) { DragEnded(null, null); } } }