示例#1
0
        public static bool UpdateModels(this Map map, Document document)
        {
            if (Sledge.Settings.View.DisableModelRendering) return false;

            var cache = document.GetMemory<Dictionary<string, ModelReference>>("ModelCache");
            if (cache == null)
            {
                cache = new Dictionary<string, ModelReference>();
                document.SetMemory("ModelCache", cache);
            }

            return UpdateModels(document, map.WorldSpawn, cache);
        }
示例#2
0
        public static bool UpdateModels(this Map map, Document document, IEnumerable<MapObject> objects)
        {
            if (Sledge.Settings.View.DisableModelRendering) return false;

            var cache = document.GetMemory<Dictionary<string, ModelReference>>("ModelCache");
            if (cache == null)
            {
                cache = new Dictionary<string, ModelReference>();
                document.SetMemory("ModelCache", cache);
            }

            var updated = false;
            foreach (var mo in objects) updated |= UpdateModels(document, mo, cache);
            return updated;
        }