Пример #1
0
        public static void SaveLinks(Dictionary <string, List <I3dWorldObject> > links, HashSet <I3dWorldObject> alreadyWrittenObjs, ByamlNodeWriter writer, DictionaryNode objNode, HashSet <string> layers)
        {
            if (links != null)
            {
                DictionaryNode linksNode = writer.CreateDictionaryNode(links);

                foreach (var(linkName, link) in links)
                {
                    if (link.Count == 0)
                    {
                        continue;
                    }

                    ArrayNode linkNode = writer.CreateArrayNode(link);

                    foreach (I3dWorldObject obj in link)
                    {
                        if (!layers.Contains(obj.Layer))
                        {
                            continue;
                        }

                        if (!alreadyWrittenObjs.Contains(obj))
                        {
                            DictionaryNode linkedObjNode = writer.CreateDictionaryNode(obj);
                            obj.Save(alreadyWrittenObjs, writer, linkedObjNode, layers, true);
                            linkNode.AddDictionaryNodeRef(linkedObjNode);
                        }
                        else
                        {
                            linkNode.AddDictionaryRef(obj);
                        }
                    }

                    if (linkNode.Count != 0)
                    {
                        linksNode.AddArrayNodeRef(linkName, linkNode, true);
                    }
                }
                if (linksNode.Count != 0)
                {
                    objNode.AddDictionaryNodeRef("Links", linksNode, true);
                }
                else
                {
                    objNode.AddDynamicValue("Links", new Dictionary <string, dynamic>(), true);
                }
            }
            else
            {
                objNode.AddDynamicValue("Links", new Dictionary <string, dynamic>(), true);
            }
        }
Пример #2
0
        public void Save(ByamlNodeWriter writer, DictionaryNode objNode, int zoneID)
        {
            objNode.AddDynamicValue("Comment", null);
            objNode.AddDynamicValue("Id", "zone" + zoneID);
            objNode.AddDynamicValue("IsLinkDest", false);
            objNode.AddDynamicValue("LayerConfigName", Layer);

            {
                objNode.AddDynamicValue("Links", new Dictionary <string, dynamic>(), true);
            }

            objNode.AddDynamicValue("ModelName", null);
            objNode.AddDynamicValue("Rotate", LevelIO.Vector3ToDict(Rotation), true);
            objNode.AddDynamicValue("Scale", LevelIO.Vector3ToDict(Vector3.One), true);
            objNode.AddDynamicValue("Translate", LevelIO.Vector3ToDict(Position, 100f), true);

            objNode.AddDynamicValue("UnitConfig", new Dictionary <string, dynamic>
            {
                ["DisplayName"]         = "�R�C��(�����O�z�u)",
                ["DisplayRotate"]       = LevelIO.Vector3ToDict(Vector3.Zero),
                ["DisplayScale"]        = LevelIO.Vector3ToDict(Vector3.One),
                ["DisplayTranslate"]    = LevelIO.Vector3ToDict(Vector3.Zero),
                ["GenerateCategory"]    = "",
                ["ParameterConfigName"] = "Zone",
                ["PlacementTargetFile"] = "Map"
            }, true);

            objNode.AddDynamicValue("UnitConfigName", Zone.StageName);
        }