public bool checkForDuplicateCharmGO(CharmGO charmGO) { for (int i = 0; i < charms.Count; i++) { if (charms [i].IsActive) { if (charms [i].parentCharm == charmGO.parentCharm && charms [i] != charmGO) { return(true); } } } return(false); }
public CharmGO getCharmGO() { //check if we have any inactive in the list for (int i = 0; i < charms.Count; i++) { if (charms [i].IsActive == false) { return(charms [i]); } } //otherwise make one GameObject obj = Instantiate(charmPrefab) as GameObject; CharmGO GO = obj.GetComponent <CharmGO> (); charms.Add(GO); return(GO); }