public void AddCharacterParams(CharacterConfig config, float stepDuration) { this.AttackRange = config.attackRange; this.AttackDamage = config.attackDamage; this.maxHealth = config.maxHealth; this.HealthPoints = config.maxHealth; this.MaxWalkDistance = config.moveDistance; this.stepDuration = stepDuration; }
public GameObject GetPrefab(CharacterEnum id) { CharacterConfig config = CharacterConfigs.FirstOrDefault(x => x.Id == id); if (config == null) { throw new NullReferenceException($"No Character config for id: {nameof(id)}"); } return(config.Prefab); }