public void Save(SkillSerializable serializable) { serializable.Name = Name; serializable.Icon = Icon; serializable.Description = Description; serializable.BaseRequirement = BaseRequirement.Value; serializable.RequirementPerLevel = RequirementPerLevel.Value; serializable.BasePrice = BasePrice.Value; serializable.PricePerLevel = PricePerLevel.Value; serializable.MaxLevel = MaxLevel.Value; OnDataSerialized(ref serializable); }
public Skill(SkillSerializable serializable, Database database) { Id = new ItemId<Skill>(serializable.Id, serializable.FileName); Name = serializable.Name; Icon = serializable.Icon; Description = serializable.Description; BaseRequirement = new NumericValue<float>(serializable.BaseRequirement, 0f, 100f); RequirementPerLevel = new NumericValue<float>(serializable.RequirementPerLevel, 0f, 100f); BasePrice = new NumericValue<float>(serializable.BasePrice, 0f, 100f); PricePerLevel = new NumericValue<float>(serializable.PricePerLevel, 0f, 100f); MaxLevel = new NumericValue<int>(serializable.MaxLevel, 1, 1000); OnDataDeserialized(serializable, database); }
private Skill(SkillSerializable serializable, Database.Loader loader) { Id = new ItemId <Skill>(serializable.Id); loader.AddSkill(serializable.Id, this); Name = serializable.Name; Icon = new SpriteId(serializable.Icon, SpriteId.Type.SkillIcon); Description = serializable.Description; BaseRequirement = UnityEngine.Mathf.Clamp(serializable.BaseRequirement, 0f, 100f); RequirementPerLevel = UnityEngine.Mathf.Clamp(serializable.RequirementPerLevel, 0f, 100f); BasePrice = UnityEngine.Mathf.Clamp(serializable.BasePrice, 0f, 100f); PricePerLevel = UnityEngine.Mathf.Clamp(serializable.PricePerLevel, 0f, 100f); MaxLevel = UnityEngine.Mathf.Clamp(serializable.MaxLevel, 1, 1000); OnDataDeserialized(serializable, loader); }
partial void OnDataSerialized(ref SkillSerializable serializable);
partial void OnDataDeserialized(SkillSerializable serializable, Database database);
public static Skill Create(SkillSerializable serializable, Database.Loader loader) { return(new Skill(serializable, loader)); }
partial void OnDataDeserialized(SkillSerializable serializable, Database.Loader loader);