【a】可视化剧本编辑器 10.StoryEditor

This commit is contained in:
mzh
2026-01-06 14:24:23 +08:00
parent f055116d4d
commit 2e8accfed8
80 changed files with 3145 additions and 0 deletions

View 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;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 68c399cab4c86fc4b961516a2802b94d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View 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);
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0fd990a65a7964740b2d98d2557afbb8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: