Created
January 17, 2016 10:33
-
-
Save baba-s/957f7f549d5852e2bc12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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