コード例 #1
0
ファイル: ModelExtensions.cs プロジェクト: silky/sledge
        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
ファイル: ModelExtensions.cs プロジェクト: silky/sledge
        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;
        }