示例#1
0
		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);
		}
示例#2
0
		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);
		}
示例#3
0
        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);
        }
示例#4
0
		partial void OnDataSerialized(ref SkillSerializable serializable);
示例#5
0
		partial void OnDataDeserialized(SkillSerializable serializable, Database database);
示例#6
0
 public static Skill Create(SkillSerializable serializable, Database.Loader loader)
 {
     return(new Skill(serializable, loader));
 }
示例#7
0
 partial void OnDataDeserialized(SkillSerializable serializable, Database.Loader loader);