Esempio n. 1
0
        public bool Locate(object key, Type type, out IList <IResourceLocation> locations)
        {
            locations = null;
            if (ResourceManagerConfig.ExtractKeyAndSubKey(key, out string mainKey, out string subKey))
            {
                if (!m_Addressables.GetResourceLocations(mainKey, type, out IList <IResourceLocation> locs))
                {
                    if (type == typeof(Sprite))
                    {
                        m_Addressables.GetResourceLocations(mainKey, typeof(SpriteAtlas), out locs);
                    }
                }

                if (locs != null && locs.Count > 0)
                {
                    locations = new List <IResourceLocation>(locs.Count);
                    foreach (var l in locs)
                    {
                        CreateDynamicLocations(type, locations, key as string, subKey, l);
                    }
                    return(true);
                }
            }
            return(false);
        }
 protected override void Execute()
 {
     m_Addressables.GetResourceLocations(m_Key, m_ResourceType, m_MergeMode, out m_locations);
     if (m_locations == null)
     {
         m_locations = new List <IResourceLocation>();
     }
     Complete(m_locations, true, string.Empty);
 }
            protected override void Execute()
            {
                bool result = m_Addressables.GetResourceLocations(m_Key, m_MergeMode, out m_locations);

                Complete(m_locations, result, string.Empty);
            }