Implemented dice rolling.
This commit is contained in:
parent
4bd34a1335
commit
2b08dc425f
15 changed files with 1419 additions and 4 deletions
18
PuzzleGameProject/Assets/Scripts/Helper.cs
Normal file
18
PuzzleGameProject/Assets/Scripts/Helper.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public static class Helper
|
||||
{
|
||||
public static GameObject[] GetTaggedChildren(GameObject parent, string tag) {
|
||||
List<GameObject> childrenWithTag = new List<GameObject>();
|
||||
foreach (Transform child in parent.transform)
|
||||
{
|
||||
if (child.CompareTag(tag))
|
||||
{
|
||||
childrenWithTag.Add(child.gameObject);
|
||||
}
|
||||
}
|
||||
return childrenWithTag.ToArray();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue