public void ZeroNode() { node.position = transform.position; m_Axis = Vector2.zero; swipeRegistered = false; swipable = null; }
void CaptureTouch(int touchIndex, Vector2 touchPos) { if (locked) { return; } if (spawnOnTouch) { transform.position = touchPos; transform.localScale = m_InitialScale; RaycastHit hit; RaycastHit2D hit2d; Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (hit2d = Physics2D.Raycast(ray.origin, ray.direction)) { swipable = hit2d.collider.GetComponent <SwipableObject>(); } else if (Physics.Raycast(ray, out hit)) { swipable = hit.collider.GetComponent <SwipableObject>(); } } else { foreach (TouchAxisCtrl touchAxis in touchControllerList) { if (touchAxis.spawnOnTouch && touchAxis != this) { touchAxis.Lock(); } } } m_CapturedTouch = touchIndex; }