Example #1
0
    void Awake()
    {
        t = gameObject.GetComponent <Transform>();

        if (!SimplePool.PoolExists(projectilePrefab.name))
        {
            SimplePool.CreatePool(projectilePrefab);
        }
    }
Example #2
0
    void Start()
    {
        foreach (AudioClip c in sounds)
        {
            GameObject  go      = new GameObject(c.name);
            AudioSource aSource = go.AddComponent <AudioSource>();
            LifeTime    lt      = go.AddComponent <LifeTime>();

            lt.lifeTime         = c.length;
            aSource.clip        = c;
            aSource.playOnAwake = true;

            SimplePool.CreatePool(go, 100);
        }
    }
Example #3
0
    void SetupProjectilePools()
    {
        if (!SimplePool.PoolExists(basicProjectilePrefab.name))
        {
            SimplePool.CreatePool(basicProjectilePrefab);
        }

        if (!SimplePool.PoolExists(littleYellowProjectilePrefab.name))
        {
            SimplePool.CreatePool(littleYellowProjectilePrefab);
        }

        if (!SimplePool.PoolExists(bigBlueProjectilePrefab.name))
        {
            SimplePool.CreatePool(bigBlueProjectilePrefab);
        }
    }
Example #4
0
    void SetupPools()
    {
        foreach (GameObject type in enemyTypes)
        {
            if (!SimplePool.PoolExists(type.name))
            {
                SimplePool.CreatePool(type);
            }
        }

        foreach (GameObject type in powerUps)
        {
            if (!SimplePool.PoolExists(type.name))
            {
                SimplePool.CreatePool(type);
            }
        }
    }