示例#1
0
    private void Spawn()
    {
        if (!SlimePool.GetInstance())
        {
            return;
        }

        int        nSpawnPoolIndex = 0;
        GameObject objEnemy        = null;

        objEnemy = SlimePool.GetInstance().EnableObject();

        if (!objEnemy)
        {
            return;
        }

        nSpawnPoolIndex = Random.Range(0, m_arraySpawnPool.Length);

        objEnemy.transform.position = m_arraySpawnPool[nSpawnPoolIndex].position;
        objEnemy.transform.rotation = m_arraySpawnPool[nSpawnPoolIndex].rotation;

        SlimePool.GetInstance().Setup(objEnemy);
    }
示例#2
0
    private IEnumerator StartRelease(float fTime)
    {
        yield return(new WaitForSeconds(fTime));

        SlimePool.GetInstance().ReleaseObject(gameObject);
    }