private void SetDataHealth() { var health = dataHealth.Health; dataHealth = ScriptableObject.CreateInstance(typeof(DataHealth)) as DataHealth; dataHealth.SetHealth(health); }
private void OnEnable() { if (itemType == ItemType.Unit) { unit = GameManager.Instance.allUnits[id]; } else { unit = GameManager.Instance.towerUpdates[id]; } if (unit.GetComponent <UnitData>().unitProperties.isPurchased == true) { buyButton.gameObject.SetActive(false); } dataHealth = unit.GetComponent <UnitData>().dataHealth; unitProperties = unit.GetComponent <UnitData>().unitProperties; image.sprite = unit.GetComponent <SpriteRenderer>().sprite; image.SetNativeSize(); price = unitProperties.CoinsPrice; coinsPrice.text = $"{price}"; titleText.text = unit.name; healthText.text = $"{dataHealth.Health}"; damageText.text = $"{unitProperties.Damage}"; manaPriceText.text = $"{unitProperties.ManaPrice}"; speedText.text = $"{unitProperties.Speed}"; }
public override void SetUp(ActorBase _actor) { actor = _actor; dataHealth = ScriptableObject.CreateInstance <DataHealth>(); dataHealth.Health = actor.GetData <DataHealth>().Health; }
public override void SetUp(ActorBase _actor) { actor = _actor; dataHealth = actor.GetData <DataHealth>(); }