private void swipe (string currentLocation, Vector2 mStartPosition){ GameObject objectHit = MyHelpers.getRaycastedGameObject(new Vector3(mStartPosition.x,mStartPosition.y,1f),Camera.current); if (objectHit != null ) { MyHandClass hand = objectHit.GetComponent<MyHandClass>(); if (hand != null && hand.location.Equals (currentLocation)) { hand.OnSwipe (); } } }
void Update() { #if UNITY_EDITOR if (Input.GetMouseButtonDown(0)) { GameObject objectHit = MyHelpers.getRaycastedGameObject(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 1f), cam); if (objectHit != null) { MyHandClass hand = objectHit.GetComponent <MyHandClass>(); if (hand != null) { hand.OnSwipe(); } } } #endif }