【a】可视化剧本编辑器 10.StoryEditor
This commit is contained in:
20
Assets/10.StoryEditor/Sample~/Script/ResourceLoader.cs
Normal file
20
Assets/10.StoryEditor/Sample~/Script/ResourceLoader.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using rokid.armaz.module;
|
||||
using Stary.Evo.StoryEditor;
|
||||
using UnityEngine;
|
||||
|
||||
public class ResourceLoader : IResource
|
||||
{
|
||||
public UniTask<T> Load<T>(ResourcePathData pathData) where T : Object
|
||||
{
|
||||
return AMP.ResourceLoader.LoadAssetAsync<T>(pathData.packageID, pathData.path);
|
||||
}
|
||||
|
||||
public UniTask<ResourcePathData> Save<T>(T asset, string packageID) where T : Object
|
||||
{
|
||||
ResourcePathData pathData = new();
|
||||
pathData.packageID = packageID;
|
||||
pathData.AddPath(asset.name);
|
||||
return UniTask.FromResult(pathData);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user