示例#1
0
 IEnumerator CastCard()
 {
     waitingForAction = true;
     while (waitingForAction)
     {
         if (Input.GetMouseButton(0))
         {
             //Activate card at location
             Effects.ActivateCardEffect(Effects, transform.position);
             DiscardCard();
         }
         if (Input.GetMouseButton(1))
         {
             //Cancel Card action - return to hand
             Debug.Log("Right Click Detected!");
             waitingForAction = false;
             GameObject.Find("PlayerHand").GetComponent <PlayerHand> ().reorganiseHand = true;
         }
         Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         transform.position = ray.origin;
         yield return(new WaitForEndOfFrame());
     }
 }