Skip to content

Instantly share code, notes, and snippets.

@baba-s
Created January 17, 2016 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baba-s/957f7f549d5852e2bc12 to your computer and use it in GitHub Desktop.
Save baba-s/957f7f549d5852e2bc12 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections.Generic;
public static class Loader
{
private static readonly Dictionary<string, Texture> mList = new Dictionary<string, Texture>();
public static Texture Load( string path )
{
if ( !mList.ContainsKey( path ) )
{
mList[ path ] = Resources.Load<Texture>( path );
}
return mList[ path ];
}
public static void Clear()
{
mList.Clear();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment