Exemplo n.º 1
0
    public IEnumerator 풀링_기본테스트()
    {
        CManagerPooling <ETestPoolingObjectName, TestPoolingObject> pPoolingManager = InitGeneratePoolingTest();

        Assert.AreEqual(0, TestPoolingObject.g_mapActiveCount[ETestPoolingObjectName.Test1]);
        Assert.AreEqual(0, TestPoolingObject.g_mapActiveCount[ETestPoolingObjectName.Test2]);

        List <GameObject> listObjectPooling = new List <GameObject>();

        for (int i = 0; i < 10; i++)
        {
            listObjectPooling.Add(pPoolingManager.DoPop(ETestPoolingObjectName.Test1).gameObject);
        }
        Assert.AreEqual(10, TestPoolingObject.g_mapActiveCount[ETestPoolingObjectName.Test1]);

        for (int i = 0; i < 10; i++)
        {
            pPoolingManager.DoPush(listObjectPooling[i].GetComponent <TestPoolingObject>());
        }
        Assert.AreEqual(0, TestPoolingObject.g_mapActiveCount[ETestPoolingObjectName.Test1]);

        listObjectPooling.Clear();
        for (int i = 0; i < 5; i++)
        {
            listObjectPooling.Add(pPoolingManager.DoPop(ETestPoolingObjectName.Test2).gameObject);
        }
        Assert.AreEqual(5, TestPoolingObject.g_mapActiveCount[ETestPoolingObjectName.Test2]);

        pPoolingManager.DoPushAll();
        Assert.AreEqual(0, TestPoolingObject.g_mapActiveCount[ETestPoolingObjectName.Test2]);

        yield break;
    }
 private void Arg2_p_Event_Effect_OnDisable(CEffect obj)
 {
     _pManagerPooling.DoPush(obj);
 }
Exemplo n.º 3
0
 public void Return_HealthBar(HealthBar pHealthbAr)
 {
     _pHealthBarPool.DoPush(pHealthbAr);
 }