示例#1
0
        public SerialisedObject ToSerialisedObject()
        {
            var so = new SerialisedObject("ObjectColor");

            so.SetColor("Color", Color);
            return(so);
        }
示例#2
0
        public SerialisedObject ToSerialisedObject()
        {
            var v = new SerialisedObject("visgroup");

            v.Set("ID", ID);
            v.Set("Name", Name);
            v.Set("Visible", Visible);
            v.SetColor("Colour", Colour);
            return(v);
        }
示例#3
0
 private void SaveVisgroups(IEnumerable <Visgroup> visgroups, SerialisedObject parent)
 {
     foreach (var visgroup in visgroups)
     {
         var vgo = new SerialisedObject("visgroup");
         vgo.Set("visgroupid", visgroup.ID);
         vgo.SetColor("color", visgroup.Color);
         SaveVisgroups(visgroup.Children, vgo);
         parent.Children.Add(vgo);
     }
 }
示例#4
0
        public SerialisedObject ToSerialisedObject()
        {
            var so = new SerialisedObject(nameof(EntitySprite));

            so.Set(nameof(Name), Name);
            so.Set(nameof(Scale), Scale);
            so.SetColor(nameof(Color), Color);
            so.Set("Width", Size.Width);
            so.Set("Height", Size.Height);
            return(so);
        }
示例#5
0
        private void SaveVisgroups(Map map, List <SerialisedObject> list)
        {
            var so = new SerialisedObject("visgroups");

            foreach (var visgroup in map.Data.OfType <Visgroup>())
            {
                var vgo = new SerialisedObject("visgroup");
                vgo.Set("visgroupid", visgroup.ID);
                vgo.SetColor("color", visgroup.Colour);
                so.Children.Add(vgo);
            }
            list.Add(so);
        }
示例#6
0
        public SerialisedObject ToSerialisedObject()
        {
            SerialisedObject so = new SerialisedObject("editor");

            so.SetColor("color", Color);
            if (GroupID > 0)
            {
                so.Set("groupid", GroupID);
            }
            foreach (KeyValuePair <string, string> kv in Properties)
            {
                so.Set(kv.Key, kv.Value);
            }
            foreach (int id in VisgroupIDs.Distinct())
            {
                so.Properties.Add(new KeyValuePair <string, string>("visgroupid", Convert.ToString(id, CultureInfo.InvariantCulture)));
            }
            return(so);
        }