예제 #1
0
    }//position을 중심으로 radius안의 team이랑 다른 팀의 엔티티를 반환

    public GameObject Spawn(GameObject prefab, Vector2 position)
    {
        GameObject obj = ObjectPoolManager.GetObjectPool(prefab).PopItem();

        obj.transform.position = position;
        Entity entity = obj.GetComponent <Entity>();

        AddEntity(entity);
        if (entity is GameEntity)
        {
            GameUI.AddHealthBar(entity as GameEntity);
        }
        return(obj);
    }