Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class GameController : MonoBehaviour {
  6.  
  7. public GameObject card;
  8. private float cardX = -4.0f;
  9. private float cardZ = 0.0f;
  10.  
  11. // Use this for initialization
  12. void Start () {
  13. loadCards();
  14. }
  15.  
  16. void loadCards()
  17. {
  18. Vector3 cardPosition;
  19.  
  20. for(int a = 0; a < 2; a++)
  21. {
  22. for (int b = 0; b < 4; b++)
  23. {
  24. cardPosition = new Vector3(cardX, 0f, cardZ);
  25. Instantiate(card, cardPosition, Quaternion.identity);
  26. cardX += 2.0f;
  27.  
  28. if(b == 3)
  29. {
  30. cardX = -4.0f;
  31. cardZ = 2.5f;
  32. }
  33. }
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement