duck

Untitled

Jun 14th, 2010
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4.  
  5. public class MainScript : MonoBehaviour {
  6. public Texture2D[] Cards= new Texture2D[14];
  7. List<Card> cardsInPlay;
  8. List<int> playerCards = new List<int>();
  9. int test;
  10. int test1;
  11. int test2;
  12. int test3;
  13. //public string name;
  14. public List<Card> originalCards;
  15. public List<Card> cardsInHand;
  16.  
  17.  
  18. [System.Serializable]
  19. public class Card
  20. {
  21. public Texture2D image;
  22. public int score;
  23. }
  24.  
  25. void Start (){
  26. cardsInPlay = new List<Card>(originalCards);
  27. Card firstCard = cardsInPlay[Random.Range(0, originalCards.Count)];
  28. cardsInPlay.Remove(firstCard);
  29. cardsInHand.Add(test);
  30. for (int i = 0; i < 13; ++i)
  31. {
  32. playerCards.Add(i);
  33. }
  34. test = playerCards[Random.Range(0,playerCards.Count)];
  35. playerCards.Remove(test);
  36. test1 = playerCards[Random.Range(0,playerCards.Count)];
  37. playerCards.Remove(test1);
  38. test2 = playerCards[Random.Range(0,playerCards.Count)];
  39. playerCards.Remove(test2);
  40. test3= playerCards[Random.Range(0,playerCards.Count)];
  41. playerCards.Remove(test3);
  42. }
  43. void Update (){
  44. }
  45.  
  46. void OnGUI (){
  47. for(int i=0;i<13;i++)
  48. {
  49. GUI.DrawTexture( new Rect(685 + (0.5f*i), 10, 100, 100), Cards[i]);
  50. GUI.DrawTexture( new Rect(685 + (0.5f*i), 10, 100, 100), Cards[13]);
  51. GUI.DrawTexture( new Rect(50 + (35*1), 325, 100, 100), Cards[test]);
  52. GUI.DrawTexture( new Rect(50 + (35*2), 325, 100, 100), Cards[test1]);
  53. GUI.DrawTexture( new Rect(50 + (35*1), 25, 100, 100), Cards[test2]);
  54. GUI.DrawTexture( new Rect(50 + (35*2), 25, 100, 100), Cards[test3]);
  55. }
  56.  
  57. }
  58. }
Add Comment
Please, Sign In to add comment