コード例 #1
0
 public static void RemoveTexture2D(GameTextures2D obj)
 {
     try
     {
         if (Textures2D.ContainsKey(obj))
         {
             Textures2D.Remove(obj);
         }
     } catch (Exception exception)
     {
         ErrorLog.Add(exception);
     }
 }
コード例 #2
0
 public static void AddTexture2D(GameTextures2D obj)
 {
     try
     {
         if (Textures2D == null)
         {
             Textures2D = new Dictionary <GameTextures2D, Texture2D>();
         }
         if (!Textures2D.ContainsKey(obj))
         {
             Textures2D.Add(obj,
                            ContentMgr.Load <Texture2D>("Textures2D/" + Enum.GetName(typeof(GameTextures2D), obj)));
         }
     } catch (Exception exception)
     {
         ErrorLog.Add(exception);
     }
 }