private FeatureSlot findSlot(float t) { if (items == null || items.Length <= 0) { return(null); } FeatureSlot activeSlot = null; foreach (var se in items) { if (t >= se.from && t <= se.to && se.text != "") { activeSlot = se; } } return(activeSlot); }
protected void collectSlots(GameObject obj) { WeaponSlot weaponSlot = obj.GetComponent <WeaponSlot>(); FeatureSlot featureSlot = obj.GetComponent <FeatureSlot>(); if (weaponSlot != null) { m_WeaponSlots.Add(weaponSlot); } if (featureSlot != null) { m_FeatureSlots.Add(featureSlot); } for (int i = 0; i < obj.transform.childCount; ++i) { collectSlots(obj.transform.GetChild(i).gameObject); } }