示例#1
0
        private static MapLayoutResource _LoadLayout(int id)
        {
            var pathFormat = "Map/m{0}/m{0}.blend";
            var scene      = BlenderScene.FromFile(String.Format(pathFormat, id));

            return(MapLayoutResource.FromScene("parts", scene));
        }
示例#2
0
 /// <summary>
 /// append map parts to layout list
 /// </summary>
 /// <param name="res"></param>
 /// <param name="offset"></param>
 /// <param name="targetList"></param>
 private static void _AppendParts(MapLayoutResource res, Matrix offset, List <LayoutInfo> targetList)
 {
     foreach (var entry in res.Entries)
     {
         targetList.Add(new LayoutInfo()
         {
             ModelId = entry.ModelId,
             Layout  = entry.Layout * offset
         });
     }
 }
示例#3
0
        public static MapLayoutResource FromScene(String uid, BlenderScene scene)
        {
            var res = new MapLayoutResource(uid);

            foreach (var n in scene.LinkList)
            {
                var match   = _ModelIdRegex.Match(n.TargetFileName);
                int modelId = int.Parse(match.Groups[1].Value);
                res.m_entryList.Add(new Entry()
                {
                    ModelId = modelId, Layout = n.Layout
                });
            }

            return(res);
        }