示例#1
0
    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>();
    }
示例#2
0
 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;
 }
示例#3
0
 private void Start()
 {
     spLife = GetComponent <ISpLifeData>();
     shield = GetComponent <ISpShieldData>();
 }