public IComponentBroker[] GetComponentsInChildren(string componentTypeName, bool includeInactive) { Type type = SceneBroker.LookupType(componentTypeName); Component[] comps = m_gameObject.GetComponentsInChildren(type, includeInactive); if (comps == null) { return(null); } return(comps.Select(co => new ComponentBroker(co)).ToArray()); }
public IComponentBroker AddComponent(string componentTypeName) { Type type = SceneBroker.LookupType(componentTypeName); var comp = m_gameObject.AddComponent(type) as Component; if (comp == null) { return(null); } return(new ComponentBroker(comp)); }
public IComponentBroker GetComponentInChildren(string componentTypeName) { Type type = SceneBroker.LookupType(componentTypeName); var comp = m_gameObject.GetComponentInChildren(type); if (comp == null) { // NOTE: We NEVER return a null ComponentBroker here because we need to keep it consistent // with the Overload Editor version return(new ComponentBroker(null)); } return(new ComponentBroker(comp)); }