public override void SetData(IEntityData data) { _data = (HeroData)data; base.SetData(data); if (data == null) { return; } gameObject.name = _data.Name + " (Hero)"; var mr = gameObject.GetComponentInChildren <MeshRenderer>(); if (mr != null) { mr.material = _data.Mat; } _abilitiable = new Abilitiable(gameObject, _data); _armorable = new Armorable(_data); _attackable = new Attackable(gameObject); _attackerable = new Attackerable(gameObject, _data); _healthable = new Healthable(gameObject, _data); _magicable = new Magicable(gameObject, _data); _movable = new Movable(gameObject, _data); _events = new MiscEvent(); _jobSystem = new JobSystem(gameObject); _teamable = new Teamable(gameObject); }
protected override void CreateComponents() { base.CreateComponents(); _healthable = new Healthable(this); _magicable = new Magicable(this); _armorable = new Armorable(this); _killable = new Killable(this); _damageTarget = new Damageable(this, _healthable, _killable); _teamable = new Teamable(this); _attackerable = new Attackerable(this, _teamable); _aggroable = new Aggroable(this, _teamable); var agent = GetComponent <NavMeshAgent>(); var obstacle = GetComponent <NavMeshObstacle>(); _movable = new Movable(this, agent, obstacle); }
protected override void CreateComponents() { base.CreateComponents(); _abilitiable = new Abilitiable(this); _armorable = new Armorable(this); _healthable = new Healthable(this); _magicable = new Magicable(this); _teamable = new Teamable(this); _attackerable = new Attackerable(this, _teamable); var agent = GetComponent <NavMeshAgent>(); var obstacle = GetComponent <NavMeshObstacle>(); _movable = new Movable(this, agent, obstacle); _targetable = new Targetable(this); _killable = new Killable(this); _damageTarget = new Damageable(this, _healthable, _killable, _armorable); _modifiable = new Modifiable(this); _inventoryable = new Inventoryable <IItem>(this, new LimitedInventory <IItem>(6)); _healable = new Healable(this, _healthable); }
protected void SpendMana() { Magicable.ModifyMana(-ManaCost, Self); }