38 lines
791 B
C#
38 lines
791 B
C#
using Kryz.CharacterStats.Examples;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
public class MinionSpiritPowerReleaseController : MonoBehaviour
|
|
{
|
|
public SpiritPower OwnerSpiritPower;
|
|
public float spiritPowerReserved;
|
|
|
|
public Health minionHealth;
|
|
public CharacterStats minionStats;
|
|
|
|
private bool isDead;
|
|
|
|
private void Awake()
|
|
{
|
|
minionHealth = GetComponentInParent<Health>();
|
|
minionStats = GetComponentInParent<CharacterStats>();
|
|
|
|
minionHealth.onDeath.AddListener(OnDeath);
|
|
}
|
|
|
|
|
|
private void Start()
|
|
{
|
|
isDead = false;
|
|
}
|
|
|
|
private void OnDeath()
|
|
{
|
|
isDead = true;
|
|
|
|
OwnerSpiritPower.ReleaseSpiritPower(spiritPowerReserved);
|
|
}
|
|
}
|