Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.86 KB | None | 0 0
  1. Board.Script.set_BoardSlotGameObjects(); is used to set the GameObjects
  2.  
  3. public class Board : MonoBehaviour {
  4.  
  5.     public static Board Script;
  6.  
  7.     #region BOARD CARD SLOTS
  8.     // The arrays of Board Objects used to set Active/Inactive on card Selection
  9.     // We hold 2 arrays for each GameObject type:
  10.     // 1 for the Group of children objects, another for the Children in each group
  11.     public GameObject Board_Grouped_Clubs_Bottom;      public Transform[] Clubs_Bottom = new Transform[14];
  12.     public GameObject Board_Grouped_Clubs_Top;         public Transform[] Clubs_Top = new Transform[14];
  13.     public GameObject Board_Grouped_Spades_Left;       public Transform[] Spades_Left = new Transform[14];
  14.     public GameObject Board_Grouped_Spades_Right;      public Transform[] Spades_Right = new Transform[14];
  15.     public GameObject Board_Grouped_Diamonds_Left;     public Transform[] Diamonds_Left = new Transform[14];
  16.     public GameObject Board_Grouped_Diamonds_Right;    public Transform[] Diamonds_Right = new Transform[14];
  17.     public GameObject Board_Grouped_Hearts_Bottom;     public Transform[] Hearts_Bottom = new Transform[14];
  18.     public GameObject Board_Grouped_Hearts_Top;        public Transform[] Hearts_Top = new Transform[14];
  19.     #endregion
  20.  
  21.     void Awake()
  22.     {
  23.         Script = this;
  24.     }
  25.  
  26. public void set_BoardSlotGameObjects()
  27.     {
  28.         // Get the Groups of each card type Group Object
  29.         Board_Grouped_Clubs_Bottom = GameObject.FindGameObjectWithTag("ClubsBottom");
  30.         Board_Grouped_Clubs_Top = GameObject.FindGameObjectWithTag("ClubsTop");
  31.         Board_Grouped_Spades_Left = GameObject.FindGameObjectWithTag("SpadesLeft");
  32.         Board_Grouped_Spades_Right = GameObject.FindGameObjectWithTag("SpadesRight");
  33.         Board_Grouped_Diamonds_Left = GameObject.FindGameObjectWithTag("DiamondsLeft");
  34.         Board_Grouped_Diamonds_Right = GameObject.FindGameObjectWithTag("DiamondsRight");
  35.         Board_Grouped_Hearts_Bottom = GameObject.FindGameObjectWithTag("HeartsBottom");
  36.         Board_Grouped_Hearts_Top = GameObject.FindGameObjectWithTag("HeartsTop");
  37.  
  38.         // In these groups, find each child and assign it to its array
  39.         Clubs_Bottom = Board_Grouped_Clubs_Bottom.GetComponentsInChildren<Transform>();
  40.         Clubs_Top = Board_Grouped_Clubs_Top.GetComponentsInChildren<Transform>();
  41.         Spades_Left = Board_Grouped_Spades_Left.GetComponentsInChildren<Transform>();
  42.         Spades_Right = Board_Grouped_Spades_Right.GetComponentsInChildren<Transform>();
  43.         Diamonds_Left = Board_Grouped_Diamonds_Left.GetComponentsInChildren<Transform>();
  44.         Diamonds_Right = Board_Grouped_Diamonds_Right.GetComponentsInChildren<Transform>();
  45.         Hearts_Bottom = Board_Grouped_Hearts_Bottom.GetComponentsInChildren<Transform>();
  46.         Hearts_Top = Board_Grouped_Hearts_Top.GetComponentsInChildren<Transform>();
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement