25 lines
559 B
C#
25 lines
559 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace Beyond
|
|
{
|
|
public class ImageResourceLoader : MonoBehaviour
|
|
{
|
|
public Image image;
|
|
public string path;
|
|
|
|
// Start is called before the first frame update
|
|
private void OnEnable()
|
|
{
|
|
image.sprite = Resources.Load<Sprite>(path);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
Resources.UnloadAsset(image.sprite);
|
|
//Resources.UnloadUnusedAssets();
|
|
}
|
|
}
|
|
} |