【a】可视化剧本编辑器 10.StoryEditor
This commit is contained in:
24
Assets/10.StoryEditor/RunTime/Resource/IResource.cs
Normal file
24
Assets/10.StoryEditor/RunTime/Resource/IResource.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo.StoryEditor
|
||||
{
|
||||
public interface IResource
|
||||
{
|
||||
/// <summary>
|
||||
/// 加载资源
|
||||
/// Json => 资源
|
||||
/// </summary>
|
||||
/// <param name="pathData">资源路径</param>
|
||||
/// <typeparam name="T">资源类型</typeparam>
|
||||
UniTask<T> Load<T>(ResourcePathData pathData) where T : Object;
|
||||
|
||||
/// <summary>
|
||||
/// 保存资源
|
||||
/// 资源 => Json
|
||||
/// </summary>
|
||||
/// <param name="asset">资源</param>
|
||||
/// <param name="packageID">包体ID</param>
|
||||
UniTask<ResourcePathData> Save<T>(T asset, string packageID = null) where T : Object;
|
||||
}
|
||||
}
|
||||
11
Assets/10.StoryEditor/RunTime/Resource/IResource.cs.meta
Normal file
11
Assets/10.StoryEditor/RunTime/Resource/IResource.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 68c399cab4c86fc4b961516a2802b94d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
38
Assets/10.StoryEditor/RunTime/Resource/ResourcePathData.cs
Normal file
38
Assets/10.StoryEditor/RunTime/Resource/ResourcePathData.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
|
||||
namespace Stary.Evo.StoryEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// 资源路径数据
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public struct ResourcePathData
|
||||
{
|
||||
/// <summary>
|
||||
/// 包体ID
|
||||
/// </summary>
|
||||
public string packageID;
|
||||
|
||||
/// <summary>
|
||||
/// 资源路径
|
||||
/// </summary>
|
||||
public string path;
|
||||
|
||||
public ResourcePathData(string packageID, string path)
|
||||
{
|
||||
this.packageID = packageID;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public void AddPath(params string[] tail)
|
||||
{
|
||||
if(tail == null || tail.Length == 0)
|
||||
return;
|
||||
|
||||
foreach (var t in tail)
|
||||
{
|
||||
path = string.IsNullOrEmpty(path) ? t : System.IO.Path.Combine(path, t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0fd990a65a7964740b2d98d2557afbb8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user