private void OnEnable() { ISpLifeData spLifeData = GetComponent <ISpLifeData>(); ISpShieldData shieldData = GetComponent <ISpShieldData>(); spacemarine = new SpDamagable(ref shieldData, ref spLifeData); spacemarine.Death += Spacemarine_Death; animator = GetComponent <Animator>(); }
public SpDamagable(ref ISpShieldData shieldData, ref ISpLifeData spLifeData) { this.shieldData = shieldData; this.spLifeData = spLifeData; this.isAlive = true; this.shieldData.Shield.Recharged += Shield_Recharged; this.spLifeData.Life.Recharged += Life_Recharged; this.shieldData.EnableComponent(false); this.spLifeData.EnableComponent(false); this.Death += SpDamagable_Death; }
private void Start() { spLife = GetComponent <ISpLifeData>(); shield = GetComponent <ISpShieldData>(); }