public static Resources.IResource Get(string name) { InternalData data; if (iManagedInternals.TryGetValue(name, out data)) { return(new Resources.ResourceCollection(data.Textures.Select(tex => TextureManager.GetOrThrow(tex)))); } else { return(null); } }
/// <summary> /// Get resource incl subs or null if unknown /// </summary> public static Resources.IResource Get(AvailablePart part, bool withInterior) { PartData data; if (iManagedParts.TryGetValue(part.name, out data)) { if (withInterior) { return(new Resources.ResourceCollection( data.Textures.Select(tex => TextureManager.GetOrThrow(tex)).Union( data.Internals.Select(intern => InternalManager.GetOrThrow(intern)) ))); } else { return(new Resources.ResourceCollection(data.Textures.Select(tex => TextureManager.GetOrThrow(tex)))); } } else { return(null); } }