Merge branch 'master' of http://192.168.31.100:8088/framework/xosmopluginlibrary
# Conflicts: # Assets/07.RKVoiceCommand/RunTime/IVoiceCommandSystem.cs # Assets/07.RKVoiceCommand/RunTime/VoiceCommandController.cs # Assets/07.RKVoiceCommand/package.json
This commit is contained in:
3
Assets/00.StaryEvo/Editor/Build.meta
Normal file
3
Assets/00.StaryEvo/Editor/Build.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 357613ee582c4e068ea5e61e4f6499e4
|
||||
timeCreated: 1744603673
|
||||
25
Assets/00.StaryEvo/Editor/Build/BuildReport.cs
Normal file
25
Assets/00.StaryEvo/Editor/Build/BuildReport.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using Stary.Evo.Editor;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Callbacks;
|
||||
|
||||
namespace Stary.Evo
|
||||
{
|
||||
// 实现接口的方式
|
||||
public class BuildReport : IPostprocessBuildWithReport, IPreprocessBuildWithReport
|
||||
{
|
||||
public int callbackOrder { get; set; }
|
||||
|
||||
public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
|
||||
{
|
||||
// build前
|
||||
|
||||
}
|
||||
|
||||
public void OnPostprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
|
||||
{
|
||||
// build完成后
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/00.StaryEvo/Editor/Build/BuildReport.cs.meta
Normal file
3
Assets/00.StaryEvo/Editor/Build/BuildReport.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a96d44b788304391b0e9ba8ff6a7bcc9
|
||||
timeCreated: 1744603665
|
||||
@@ -9,12 +9,14 @@ using HybridCLR.Editor.Settings;
|
||||
using Sirenix.OdinInspector;
|
||||
using Sirenix.OdinInspector.Editor;
|
||||
using Sirenix.Utilities;
|
||||
using Stary.Evo.InformationSave;
|
||||
using UnityEditor;
|
||||
using UnityEditorInternal;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo.Editor
|
||||
{
|
||||
|
||||
public class CreatAssetWindow : OdinEditorWindow
|
||||
{
|
||||
[MenuItem("Evo/创建Domain作用域")]
|
||||
@@ -48,27 +50,28 @@ namespace Stary.Evo.Editor
|
||||
{
|
||||
Directory.CreateDirectory(artDomainPath);
|
||||
|
||||
if (!Directory.Exists(artDomainPath))
|
||||
//创建Animation文件夹
|
||||
Directory.CreateDirectory(artDomainPath + "/Animation");
|
||||
CreatDirectory(artDomainPath + "/Animation");
|
||||
//创建Effects文件夹
|
||||
Directory.CreateDirectory(artDomainPath + "/Effects");
|
||||
CreatDirectory(artDomainPath + "/Effects");
|
||||
//创建Fbx文件夹
|
||||
Directory.CreateDirectory(artDomainPath + "/Fbx");
|
||||
CreatDirectory(artDomainPath + "/Fbx");
|
||||
//创建Font文件夹
|
||||
Directory.CreateDirectory(artDomainPath + "/Font");
|
||||
CreatDirectory(artDomainPath + "/Font");
|
||||
//创建Materials文件夹
|
||||
Directory.CreateDirectory(artDomainPath + "/Materials");
|
||||
CreatDirectory(artDomainPath + "/Materials");
|
||||
//创建Prefabs文件夹
|
||||
Directory.CreateDirectory(artDomainPath + "/Prefabs");
|
||||
CreatDirectory(artDomainPath + "/Prefabs");
|
||||
//创建Scenes文件夹
|
||||
Directory.CreateDirectory(artDomainPath + "/Scenes");
|
||||
CreatDirectory(artDomainPath + "/Scenes");
|
||||
//创建/Scenes/Test文件夹
|
||||
Directory.CreateDirectory(artDomainPath + "/Scenes/Test");
|
||||
CreatDirectory(artDomainPath + "/Scenes/Test");
|
||||
//创建Shader文件夹
|
||||
Directory.CreateDirectory(artDomainPath + "/Shader");
|
||||
CreatDirectory(artDomainPath + "/Shader");
|
||||
//创建Textures文件夹
|
||||
Directory.CreateDirectory(artDomainPath + "/Textures");
|
||||
await File.WriteAllTextAsync(
|
||||
CreatDirectory(artDomainPath + "/Textures");
|
||||
File.WriteAllTextAsync(
|
||||
$"{artDomainPath}/这里放所有美术的资源,因涉及打包依赖等原因,不建议在上一层节点新增文件夹,如涉及文件夹规范等问题请@张铮.hint", "");
|
||||
}
|
||||
|
||||
@@ -80,48 +83,57 @@ namespace Stary.Evo.Editor
|
||||
return;
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(domainPath);
|
||||
CreatDirectory(domainPath);
|
||||
|
||||
//程序资源存放文件夹
|
||||
string resPath = $"{domainPath}/AddressableRes";
|
||||
Directory.CreateDirectory(resPath);
|
||||
CreatDirectory(resPath);
|
||||
//创建音频文件夹
|
||||
Directory.CreateDirectory(resPath + "/Audios");
|
||||
CreatDirectory(resPath + "/Audios");
|
||||
//创建Config文件夹
|
||||
Directory.CreateDirectory(resPath + "/Config");
|
||||
CreatDirectory(resPath + "/Config");
|
||||
//创建Dll文件夹
|
||||
Directory.CreateDirectory(resPath + "/Dll");
|
||||
CreatDirectory(resPath + "/Dll");
|
||||
//创建Prefabs文件夹
|
||||
Directory.CreateDirectory(resPath + "/Prefabs");
|
||||
CreatDirectory(resPath + "/Prefabs");
|
||||
//创建Scenes文件夹
|
||||
Directory.CreateDirectory(resPath + "/Scenes");
|
||||
CreatDirectory(resPath + "/Scenes");
|
||||
//创建SpriteAtlas文件夹
|
||||
Directory.CreateDirectory(resPath + "/SpriteAtlas");
|
||||
CreatDirectory(resPath + "/SpriteAtlas");
|
||||
//创建Sprites文件夹
|
||||
Directory.CreateDirectory(resPath + "/Sprites");
|
||||
CreatDirectory(resPath + "/Sprites");
|
||||
//创建Video文件夹
|
||||
Directory.CreateDirectory(resPath + "/Video");
|
||||
CreatDirectory(resPath + "/Video");
|
||||
|
||||
await File.WriteAllTextAsync($"{resPath}/这里放所有参与热更的资源.hint", "");
|
||||
File.WriteAllTextAsync($"{resPath}/这里放所有参与热更的资源.hint", "");
|
||||
|
||||
//主入口预制件
|
||||
GameObject gameObj = new GameObject(domain);
|
||||
gameObj.transform.position = Vector3.zero;
|
||||
gameObj.transform.rotation = Quaternion.identity;
|
||||
gameObj.name = domain;
|
||||
Directory.CreateDirectory($"{resPath}/Prefabs");
|
||||
//创建位置层级
|
||||
GameObject transformInfo = new GameObject("TransformInfo");
|
||||
transformInfo.transform.SetParent(gameObj.transform);
|
||||
transformInfo.transform.position = Vector3.zero;
|
||||
transformInfo.transform.rotation = Quaternion.identity;
|
||||
transformInfo.AddComponent<LocalTransformInfo>();
|
||||
|
||||
|
||||
|
||||
CreatDirectory($"{resPath}/Prefabs");
|
||||
string rootPfbFilePath = $"Assets/Domain/{domain}/AddressableRes/Prefabs/{domain}.prefab";
|
||||
var localPath = AssetDatabase.GenerateUniqueAssetPath(rootPfbFilePath);
|
||||
PrefabUtility.SaveAsPrefabAsset(gameObj, localPath);
|
||||
|
||||
//存放脚本文件夹
|
||||
string scriptsPath = $"{domainPath}/HotUpdate";
|
||||
Directory.CreateDirectory(scriptsPath);
|
||||
await File.WriteAllTextAsync($"{scriptsPath}/这里放所有参与热更的脚本文件.hint", "该文件夹中的程序集定义文件,请勿删除,非常重要。");
|
||||
CreatDirectory(scriptsPath);
|
||||
File.WriteAllTextAsync($"{scriptsPath}/这里放所有参与热更的脚本文件.hint", "该文件夹中的程序集定义文件,请勿删除,非常重要。");
|
||||
|
||||
//创建配置文件夹
|
||||
string confPath = $"{domainPath}/Conf";
|
||||
Directory.CreateDirectory(confPath);
|
||||
CreatDirectory(confPath);
|
||||
|
||||
|
||||
//程序集配置资源
|
||||
@@ -136,21 +148,7 @@ namespace Stary.Evo.Editor
|
||||
body = body.Replace("ROOT_NAMESPACE", hotfixDomain);
|
||||
await writer.WriteAsync(body);
|
||||
}
|
||||
|
||||
// await File.WriteAllTextAsync($"{scriptsPath}/{hotfixDomain}.asmdef", body);
|
||||
|
||||
|
||||
// string architectureClassName = $"{domain}Architecture";
|
||||
// string architectureClassPath = $"{scriptsPath}/{architectureClassName}.txt";
|
||||
// //await File.WriteAllTextAsync($"{scriptsPath}/{architectureClassName}.cs", architectureTemplate);
|
||||
//
|
||||
// await using (var writer = new StreamWriter(architectureClassPath))
|
||||
// {
|
||||
//
|
||||
// string architectureTemplate = Resources.Load<TextAsset>("ArchitectureTemplate").text;
|
||||
// architectureTemplate = architectureTemplate.Replace("XXXX", architectureClassName);
|
||||
// await writer.WriteAsync(architectureTemplate);
|
||||
// }
|
||||
|
||||
//模块化脚本生成配置
|
||||
string domainClassName = $"{domain}Domain";
|
||||
string architectureClassName = $"{domain}Architecture";
|
||||
@@ -224,13 +222,7 @@ namespace Stary.Evo.Editor
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateDomainClass()
|
||||
{
|
||||
}
|
||||
|
||||
public void CreateArchitectureClass()
|
||||
{
|
||||
}
|
||||
|
||||
[TitleGroup("预览Domain作用域")] public List<CreatDomainEntity> domainList;
|
||||
|
||||
@@ -302,5 +294,62 @@ namespace Stary.Evo.Editor
|
||||
|
||||
return domainList;
|
||||
}
|
||||
|
||||
private static void CreatDirectory(string artDomainPath)
|
||||
{
|
||||
if (!Directory.Exists(artDomainPath))
|
||||
{
|
||||
//创建Animation文件夹
|
||||
Directory.CreateDirectory(artDomainPath);
|
||||
}
|
||||
}
|
||||
|
||||
public static void CreateDomainDirectory(string domain)
|
||||
{
|
||||
string artDomainPath = $"{Application.dataPath}/Art/{domain}";
|
||||
//创建Animation文件夹
|
||||
CreatDirectory(artDomainPath + "/Animation");
|
||||
//创建Effects文件夹
|
||||
CreatDirectory(artDomainPath + "/Effects");
|
||||
//创建Fbx文件夹
|
||||
CreatDirectory(artDomainPath + "/Fbx");
|
||||
//创建Font文件夹
|
||||
CreatDirectory(artDomainPath + "/Font");
|
||||
//创建Materials文件夹
|
||||
CreatDirectory(artDomainPath + "/Materials");
|
||||
//创建Prefabs文件夹
|
||||
CreatDirectory(artDomainPath + "/Prefabs");
|
||||
//创建Scenes文件夹
|
||||
CreatDirectory(artDomainPath + "/Scenes");
|
||||
//创建/Scenes/Test文件夹
|
||||
CreatDirectory(artDomainPath + "/Scenes/Test");
|
||||
//创建Shader文件夹
|
||||
CreatDirectory(artDomainPath + "/Shader");
|
||||
//创建Textures文件夹
|
||||
CreatDirectory(artDomainPath + "/Textures");
|
||||
|
||||
string domainPath = $"{Application.dataPath}/Domain/{domain}";
|
||||
//程序资源存放文件夹
|
||||
string resPath = $"{domainPath}/AddressableRes";
|
||||
CreatDirectory(resPath);
|
||||
//创建音频文件夹
|
||||
CreatDirectory(resPath + "/Audios");
|
||||
//创建Config文件夹
|
||||
CreatDirectory(resPath + "/Config");
|
||||
//创建Dll文件夹
|
||||
CreatDirectory(resPath + "/Dll");
|
||||
//创建Prefabs文件夹
|
||||
CreatDirectory(resPath + "/Prefabs");
|
||||
//创建Scenes文件夹
|
||||
CreatDirectory(resPath + "/Scenes");
|
||||
//创建SpriteAtlas文件夹
|
||||
CreatDirectory(resPath + "/SpriteAtlas");
|
||||
//创建Sprites文件夹
|
||||
CreatDirectory(resPath + "/Sprites");
|
||||
//创建Video文件夹
|
||||
CreatDirectory(resPath + "/Video");
|
||||
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
27
Assets/00.StaryEvo/Editor/BuildAsset/CreatDomainDirectory.cs
Normal file
27
Assets/00.StaryEvo/Editor/BuildAsset/CreatDomainDirectory.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Stary.Evo.Editor;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
public static class CreatDomainDirectory
|
||||
{
|
||||
static CreatDomainDirectory()
|
||||
{
|
||||
if (PlayerPrefs.GetInt("CreatDomainDirectory") == 0)
|
||||
{
|
||||
PlayerPrefs.SetInt("CreatDomainDirectory", 1);
|
||||
bool isOk = EditorUtility.DisplayDialog("提示", "发现目录存在缺失,是否检索并创建缺失目录", "是", "否");
|
||||
if (isOk)
|
||||
{
|
||||
var DomainAll = CreatAssetWindow.GetCreatDomainAll();
|
||||
foreach (var domain in DomainAll)
|
||||
{
|
||||
CreatAssetWindow.CreateDomainDirectory(domain.DomainName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5388598f49c545f4ae628ad5d1b4e459
|
||||
timeCreated: 1744798434
|
||||
@@ -22,6 +22,21 @@ namespace Stary.Evo.Editor
|
||||
this.domainList = domainList;
|
||||
}
|
||||
[HorizontalGroup(Width = 60)]
|
||||
[Button("", Icon = SdfIconType.ArrowRepeat, IconAlignment = IconAlignment.RightEdge)]
|
||||
public void CreatDomain()
|
||||
{
|
||||
if (DomainName == "Main")
|
||||
{
|
||||
EditorUtility.DisplayDialog("提示", "主包Main作用域无法再次创建", "确定");
|
||||
return;
|
||||
}
|
||||
bool isOk = EditorUtility.DisplayDialog("提示", "是否检索并创建缺失目录", "是", "否");
|
||||
if (isOk)
|
||||
{
|
||||
CreatAssetWindow.CreateDomainDirectory(DomainName);
|
||||
}
|
||||
}
|
||||
[HorizontalGroup(Width = 60)]
|
||||
[Button("", Icon = SdfIconType.XCircle, IconAlignment = IconAlignment.RightEdge)]
|
||||
public void CloseDomain()
|
||||
{
|
||||
@@ -40,5 +55,6 @@ namespace Stary.Evo.Editor
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -25,11 +25,11 @@ namespace Stary.Evo.Editor
|
||||
get { return Application.dataPath + "/Domain"; }
|
||||
}
|
||||
|
||||
// public static string AtlasRemotedRoot
|
||||
// {
|
||||
// get { return Application.dataPath + "/AddressableRes/Sprites"; }
|
||||
// }
|
||||
//
|
||||
public static string MainDomainRoot
|
||||
{
|
||||
get { return Application.dataPath + "/Main"; }
|
||||
}
|
||||
|
||||
// public static string SpriteRemotedAtlas
|
||||
// {
|
||||
// get { return Application.dataPath + "/AddressableRes/SpriteAtlas"; }
|
||||
@@ -134,6 +134,7 @@ namespace Stary.Evo.Editor
|
||||
|
||||
|
||||
//copydll
|
||||
if(!BuildAssetWindow.GetBuildPackageName().Equals("Main"))
|
||||
AddHotfixAddressableDll();
|
||||
//清空用户旧数据
|
||||
|
||||
@@ -153,10 +154,14 @@ namespace Stary.Evo.Editor
|
||||
HotfixMainResDomain hotfixMainResDomain = AssetDatabase.LoadAssetAtPath<HotfixMainResDomain>(configPath);
|
||||
packageName = hotfixMainResDomain.hotfixMainResDomainEntity.domain;
|
||||
Mark();
|
||||
if(!BuildAssetWindow.GetBuildPackageName().Equals("Main"))
|
||||
CreateRes(packageName,
|
||||
$"{DomainRoot}/{BuildAssetWindow.GetBuildPackageName()}/AddressableRes",
|
||||
$"{DomainRoot}/{BuildAssetWindow.GetBuildPackageName()}/HotUpdate");
|
||||
|
||||
else
|
||||
CreateRes(packageName,
|
||||
$"{DomainRoot}/{BuildAssetWindow.GetBuildPackageName()}/AddressableRes",
|
||||
$"{MainDomainRoot}/Script/Runtime/HotUpdate");
|
||||
EditorUtility.DisplayDialog("自动标记", "自动标记成功", "确定");
|
||||
}
|
||||
|
||||
|
||||
3
Assets/00.StaryEvo/Editor/PlayerSettings.meta
Normal file
3
Assets/00.StaryEvo/Editor/PlayerSettings.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f1b6f2585f9e4815aa16759ec152b390
|
||||
timeCreated: 1744611618
|
||||
@@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
using Stary.Evo.Editor;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo
|
||||
{
|
||||
[CustomEditor(typeof(MainDomainAll))]
|
||||
public class MainDomainAllEditor : UnityEditor.Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
if (GUILayout.Button("生成点位集合数据"))
|
||||
{
|
||||
var domainAll = CreatAssetWindow.GetCreatDomainAll();
|
||||
List<VideoDomainEntity> videoDomainEntities = new List<VideoDomainEntity>();
|
||||
for (int i = 0; i < domainAll.Count; i++)
|
||||
{
|
||||
if (domainAll[i].DomainName != "Main")
|
||||
videoDomainEntities.Add(new VideoDomainEntity()
|
||||
{
|
||||
domainName = domainAll[i].DomainName,
|
||||
});
|
||||
}
|
||||
|
||||
// string configPath = $"Assets/Main/Resources/MainDomainAll.asset";
|
||||
// MainDomainAll targetComponent =
|
||||
// AssetDatabase.LoadAssetAtPath<MainDomainAll>(configPath);
|
||||
var targetComponent = target as MainDomainAll;
|
||||
if (targetComponent != null)
|
||||
{
|
||||
targetComponent.domainAll = videoDomainEntities.ToArray();
|
||||
}
|
||||
EditorUtility.SetDirty(targetComponent);
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a9f7b7d280094f2e8f6aed8be7314b75
|
||||
timeCreated: 1744611639
|
||||
@@ -6,7 +6,8 @@
|
||||
"GUID:c5ecc461727906345a35491a0440694f",
|
||||
"GUID:4d1926c9df5b052469a1c63448b7609a",
|
||||
"GUID:e34a5702dd353724aa315fb8011f08c3",
|
||||
"GUID:9343e3f36d5deca4880d49f48b3fa2b1"
|
||||
"GUID:9343e3f36d5deca4880d49f48b3fa2b1",
|
||||
"GUID:ec45849e30ba03e4dab386099d8c697b"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
|
||||
25
Assets/00.StaryEvo/Runtime/PlayerSettings/MainDomainAll.cs
Normal file
25
Assets/00.StaryEvo/Runtime/PlayerSettings/MainDomainAll.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace Stary.Evo
|
||||
{
|
||||
[CreateAssetMenu(fileName = "MainDomainAll", menuName = "Evo/Create MainDomainAll")]
|
||||
public class MainDomainAll : ScriptableObject
|
||||
{
|
||||
public VideoDomainEntity[] domainAll;
|
||||
|
||||
|
||||
|
||||
}
|
||||
[Serializable]
|
||||
public struct VideoDomainEntity
|
||||
{
|
||||
public bool isVideo;
|
||||
public string domainName;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2745f06c743a4d8aaf3d993312e39f02
|
||||
timeCreated: 1744603367
|
||||
31
Assets/00.StaryEvo/Runtime/Utility/FSM/DefaultState.cs
Normal file
31
Assets/00.StaryEvo/Runtime/Utility/FSM/DefaultState.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
|
||||
namespace Stary.Evo
|
||||
{
|
||||
public class DefaultState : AbstractFSMIState
|
||||
{
|
||||
public DefaultState(IFsmSystem system) : base(system)
|
||||
{
|
||||
|
||||
}
|
||||
public override UniTask OnExitAsync()
|
||||
{
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
public override UniTask OnEnterAsync()
|
||||
{
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
public override UniTask OnEnterAsync<T>(T param)
|
||||
{
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
public override UniTask OnEnterAsync<T1, T2>(T1 param1, T2 param2)
|
||||
{
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa9b0b9ba7a849f597744565a49bd61a
|
||||
timeCreated: 1744547550
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo
|
||||
@@ -6,20 +7,24 @@ namespace Stary.Evo
|
||||
public interface FSMIState {
|
||||
IFsmSystem FsmSystem { get; }
|
||||
string Name { get; }
|
||||
float Timer { get; set; }
|
||||
|
||||
//进入该状态时调用
|
||||
void OnEnter();
|
||||
UniTask OnEnterAsync();
|
||||
|
||||
UniTask OnEnterAsync<T>(T param);
|
||||
|
||||
UniTask OnEnterAsync<T1,T2>(T1 param1, T2 param2);
|
||||
//每帧调用
|
||||
void OnUpdate();
|
||||
//退出该状态时调用
|
||||
void OnExit();
|
||||
|
||||
UniTask OnExitAsync();
|
||||
}
|
||||
|
||||
public abstract class AbstractFSMIState : FSMIState
|
||||
{
|
||||
public IFsmSystem FsmSystem { get; }
|
||||
public string Name { get; }
|
||||
public abstract float Timer { get; set; }
|
||||
|
||||
public AbstractFSMIState(IFsmSystem system)
|
||||
{
|
||||
@@ -27,13 +32,17 @@ namespace Stary.Evo
|
||||
Name = GetType().Name;
|
||||
}
|
||||
|
||||
public abstract void OnEnter();
|
||||
public abstract UniTask OnEnterAsync<T>(T param);
|
||||
|
||||
public abstract UniTask OnEnterAsync<T1,T2>(T1 param1, T2 param2);
|
||||
public abstract UniTask OnEnterAsync();
|
||||
public virtual void OnUpdate()
|
||||
{
|
||||
Timer += Time.deltaTime;
|
||||
// Timer += Time.deltaTime;
|
||||
}
|
||||
|
||||
public abstract void OnExit();
|
||||
|
||||
|
||||
public abstract UniTask OnExitAsync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo
|
||||
@@ -8,7 +9,9 @@ namespace Stary.Evo
|
||||
FSMIState CurState { get; set; }
|
||||
void AddState(FSMIState state);
|
||||
void RemoveState(FSMIState state);
|
||||
void SetCurState(string name);
|
||||
UniTask SetCurState(string name);
|
||||
UniTask SetCurState<T>(string name, T param);
|
||||
UniTask SetCurState<T1, T2>(string name, T1 param1, T2 param2);
|
||||
FSMIState GetStateWithName(string name);
|
||||
HashMap<string, FSMIState> States { get; set; }
|
||||
}
|
||||
@@ -21,6 +24,7 @@ namespace Stary.Evo
|
||||
public FsmSystem()
|
||||
{
|
||||
States = new HashMap<string, FSMIState>();
|
||||
AddState(new DefaultState(this));
|
||||
}
|
||||
|
||||
public void AddState(FSMIState state)
|
||||
@@ -48,13 +52,55 @@ namespace Stary.Evo
|
||||
}
|
||||
}
|
||||
|
||||
public void SetCurState(string name)
|
||||
/// <summary>
|
||||
/// 普通状态切换,适用于无参
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
public async UniTask SetCurState(string name)
|
||||
{
|
||||
if (CurState != null)
|
||||
CurState.OnExit();
|
||||
await CurState.OnExitAsync();
|
||||
FSMIState state = GetStateWithName(name);
|
||||
CurState = state;
|
||||
CurState.OnEnter();
|
||||
CurState.OnEnterAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步状态切换,适用于有参
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="param"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public async UniTask SetCurState<T>(string name, T param)
|
||||
{
|
||||
if (CurState != null)
|
||||
{
|
||||
await CurState.OnExitAsync();
|
||||
}
|
||||
|
||||
FSMIState state = GetStateWithName(name);
|
||||
CurState = state;
|
||||
await CurState.OnEnterAsync(param);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 异步状态切换,适用于有参
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="param1"></param>
|
||||
/// <param name="param2"></param>
|
||||
/// <typeparam name="T1"></typeparam>
|
||||
/// <typeparam name="T2"></typeparam>
|
||||
public async UniTask SetCurState<T1, T2>(string name, T1 param1, T2 param2)
|
||||
{
|
||||
if (CurState != null)
|
||||
{
|
||||
await CurState.OnExitAsync();
|
||||
}
|
||||
|
||||
FSMIState state = GetStateWithName(name);
|
||||
CurState = state;
|
||||
await CurState.OnEnterAsync(param1, param2);
|
||||
}
|
||||
|
||||
public FSMIState GetStateWithName(string name)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "com.staryevo.main",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.15",
|
||||
"displayName": "00.StaryEvo",
|
||||
"description": "This is an Framework package",
|
||||
"unity": "2021.3",
|
||||
@@ -17,7 +17,8 @@
|
||||
"dependencies": {
|
||||
"com.cysharp.unitask": "2.5.10",
|
||||
"com.code-philosophy.hybridclr": "4.0.15",
|
||||
"com.tuyoogame.yooasset": "2.3.7"
|
||||
"com.tuyoogame.yooasset": "2.3.7",
|
||||
"com.staryevo.informationsave": "1.x.x"
|
||||
},
|
||||
"samples": [
|
||||
{
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
"name": "TableTextConversion.Editor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:66fdc96a271fc954e9da30c76a486d9c"
|
||||
"TableTextConversion.RunTime"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using Stary.Evo.TableTextConversion;
|
||||
|
||||
public class Test : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
/*async void Start()
|
||||
{
|
||||
Task<AudioTableData> audioTableData = ReadDumpInformation.Read<AudioTableData>();
|
||||
await audioTableData;
|
||||
AudioTableData data = audioTableData.Result;
|
||||
if (data != null)
|
||||
{
|
||||
Debug.Log($"UnityEvo:{data.infos[3].name}");
|
||||
}
|
||||
}*/
|
||||
void Start()
|
||||
{
|
||||
AudioTableData audioTableData = ReadDumpInformation.ReadInEditor<AudioTableData>();
|
||||
if (audioTableData != null)
|
||||
{
|
||||
Debug.Log($"UnityEvo:{audioTableData.infos[3].name}");
|
||||
}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5cc8857da4ee2534289add72195af962
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "com.staryevo.tabletextconversion",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.4",
|
||||
"displayName": "05.TableTextConversion",
|
||||
"description": "表格转化工具",
|
||||
"unity": "2021.3",
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 639fe5e44b4245e48b45ae80da27e408
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1 +0,0 @@
|
||||
# Rokid语音命令工具
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2007d74d73bee7d468ab76b4f3466708
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d1654ed807ee7c24c94cab4c172e6f91
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 073d8fadbb202ad42a540fd5299555c3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"name": "RKVoiceCommand.RunTime",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:6447e10b87dc140ab924878c1ecef665",
|
||||
"GUID:fe14bc9dd681249d19cf4ef377c7e29e",
|
||||
"GUID:d1a793c2b6959e04ea45b972eaa369c8"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
<<<<<<<< HEAD:Assets/05.TableTextConversion/Editor/Excel.meta
|
||||
guid: 10c9b58b77ad42b4193e2a393b1a9899
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
========
|
||||
guid: 44e8639d57fc2a94b94ecef44bf1e36a
|
||||
AssemblyDefinitionImporter:
|
||||
>>>>>>>> 04.AudioCore:Assets/04.AudioCore/RunTime/AudioCore.RunTime.asmdef.meta
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f55b7179dceeae47826f4f0f08ba3fd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c1e566c37939b1c45885d8ca929414a7
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user