예제 #1
0
    private GameObject AddComponentsToCard(GameObject c)
    {
        Rigidbody   rigidBody   = c.AddComponent(typeof(Rigidbody)) as Rigidbody;
        BoxCollider boxCollider = c.AddComponent(typeof(BoxCollider)) as BoxCollider;
        dragabble   d           = c.AddComponent(typeof(dragabble)) as dragabble;

        d.setup();
        return(c);
    }
예제 #2
0
 private void DistributeCards(int num)
 {
     for (int i = 0; i < num; i++)
     {
         int        j    = rand.Next(0, (int)deckInstance.Count);
         GameObject card = deckInstance[j];
         deckInstance.RemoveAt(j);
         playerCards.Add(card);
         card = AddComponentsToCard(card);
         dragabble d = card.GetComponent <dragabble>();
         d.setup();
         d.moveToArea();
     }
 }