Esempio n. 1
0
        public void SpawnShield(int _id, float _amount)
        {
            EntitySheildItem shield = TObjectPool <EntitySheildItem> .Spawn().Set(_id, _amount);

            m_Shields.Add(_id, shield);
            CheckTotalAmount();
        }
Esempio n. 2
0
        public SoundPool(string rPoolName, int rInitCount = 0)
        {
            this.mObjectPool = new TObjectPool <AudioSource>(OnAlloc, OnFree, OnDestroy);

            this.mRootGo = UtilTool.CreateGameObject(rPoolName);
            this.mRootGo.transform.position = new Vector3(0, 0, 0);

            for (int i = 0; i < rInitCount; i++)
            {
                this.mObjectPool.Alloc();
            }
        }
Esempio n. 3
0
    void InitData()
    {
        if (loadType == LoadType.IO)
        {
            LoadAllPicture();
        }
        else
        {
            StartCoroutine(LoadWWWAllPicture());
        }

        int count = allTex2d.Count < minCount ? minCount : allTex2d.Count;

        Tpool = new TObjectPool <GameObjData>(count, GameObjData.CreateObj, GameObjData.ReleaseObj, string.Empty, picPoolTrans, 0);
        for (int i = 0; i < count; i++)
        {
            Tpool.OnActiveGameObject(pQueue);
        }

        RegistBtn();
    }
Esempio n. 4
0
    public static void Recycle <T>(this T poolItem) where T : IObjectPool, new()
    {
        TObjectPool <T> .Recycle(poolItem);

        poolItem.OnPoolRecycle();
    }
Esempio n. 5
0
 public ClientSession()
 {
     m_clientSocket = new ClientSocket(this);
     _netpacketPool = new TObjectPool <NetPacket>();
     Log_Tag        = "ClientSession";
 }