public EngineBuiltInAssetInfo(Version version, EngineBuiltInAsset asset)
        {
            KeyValuePair <Version, EngineBuiltInAsset> kvp = new KeyValuePair <Version, EngineBuiltInAsset>(version, asset);

            m_variations = new List <KeyValuePair <Version, EngineBuiltInAsset> >(1);
            m_variations.Add(kvp);
        }
 public bool TryGetAsset(Version version, out EngineBuiltInAsset asset)
 {
     foreach (KeyValuePair <Version, EngineBuiltInAsset> kvp in m_variations)
     {
         if (version >= kvp.Key)
         {
             asset = kvp.Value;
             return(true);
         }
     }
     asset = default;
     return(false);
 }
        private static void AddAsset(Dictionary <string, EngineBuiltInAssetInfo> lookup, string name, Version version, uint exportID, uint param, bool isF)
        {
            EngineBuiltInAsset asset = new EngineBuiltInAsset(exportID, param, isF);

            if (lookup.TryGetValue(name, out EngineBuiltInAssetInfo assetInfo))
            {
                assetInfo.AddVariation(version, asset);
            }
            else
            {
                assetInfo = new EngineBuiltInAssetInfo(version, asset);
                lookup.Add(name, assetInfo);
            }
        }
        public void AddVariation(Version version, EngineBuiltInAsset asset)
        {
            KeyValuePair <Version, EngineBuiltInAsset> kvp = new KeyValuePair <Version, EngineBuiltInAsset>(version, asset);

            for (int i = 0; i < m_variations.Count; i++)
            {
                Version key = m_variations[i].Key;
                if (key < version)
                {
                    m_variations.Insert(i, kvp);
                    return;
                }
            }
            m_variations.Add(kvp);
        }
 private static bool TryGetAsset(Dictionary <string, EngineBuiltInAssetInfo> lookup, string name, Version version, out EngineBuiltInAsset asset)
 {
     if (lookup.TryGetValue(name, out EngineBuiltInAssetInfo info))
     {
         return(info.TryGetAsset(version, out asset));
     }
     asset = default;
     return(false);
 }
 public static bool TryGetBehaviour(string name, Version version, out EngineBuiltInAsset asset)
 {
     return(TryGetAsset(m_behaviours, name, version, out asset));
 }
 public static bool TryGetLightmapParams(string name, Version version, out EngineBuiltInAsset asset)
 {
     return(TryGetAsset(m_lightmapParams, name, version, out asset));
 }
 public static bool TryGetSprite(string name, Version version, out EngineBuiltInAsset asset)
 {
     return(TryGetAsset(m_sprites, name, version, out asset));
 }
 public static bool TryGetFont(string name, Version version, out EngineBuiltInAsset asset)
 {
     return(TryGetAsset(m_fonts, name, version, out asset));
 }
 public static bool TryGetMesh(string name, Version version, out EngineBuiltInAsset asset)
 {
     return(TryGetAsset(m_meshes, name, version, out asset));
 }
 public static bool TryGetMaterial(string name, Version version, out EngineBuiltInAsset asset)
 {
     return(TryGetAsset(m_materials, name, version, out asset));
 }