/*
 * File:			GAFCustomStaticResourceLoader.cs
 * Version:			1.0
 * Last changed:	2014/12/4 18:02
 * Author:			Alexey_Nikitin
 * Copyright:		© GAF Media
 * Project:			UnityVS.UnityProject.CSharp
 */

using UnityEngine;

#if UNITY_EDITOR
using UnityEditor;
#endif // UNITY_EDITOR

using GAF.Assets;
using GAF.Utils;

namespace GAF.Demo
{
	public static class GAFCustomStaticResourceLoader
	{
		public static GAFTexturesResource getResource(string _ResourceName)
		{
			GAFTexturesResource resource = null;

#if UNITY_EDITOR
			resource = AssetDatabase.LoadAssetAtPath("Assets/GAF/Examples/Cache/" + _ResourceName + ".asset", typeof(GAFTexturesResource)) as GAFTexturesResource;
#else
			GAFUtils.Assert(false, "[GAF] GAFCustomStaticResourceLoader::getResource - is supposed to work only in editor and as example.\n Extend it if you want it to work in final builds!");
#endif // UNITY_EDITOR

			return resource;
		}
	}
}
