Esempio n. 1
0
        public static void Load()
        {
            AGLogger.Message("Loading resources...");
            var path = PathUtil.GetAssemblyPath(typeof(AGTestResourceLoader));

            Assets = AssetBundle.LoadFromFile(Path.Combine(path, "resources.assets"));
            if (Assets == null)
            {
                AGLogger.Error("Unable to load resources.");
            }
        }
Esempio n. 2
0
        public static Sprite LoadSprite(string name)
        {
            if (Assets == null)
            {
                return(Default);
            }
            var sprite = Assets.LoadAsset <Sprite>(name);

            if (sprite == null)
            {
                AGLogger.Error($"Unable to load sprite '{name}'.");
                return(Default);
            }
            return(sprite);
        }