// *************************** score public int CheckDebrisForScore(Debris.Kind targetDebrisKind) { int matchCount = 0; foreach (Transform trans in debrisTrunk) { if (trans.gameObject.activeSelf == false) { break; } if (trans.gameObject.CompareTag(GameTag.TAG_PLAYER_KID)) { Debris d = trans.gameObject.GetComponent <Debris>(); if (d) { if (d.kind == targetDebrisKind) { matchCount++; } } } } return(matchCount); }
private GameObject GetPrefabByDebrisKind(Debris.Kind kind) { foreach(GameObject go in prefabs) { Debris debris = go.GetComponent<Debris>(); if(debris != null) { if(debris.kind == kind) { return go; } } } return null; }