Example #1
0
    /// <summary>
    /// Istanzia i collectable
    /// </summary>
    /// <returns></returns>
    IPoollable InstantiateCollectables()
    {
        IPoollable p = null;

        p = GameObject.Instantiate(pooledData.Prefab, parentTransform).GetComponent <IPoollable>();
        if (p != null)
        {
            p.InternalSetup(pooledData.ID);
        }
        else
        {
            throw new System.Exception("**Poollable not found on the prefab**");
        }
        return(p);
    }