コード例 #1
0
	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 ();
			}
		}
	}
コード例 #2
0
 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
 }