Пример #1
0
        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);
            }
        }
Пример #2
0
        /// <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);
            }
        }