스킬 이미지 로드하도록 하는 AssetManager 추가
This commit is contained in:
21
Gameton-06/Assets/Gameton/Scripts/Common/AssetManager.cs
Normal file
21
Gameton-06/Assets/Gameton/Scripts/Common/AssetManager.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public class AssetManager : SingletonBase<AssetManager>
|
||||
{
|
||||
|
||||
public bool LoadAsset<T>(string path, out T result) where T : UnityEngine.Object
|
||||
{
|
||||
result = Resources.Load<T>(path);
|
||||
return result != null;
|
||||
}
|
||||
|
||||
public bool LoadSkillIcon(string skillId, out Sprite result)
|
||||
{
|
||||
return LoadAsset<Sprite>($"UI/Skill Icon/skill_icon_{skillId}", out result);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user