Ejemplo n.º 1
0
    public GameObject SpawnFromPool(PooledEnum type, Vector3 position, Quaternion rotation, object[] objects = null)
    {
        if (_poolsDictionary[type].Any() == false)
        {
            Debug.Log("Pool is empty");
            return(null);
        }

        GameObject spawn = _poolsDictionary[type].Dequeue();

        IPooledObject p = spawn.GetComponent <IPooledObject>();

        // Should trigger error if not a IPooledObject, implement it god dammit
        p.OnSpawn(objects);

        spawn.transform.position = position;
        spawn.transform.rotation = rotation;

        spawn.SetActive(true);

        _poolsDictionary[type].Enqueue(spawn);

        return(spawn);
    }
Ejemplo n.º 2
0
 public RangeAttack(float range, float skillRefreshSpeed, Targetable caster, int dmg, PooledEnum projectileEnum, Func <Targetable, bool> isValidTarget, List <IOffensiveModifier> modifiers = null, List <Effect> effects = null) : base(range, skillRefreshSpeed, caster, dmg, isValidTarget, modifiers, effects)
 {
     Projectile = projectileEnum;
 }