public static Component AddComponent(GameObject go, string sourceInfo, string name) { Debug.LogWarningFormat("Performing a potentially slow search for component {0}.", (object)name); System.Type componentType = APIUpdaterRuntimeServices.ResolveType(name, Assembly.GetCallingAssembly(), sourceInfo); if (componentType == null) { return((Component)null); } return(go.AddComponent(componentType)); }
public static Component AddComponent(GameObject go, string sourceInfo, string name) { Debug.LogWarningFormat("Performing a potentially slow search for component {0}.", new object[] { name }); Type type = APIUpdaterRuntimeServices.ResolveType(name, Assembly.GetCallingAssembly(), sourceInfo); return((type != null) ? go.AddComponent(type) : null); }