Last active
September 14, 2015 17:04
-
-
Save liortal53/47a5b7afa1833391db34 to your computer and use it in GitHub Desktop.
ResourcesEx - a wrapper for Unity's Resources class
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; | |
/// <summary> | |
/// Wrapper class around Unity's built-in Resources class. | |
/// </summary> | |
public class ResourcesEx | |
{ | |
public static UnityEngine.Object Load(string path) | |
{ | |
Debug.Log (string.Format("Loading from Resources: {0}", path)); | |
return Resources.Load(path); | |
} | |
public static UnityEngine.Object Load(string path, Type type) | |
{ | |
Debug.Log (string.Format("Loading from Resources: {0} Type: {1}", path, type.Name)); | |
return Resources.Load(path, type); | |
} | |
public static T Load<T> (string path) where T : UnityEngine.Object | |
{ | |
Debug.Log (string.Format("Loading from Resources: {0} Type: {1}", path, typeof(T).Name)); | |
return Resources.Load<T>(path); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment