Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Board.Script.set_BoardSlotGameObjects(); is used to set the GameObjects
- public class Board : MonoBehaviour {
- public static Board Script;
- #region BOARD CARD SLOTS
- // The arrays of Board Objects used to set Active/Inactive on card Selection
- // We hold 2 arrays for each GameObject type:
- // 1 for the Group of children objects, another for the Children in each group
- public GameObject Board_Grouped_Clubs_Bottom; public Transform[] Clubs_Bottom = new Transform[14];
- public GameObject Board_Grouped_Clubs_Top; public Transform[] Clubs_Top = new Transform[14];
- public GameObject Board_Grouped_Spades_Left; public Transform[] Spades_Left = new Transform[14];
- public GameObject Board_Grouped_Spades_Right; public Transform[] Spades_Right = new Transform[14];
- public GameObject Board_Grouped_Diamonds_Left; public Transform[] Diamonds_Left = new Transform[14];
- public GameObject Board_Grouped_Diamonds_Right; public Transform[] Diamonds_Right = new Transform[14];
- public GameObject Board_Grouped_Hearts_Bottom; public Transform[] Hearts_Bottom = new Transform[14];
- public GameObject Board_Grouped_Hearts_Top; public Transform[] Hearts_Top = new Transform[14];
- #endregion
- void Awake()
- {
- Script = this;
- }
- public void set_BoardSlotGameObjects()
- {
- // Get the Groups of each card type Group Object
- Board_Grouped_Clubs_Bottom = GameObject.FindGameObjectWithTag("ClubsBottom");
- Board_Grouped_Clubs_Top = GameObject.FindGameObjectWithTag("ClubsTop");
- Board_Grouped_Spades_Left = GameObject.FindGameObjectWithTag("SpadesLeft");
- Board_Grouped_Spades_Right = GameObject.FindGameObjectWithTag("SpadesRight");
- Board_Grouped_Diamonds_Left = GameObject.FindGameObjectWithTag("DiamondsLeft");
- Board_Grouped_Diamonds_Right = GameObject.FindGameObjectWithTag("DiamondsRight");
- Board_Grouped_Hearts_Bottom = GameObject.FindGameObjectWithTag("HeartsBottom");
- Board_Grouped_Hearts_Top = GameObject.FindGameObjectWithTag("HeartsTop");
- // In these groups, find each child and assign it to its array
- Clubs_Bottom = Board_Grouped_Clubs_Bottom.GetComponentsInChildren<Transform>();
- Clubs_Top = Board_Grouped_Clubs_Top.GetComponentsInChildren<Transform>();
- Spades_Left = Board_Grouped_Spades_Left.GetComponentsInChildren<Transform>();
- Spades_Right = Board_Grouped_Spades_Right.GetComponentsInChildren<Transform>();
- Diamonds_Left = Board_Grouped_Diamonds_Left.GetComponentsInChildren<Transform>();
- Diamonds_Right = Board_Grouped_Diamonds_Right.GetComponentsInChildren<Transform>();
- Hearts_Bottom = Board_Grouped_Hearts_Bottom.GetComponentsInChildren<Transform>();
- Hearts_Top = Board_Grouped_Hearts_Top.GetComponentsInChildren<Transform>();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement