Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
 public static bool TryGetBehaviour(string name, Version version, out EngineBuiltInAsset asset)
 {
     return(TryGetAsset(m_behaviours, name, version, out asset));
 }
Ejemplo n.º 7
0
 public static bool TryGetLightmapParams(string name, Version version, out EngineBuiltInAsset asset)
 {
     return(TryGetAsset(m_lightmapParams, name, version, out asset));
 }
Ejemplo n.º 8
0
 public static bool TryGetSprite(string name, Version version, out EngineBuiltInAsset asset)
 {
     return(TryGetAsset(m_sprites, name, version, out asset));
 }
Ejemplo n.º 9
0
 public static bool TryGetFont(string name, Version version, out EngineBuiltInAsset asset)
 {
     return(TryGetAsset(m_fonts, name, version, out asset));
 }
Ejemplo n.º 10
0
 public static bool TryGetMesh(string name, Version version, out EngineBuiltInAsset asset)
 {
     return(TryGetAsset(m_meshes, name, version, out asset));
 }
Ejemplo n.º 11
0
 public static bool TryGetMaterial(string name, Version version, out EngineBuiltInAsset asset)
 {
     return(TryGetAsset(m_materials, name, version, out asset));
 }