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