Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class GameController : MonoBehaviour {
- public GameObject card;
- private float cardX = -4.0f;
- private float cardZ = 0.0f;
- // Use this for initialization
- void Start () {
- loadCards();
- }
- void loadCards()
- {
- Vector3 cardPosition;
- for(int a = 0; a < 2; a++)
- {
- for (int b = 0; b < 4; b++)
- {
- cardPosition = new Vector3(cardX, 0f, cardZ);
- Instantiate(card, cardPosition, Quaternion.identity);
- cardX += 2.0f;
- if(b == 3)
- {
- cardX = -4.0f;
- cardZ = 2.5f;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement