Ejemplo n.º 1
0
        internal static WWWItem GetPreDownloadBundle(string assetPath, ItemType type)
        {
            WWWItem wWWItem = null;
            string  text    = assetPath.ToLower();

            foreach (Dictionary <string, WWWItem> current in Holder.m_bundleGroupStack)
            {
                if (current.ContainsKey(text))
                {
                    WWWItem result = null;
                    return(result);
                }
            }
            if (Holder.ms_UndefinedStack.TryGetValue(text, out wWWItem))
            {
                return(null);
            }
            wWWItem = new WWWItem(Option.undefinedStackName);
            wWWItem.SetAssetPath(text);
            Holder.ms_UndefinedStack.Add(text, wWWItem);
            wWWItem.SetItemType(type);
            wWWItem.refCnt++;
            return(wWWItem);
        }
Ejemplo 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);
        }