Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using System.Collections.Generic;
- public class MainScript : MonoBehaviour {
- public Texture2D[] Cards= new Texture2D[14];
- List<Card> cardsInPlay;
- List<int> playerCards = new List<int>();
- int test;
- int test1;
- int test2;
- int test3;
- //public string name;
- public List<Card> originalCards;
- public List<Card> cardsInHand;
- [System.Serializable]
- public class Card
- {
- public Texture2D image;
- public int score;
- }
- void Start (){
- cardsInPlay = new List<Card>(originalCards);
- Card firstCard = cardsInPlay[Random.Range(0, originalCards.Count)];
- cardsInPlay.Remove(firstCard);
- cardsInHand.Add(test);
- for (int i = 0; i < 13; ++i)
- {
- playerCards.Add(i);
- }
- test = playerCards[Random.Range(0,playerCards.Count)];
- playerCards.Remove(test);
- test1 = playerCards[Random.Range(0,playerCards.Count)];
- playerCards.Remove(test1);
- test2 = playerCards[Random.Range(0,playerCards.Count)];
- playerCards.Remove(test2);
- test3= playerCards[Random.Range(0,playerCards.Count)];
- playerCards.Remove(test3);
- }
- void Update (){
- }
- void OnGUI (){
- for(int i=0;i<13;i++)
- {
- GUI.DrawTexture( new Rect(685 + (0.5f*i), 10, 100, 100), Cards[i]);
- GUI.DrawTexture( new Rect(685 + (0.5f*i), 10, 100, 100), Cards[13]);
- GUI.DrawTexture( new Rect(50 + (35*1), 325, 100, 100), Cards[test]);
- GUI.DrawTexture( new Rect(50 + (35*2), 325, 100, 100), Cards[test1]);
- GUI.DrawTexture( new Rect(50 + (35*1), 25, 100, 100), Cards[test2]);
- GUI.DrawTexture( new Rect(50 + (35*2), 25, 100, 100), Cards[test3]);
- }
- }
- }
Add Comment
Please, Sign In to add comment