Beispiel #1
0
        private static WWWItem TryGetBundle(string key)
        {
            if (0 > Holder.m_stackIP)
            {
                Holder._CreateDefaultStack();
            }
            key = key.ToLower();
            WWWItem result = null;

            Holder._TryGetBundle(key, out result);
            return(result);
        }
Beispiel #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);
        }