Beispiel #1
0
    public Transform GetTransform <T>(string strPathName)
    {
        string      strPoolName = typeof(T).Name;
        IzSpawnPool izSpawnPool = null;

        if (!this._dicSpawnPool.TryGetValue(strPoolName, out izSpawnPool))
        {
            izSpawnPool = SpawnPool.CreateSpawnPool(strPoolName, this, this._rootGameObject);
            this._dicSpawnPool[strPoolName] = izSpawnPool;
        }
        Transform transform = izSpawnPool.GetTransform(strPathName);

        if (null == transform)
        {
            return(null);
        }

        if (transform.gameObject.activeSelf == false)
        {
            transform.gameObject.SetActive(true);
        }
        return(transform);
    }