Exemplo n.º 1
0
        private static void _AddTo(string stackName, WWWItem value)
        {
            Dictionary <string, WWWItem> dictionary = Holder._FindStack(stackName);

            if (dictionary.ContainsKey(value.assetPath))
            {
                TsPlatform.FileLog("already added key = " + value.assetPath + ", Name = " + value.assetName);
                return;
            }
            dictionary.Add(value.assetPath, value);
        }
Exemplo n.º 2
0
        public static WWWItem TryGetOrCreateBundle(string key, string stackName, bool immediatelyUrl)
        {
            if (0 > Holder.m_stackIP)
            {
                Holder._CreateDefaultStack();
            }
            if (!key.Contains("?notlow"))
            {
                key = key.ToLower();
            }
            WWWItem wWWItem = null;

            Holder._TryGetBundle(key, out wWWItem);
            if (wWWItem == null)
            {
                Dictionary <string, WWWItem> dictionary = Holder._FindStack(stackName);
                dictionary.TryGetValue(key, out wWWItem);
                if (wWWItem == null)
                {
                    int index = Holder.m_bundleGroupStack.IndexOf(dictionary);
                    stackName = Holder.m_bundleNameStack[index];
                    wWWItem   = new WWWItem(stackName);
                    if (immediatelyUrl)
                    {
                        wWWItem.SetAnotherUrl(key);
                    }
                    else
                    {
                        wWWItem.SetAssetPath(key);
                    }
                    Holder._AddTo(stackName, wWWItem);
                }
            }
            wWWItem.refCnt++;
            return(wWWItem);
        }