//------------------------------------------------------------------------------ // // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ using Bright.Serialization; using System.Collections.Generic; using SimpleJSON; namespace ET.Editor.UnitConfig { public sealed partial class UnitAttributeConfig : Bright.Config.EditorBeanBase { public UnitAttributeConfig() { } public override void LoadJson(SimpleJSON.JSONObject _json) { { var _fieldJson = _json["Id"]; if (_fieldJson != null) { if(!_fieldJson.IsNumber) { throw new SerializationException(); } Id = _fieldJson; } } { var _fieldJson = _json["HP"]; if (_fieldJson != null) { if(!_fieldJson.IsNumber) { throw new SerializationException(); } HP = _fieldJson; } } { var _fieldJson = _json["MP"]; if (_fieldJson != null) { if(!_fieldJson.IsNumber) { throw new SerializationException(); } MP = _fieldJson; } } { var _fieldJson = _json["Attack"]; if (_fieldJson != null) { if(!_fieldJson.IsNumber) { throw new SerializationException(); } Attack = _fieldJson; } } { var _fieldJson = _json["MoveSpeed"]; if (_fieldJson != null) { if(!_fieldJson.IsNumber) { throw new SerializationException(); } MoveSpeed = _fieldJson; } } { var _fieldJson = _json["AttackSpeed"]; if (_fieldJson != null) { if(!_fieldJson.IsNumber) { throw new SerializationException(); } AttackSpeed = _fieldJson; } } } public override void SaveJson(SimpleJSON.JSONObject _json) { { _json["Id"] = new JSONNumber(Id); } { _json["HP"] = new JSONNumber(HP); } { _json["MP"] = new JSONNumber(MP); } { _json["Attack"] = new JSONNumber(Attack); } { _json["MoveSpeed"] = new JSONNumber(MoveSpeed); } { _json["AttackSpeed"] = new JSONNumber(AttackSpeed); } } public static UnitAttributeConfig LoadJsonUnitAttributeConfig(SimpleJSON.JSONNode _json) { UnitAttributeConfig obj = new UnitConfig.UnitAttributeConfig(); obj.LoadJson((SimpleJSON.JSONObject)_json); return obj; } public static void SaveJsonUnitAttributeConfig(UnitAttributeConfig _obj, SimpleJSON.JSONNode _json) { _obj.SaveJson((SimpleJSON.JSONObject)_json); } /// /// Id /// public int Id { get; set; } /// /// 生命值 /// public float HP { get; set; } /// /// 魔法值 /// public float MP { get; set; } /// /// 攻击力 /// public float Attack { get; set; } /// /// 移速 /// public float MoveSpeed { get; set; } /// /// 攻击速度 /// public float AttackSpeed { get; set; } } }