public int GetTex(AssetReference guid)
        {
            int index;

            if (guidToIndex.TryGetValue(guid, out index))
            {
                usageCount[index]++;
            }
            else
            {
                if (indexPool.Length <= 0)
                {
                    throw new Exception("Texture Pool out of Range!!");
                }
                index = indexPool[indexPool.Length - 1];
                indexPool.RemoveLast();
                usageCount[index] = 1;
                guidToIndex.Add(guid, index);
                clusterRes.AddLoadCommand(guid, rt, index, isNormal);
                //TODO
                //Streaming Load Texture
            }

            return(index);
        }
Пример #2
0
        public int GetTex(int4x4 guidValue, bool isNormal = false)
        {
            AssetReference guid = clusterRes.GetReference(ref guidValue);
            int            index;

            if (guidToIndex.TryGetValue(guid, out index))
            {
                usageCount[index]++;
            }
            else
            {
                if (indexPool.Length <= 0)
                {
                    Debug.Log("Texture Pool out of Range!!");
                    return(0);
                }
                index = indexPool[indexPool.Length - 1];
                indexPool.RemoveLast();
                usageCount[index] = 1;
                guidToIndex.Add(guid, index);
                clusterRes.AddLoadCommand(guid, rt, index, isNormal);
                //TODO
                //Streaming Load Texture
            }

            return(index);
        }