Пример #1
0
    protected virtual IHealth Spawn(Vector3 pos)
    {
        var obj = GenericObjectPooler.RequestObject(objectToSpawn, false);

        obj.transform.localScale = targetScale;
        obj.transform.position   = pos;
        obj.gameObject.SetActive(true);
        IHealth health = obj.gameObject.GetComponent <IHealth>();

        health.FillToMaxHealth();
        Debug.DrawLine(pos, pos + Vector3.up * 10, Color.red, 1f);
        return(health);
    }
Пример #2
0
 public override void FillToMaxHealth()
 {
     sharedHealth.FillToMaxHealth();
 }