mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
重置2.0.0(beta)
重置2.0.0(beta)
This commit is contained in:
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1,71 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>ExcelDataReader.DataSet</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:ExcelDataReader.ExcelDataReaderExtensions">
|
||||
<summary>
|
||||
ExcelDataReader DataSet extensions
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:ExcelDataReader.ExcelDataReaderExtensions.AsDataSet(ExcelDataReader.IExcelDataReader,ExcelDataReader.ExcelDataSetConfiguration)">
|
||||
<summary>
|
||||
Converts all sheets to a DataSet
|
||||
</summary>
|
||||
<param name="self">The IExcelDataReader instance</param>
|
||||
<param name="configuration">An optional configuration object to modify the behavior of the conversion</param>
|
||||
<returns>A dataset with all workbook contents</returns>
|
||||
</member>
|
||||
<member name="T:ExcelDataReader.ExcelDataSetConfiguration">
|
||||
<summary>
|
||||
Processing configuration options and callbacks for IExcelDataReader.AsDataSet().
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.UseColumnDataType">
|
||||
<summary>
|
||||
Gets or sets a value indicating whether to set the DataColumn.DataType property in a second pass.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.ConfigureDataTable">
|
||||
<summary>
|
||||
Gets or sets a callback to obtain configuration options for a DataTable.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ExcelDataReader.ExcelDataSetConfiguration.FilterSheet">
|
||||
<summary>
|
||||
Gets or sets a callback to determine whether to include the current sheet in the DataSet. Called once per sheet before ConfigureDataTable.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:ExcelDataReader.ExcelDataTableConfiguration">
|
||||
<summary>
|
||||
Processing configuration options and callbacks for AsDataTable().
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.EmptyColumnNamePrefix">
|
||||
<summary>
|
||||
Gets or sets a value indicating the prefix of generated column names.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.UseHeaderRow">
|
||||
<summary>
|
||||
Gets or sets a value indicating whether to use a row from the data as column names.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.ReadHeaderRow">
|
||||
<summary>
|
||||
Gets or sets a callback to determine which row is the header row. Only called when UseHeaderRow = true.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.FilterRow">
|
||||
<summary>
|
||||
Gets or sets a callback to determine whether to include the current row in the DataTable.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:ExcelDataReader.ExcelDataTableConfiguration.FilterColumn">
|
||||
<summary>
|
||||
Gets or sets a callback to determine whether to include the specific column in the DataTable. Called once per column after reading the headers.
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
|
||||
</startup>
|
||||
</configuration>
|
@@ -1,15 +0,0 @@
|
||||
@SET EXCEL_FOLDER=xls
|
||||
@SET JSON_FOLDER=..\..\TResources\Config
|
||||
@SET EXE= Tools\excel2json\excel2json.exe
|
||||
@SET CsharpPath=..\..\ConfigStruct
|
||||
|
||||
@ECHO Del old Config...
|
||||
del %JSON_FOLDER% /S /Q
|
||||
del %CsharpPath% /S /Q
|
||||
|
||||
@ECHO Converting excel files in folder %EXCEL_FOLDER% ...
|
||||
for /f "delims=" %%i in ('dir /b /a-d /s %EXCEL_FOLDER%\*.xlsx') do (
|
||||
@echo processing %%~nxi
|
||||
@CALL %EXE% --excel %EXCEL_FOLDER%\%%~nxi --json %JSON_FOLDER%\%%~ni.json --p %CsharpPath%\%%~ni.cs --header 3 --cell_json true --exclude_prefix #
|
||||
)
|
||||
pause
|
@@ -1,15 +0,0 @@
|
||||
@SET EXCEL_FOLDER=xls
|
||||
@SET JSON_FOLDER=..\..\TResources\Config
|
||||
@SET EXE= Tools\excel2json\excel2json.exe
|
||||
@SET CsharpPath=..\..\ConfigStruct
|
||||
|
||||
@ECHO Del old Config...
|
||||
del %JSON_FOLDER% /S /Q
|
||||
del %CsharpPath% /S /Q
|
||||
|
||||
@ECHO Converting excel files in folder %EXCEL_FOLDER% ...
|
||||
for /f "delims=" %%i in ('dir /b /a-d /s %EXCEL_FOLDER%\*.xlsx') do (
|
||||
@echo processing %%~nxi
|
||||
@CALL %EXE% --excel %EXCEL_FOLDER%\%%~nxi --json %JSON_FOLDER%\%%~ni.json --p %CsharpPath%\%%~ni.cs --header 3 --cell_json true --a --exclude_prefix #
|
||||
)
|
||||
pause
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,421 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using LitJson;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace TEngine.Editor
|
||||
{
|
||||
public class PackageManagerInternal : EditorWindow
|
||||
{
|
||||
private const string OnlineUrl = "http://1.12.241.46:8081/TEngine/";
|
||||
|
||||
[MenuItem("TEngine/模块商店|在线Package Manager", priority = 1500)]
|
||||
private static void Open()
|
||||
{
|
||||
var window = GetWindow<PackageManagerInternal>("在线模块商店|Package Manager");
|
||||
window.minSize = new Vector2(600f, 400f);
|
||||
window.Show();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 资源包数据结构
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
private class PackageTemplate
|
||||
{
|
||||
/// <summary>
|
||||
/// 名称
|
||||
/// </summary>
|
||||
public string name = string.Empty;
|
||||
/// <summary>
|
||||
/// 作者
|
||||
/// </summary>
|
||||
public string author = string.Empty;
|
||||
/// <summary>
|
||||
/// 版本
|
||||
/// </summary>
|
||||
public string version = string.Empty;
|
||||
/// <summary>
|
||||
/// 发布日期
|
||||
/// </summary>
|
||||
public string releasedDate = string.Empty;
|
||||
/// <summary>
|
||||
/// 简介
|
||||
/// </summary>
|
||||
public string description = string.Empty;
|
||||
/// <summary>
|
||||
/// 依赖项
|
||||
/// </summary>
|
||||
public string[] dependencies = null;
|
||||
}
|
||||
|
||||
//资源包信息列表
|
||||
private List<List<PackageTemplate>> packages;
|
||||
//折叠状态
|
||||
private Dictionary<string, bool> foldoutDic;
|
||||
//列表滚动视图
|
||||
private Vector2 listScroll;
|
||||
//最后更新日期
|
||||
private string lastUpdateDate;
|
||||
//当前选中的资源包信息
|
||||
private PackageTemplate currentSelected;
|
||||
//搜索内容
|
||||
private string searchContent;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
packages = new List<List<PackageTemplate>>();
|
||||
foldoutDic = new Dictionary<string, bool>();
|
||||
EditorCoroutineRunner.StartEditorCoroutine(GetPackagesInfo());
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
//水平布局
|
||||
GUILayout.BeginHorizontal("Toolbar");
|
||||
{
|
||||
//搜索
|
||||
OnSearchGUI();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
//水平布局
|
||||
GUILayout.BeginHorizontal(GUILayout.ExpandHeight(true));
|
||||
{
|
||||
//垂直布局 设置左侧列表宽度
|
||||
GUILayout.BeginVertical(GUILayout.Width(200f));
|
||||
{
|
||||
//绘制列表
|
||||
OnListGUI();
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
|
||||
//分割线
|
||||
GUILayout.Box(string.Empty, "EyeDropperVerticalLine", GUILayout.ExpandHeight(true), GUILayout.Width(1f));
|
||||
|
||||
//垂直布局
|
||||
GUILayout.BeginVertical(GUILayout.ExpandHeight(true));
|
||||
{
|
||||
//绘制详情
|
||||
OnDetailGUI();
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void OnSearchGUI()
|
||||
{
|
||||
var newSearchContent = GUILayout.TextField(searchContent, "SearchTextField");
|
||||
if (newSearchContent != searchContent)
|
||||
{
|
||||
searchContent = newSearchContent;
|
||||
currentSelected = null;
|
||||
Repaint();
|
||||
}
|
||||
if (UnityEngine.Event.current.type == EventType.MouseDown && !GUILayoutUtility.GetLastRect().Contains(UnityEngine.Event.current.mousePosition))
|
||||
{
|
||||
GUI.FocusControl(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnListGUI()
|
||||
{
|
||||
//滚动视图
|
||||
listScroll = GUILayout.BeginScrollView(listScroll);
|
||||
{
|
||||
GUIStyle versionStyle = new GUIStyle(GUI.skin.label) { fontStyle = FontStyle.Italic };
|
||||
for (int i = 0; i < packages.Count; i++)
|
||||
{
|
||||
List<PackageTemplate> list = packages[i];
|
||||
PackageTemplate first = list[0];
|
||||
if (!string.IsNullOrEmpty(searchContent) && !first.name.ToLower().Contains(searchContent.ToLower())) continue;
|
||||
if (foldoutDic[first.name])
|
||||
{
|
||||
foldoutDic[first.name] = EditorGUILayout.Foldout(foldoutDic[first.name], first.name);
|
||||
for (int n = 0; n < list.Count; n++)
|
||||
{
|
||||
GUILayout.BeginHorizontal(currentSelected == list[n] ? "SelectionRect" : "IN Title");
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.Label(list[n].version, versionStyle);
|
||||
GUILayout.Space(30f);
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
if (GUILayoutUtility.GetLastRect().Contains(UnityEngine.Event.current.mousePosition) && UnityEngine.Event.current.type == EventType.MouseDown)
|
||||
{
|
||||
currentSelected = list[n];
|
||||
UnityEngine.Event.current.Use();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GUILayout.BeginHorizontal(currentSelected == first ? "SelectionRect" : "Toolbar");
|
||||
{
|
||||
foldoutDic[first.name] = EditorGUILayout.Foldout(foldoutDic[first.name], first.name);
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.Label(first.version, versionStyle);
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
//鼠标点击选中
|
||||
if (GUILayoutUtility.GetLastRect().Contains(UnityEngine.Event.current.mousePosition) && UnityEngine.Event.current.type == EventType.MouseDown)
|
||||
{
|
||||
currentSelected = first;
|
||||
UnityEngine.Event.current.Use();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
GUILayout.EndScrollView();
|
||||
|
||||
//分割线
|
||||
GUILayout.Box(string.Empty, "EyeDropperHorizontalLine", GUILayout.ExpandWidth(true), GUILayout.Height(1f));
|
||||
|
||||
//水平布局 设置高度
|
||||
GUILayout.BeginHorizontal(GUILayout.Height(23f));
|
||||
{
|
||||
//最后更新日期
|
||||
GUILayout.Label(lastUpdateDate);
|
||||
//刷新按钮
|
||||
if (GUILayout.Button(EditorGUIUtility.IconContent("Refresh"), GUILayout.Width(30f)))
|
||||
{
|
||||
//清空当前的资源包信息列表
|
||||
packages.Clear();
|
||||
//清空折叠栏信息
|
||||
foldoutDic.Clear();
|
||||
//当前选中的资源包设为空
|
||||
currentSelected = null;
|
||||
//发起网络请求
|
||||
EditorCoroutineRunner.StartEditorCoroutine(GetPackagesInfo());
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
private void OnDetailGUI()
|
||||
{
|
||||
if (currentSelected != null)
|
||||
{
|
||||
//名称
|
||||
GUILayout.Label(currentSelected.name, new GUIStyle(GUI.skin.label) { fontSize = 25, fontStyle = FontStyle.Bold });
|
||||
EditorGUILayout.Space();
|
||||
//作者
|
||||
GUILayout.Label(currentSelected.author, new GUIStyle(GUI.skin.label) { fontSize = 12 });
|
||||
EditorGUILayout.Space();
|
||||
//版本 + 发布日期
|
||||
GUILayout.Label($"Version {currentSelected.version} - {currentSelected.releasedDate}", new GUIStyle(GUI.skin.label) { fontSize = 14, fontStyle = FontStyle.Bold });
|
||||
EditorGUILayout.Space();
|
||||
|
||||
//分割线
|
||||
GUILayout.Box(string.Empty, GUILayout.ExpandWidth(true), GUILayout.Height(1f));
|
||||
|
||||
//简介
|
||||
GUILayout.Label(currentSelected.description);
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
|
||||
//分割线
|
||||
GUILayout.Box(string.Empty, "EyeDropperHorizontalLine", GUILayout.ExpandWidth(true), GUILayout.Height(1f));
|
||||
|
||||
//水平布局 设置高度
|
||||
GUILayout.BeginHorizontal(GUILayout.Height(21f));
|
||||
{
|
||||
GUILayout.FlexibleSpace();
|
||||
//下载并导入
|
||||
if (GUILayout.Button("Import", GUILayout.Width(50f)))
|
||||
{
|
||||
if (currentSelected != null)
|
||||
{
|
||||
EditorCoroutineRunner.StartEditorCoroutine(DownloadPackage(currentSelected));
|
||||
}
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
//获取资源包信息
|
||||
private IEnumerator GetPackagesInfo()
|
||||
{
|
||||
string url = $"{OnlineUrl}packages.json";
|
||||
UnityWebRequest www = UnityWebRequest.Get(url);
|
||||
UnityWebRequestAsyncOperation request = www.SendWebRequest();
|
||||
while (true)
|
||||
{
|
||||
if (request.isDone)
|
||||
break;
|
||||
}
|
||||
yield return request.isDone;
|
||||
if (www.error == null)
|
||||
{
|
||||
List<PackageTemplate> list = JsonMapper.ToObject<List<PackageTemplate>>(www.downloadHandler.text);
|
||||
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
var package = list[i] as PackageTemplate;
|
||||
//查找列表中是否已经存在该资源包其他版本
|
||||
int index = packages.FindIndex(m => m != null && m.Count > 0 && m[0].name == package.name);
|
||||
if (index == -1)
|
||||
{
|
||||
var newList = new List<PackageTemplate> { package };
|
||||
packages.Add(newList);
|
||||
foldoutDic.Add(package.name, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
packages[index].Add(package);
|
||||
}
|
||||
}
|
||||
//更新最后刷新日期
|
||||
lastUpdateDate = DateTime.Now.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError(www.error);
|
||||
}
|
||||
}
|
||||
//下载并导入资源包
|
||||
private IEnumerator DownloadPackage(PackageTemplate package)
|
||||
{
|
||||
string url = $"{OnlineUrl}packages/{package.name}/{package.version}/{package.name}.unitypackage";
|
||||
//Debug.Log(url);
|
||||
UnityWebRequest www = UnityWebRequest.Get(url);
|
||||
UnityWebRequestAsyncOperation request = www.SendWebRequest();
|
||||
while (true)
|
||||
{
|
||||
if (request.isDone)
|
||||
break;
|
||||
}
|
||||
yield return request.isDone;
|
||||
if (www.error == null)
|
||||
{
|
||||
byte[] bytes = www.downloadHandler.data;
|
||||
string path = $"{Application.dataPath}/{package.name}-{package.version}.unitypackage";
|
||||
//写入本地
|
||||
using (FileStream fs = new FileStream(path, FileMode.Create))
|
||||
{
|
||||
fs.Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
//导入
|
||||
AssetDatabase.ImportPackage(path, false);
|
||||
//删除
|
||||
File.Delete(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError(www.error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class EditorCoroutineRunner
|
||||
{
|
||||
private class EditorCoroutine : IEnumerator
|
||||
{
|
||||
private Stack<IEnumerator> executionStack;
|
||||
|
||||
public EditorCoroutine(IEnumerator iterator)
|
||||
{
|
||||
executionStack = new Stack<IEnumerator>();
|
||||
executionStack.Push(iterator);
|
||||
}
|
||||
|
||||
public bool MoveNext()
|
||||
{
|
||||
IEnumerator i = executionStack.Peek();
|
||||
|
||||
if (i.MoveNext())
|
||||
{
|
||||
object result = i.Current;
|
||||
if (result != null && result is IEnumerator)
|
||||
{
|
||||
executionStack.Push((IEnumerator)result);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (executionStack.Count > 1)
|
||||
{
|
||||
executionStack.Pop();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
throw new NotSupportedException("This Operation Is Not Supported.");
|
||||
}
|
||||
|
||||
public object Current
|
||||
{
|
||||
get { return executionStack.Peek().Current; }
|
||||
}
|
||||
|
||||
public bool Find(IEnumerator iterator)
|
||||
{
|
||||
return executionStack.Contains(iterator);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<EditorCoroutine> editorCoroutineList;
|
||||
private static List<IEnumerator> buffer;
|
||||
|
||||
public static IEnumerator StartEditorCoroutine(IEnumerator iterator)
|
||||
{
|
||||
if (editorCoroutineList == null)
|
||||
{
|
||||
editorCoroutineList = new List<EditorCoroutine>();
|
||||
}
|
||||
if (buffer == null)
|
||||
{
|
||||
buffer = new List<IEnumerator>();
|
||||
}
|
||||
if (editorCoroutineList.Count == 0)
|
||||
{
|
||||
EditorApplication.update += Update;
|
||||
}
|
||||
buffer.Add(iterator);
|
||||
return iterator;
|
||||
}
|
||||
|
||||
private static bool Find(IEnumerator iterator)
|
||||
{
|
||||
foreach (EditorCoroutine editorCoroutine in editorCoroutineList)
|
||||
{
|
||||
if (editorCoroutine.Find(iterator))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void Update()
|
||||
{
|
||||
editorCoroutineList.RemoveAll(coroutine => { return coroutine.MoveNext() == false; });
|
||||
if (buffer.Count > 0)
|
||||
{
|
||||
foreach (IEnumerator iterator in buffer)
|
||||
{
|
||||
if (!Find(iterator))
|
||||
{
|
||||
editorCoroutineList.Add(new EditorCoroutine(iterator));
|
||||
}
|
||||
}
|
||||
buffer.Clear();
|
||||
}
|
||||
if (editorCoroutineList.Count == 0)
|
||||
{
|
||||
EditorApplication.update -= Update;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,78 +0,0 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TEngine.Editor
|
||||
{
|
||||
public class TEngineWindow : EditorWindow
|
||||
{
|
||||
public enum ModuleType
|
||||
{
|
||||
/// <summary>
|
||||
/// 存在Package中
|
||||
/// </summary>
|
||||
InPackage,
|
||||
/// <summary>
|
||||
/// 存在项目中
|
||||
/// </summary>
|
||||
InProject
|
||||
}
|
||||
public static ModuleType showModuleType;
|
||||
|
||||
[MenuItem("TEngine/管理面板|TEngine管理面板", priority = 1500)]
|
||||
private static void Open()
|
||||
{
|
||||
var window = GetWindow<TEngineWindow>("管理面板|TEngine管理面板");
|
||||
window.minSize = new Vector2(900, 600);
|
||||
window.maxSize = new Vector2(900, 600);
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
showModuleType = (ModuleType)EditorPrefs.GetInt("showModuleType", 0);
|
||||
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
//水平布局
|
||||
GUILayout.BeginHorizontal("Toolbar");
|
||||
{
|
||||
//搜索
|
||||
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
//水平布局
|
||||
GUILayout.BeginHorizontal(GUILayout.ExpandHeight(true));
|
||||
{
|
||||
//垂直布局 设置左侧列表宽度
|
||||
GUILayout.BeginVertical(GUILayout.Width(200f));
|
||||
{
|
||||
//绘制列表
|
||||
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
|
||||
//分割线
|
||||
GUILayout.Box(string.Empty, "EyeDropperVerticalLine", GUILayout.ExpandHeight(true), GUILayout.Width(1f));
|
||||
|
||||
//垂直布局
|
||||
GUILayout.BeginVertical(GUILayout.ExpandHeight(true));
|
||||
{
|
||||
//绘制详情
|
||||
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -1,77 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TEngine.Editor
|
||||
{
|
||||
[CustomEditor(typeof(MemPoolComponent))]
|
||||
internal sealed class MemPoolInspector : TEngineInspector
|
||||
{
|
||||
private readonly HashSet<string> m_OpenedItems = new HashSet<string>();
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.OnInspectorGUI();
|
||||
|
||||
if (!EditorApplication.isPlaying)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Available during runtime only.", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
|
||||
MemPoolComponent t = (MemPoolComponent)target;
|
||||
|
||||
if (IsPrefabInHierarchy(t.gameObject))
|
||||
{
|
||||
EditorGUILayout.LabelField("Object Pool Count", t.Count.ToString());
|
||||
|
||||
var objectPools = t.GetAllObjectPools();
|
||||
foreach (var objectPool in objectPools)
|
||||
{
|
||||
DrawObjectPool(objectPool);
|
||||
}
|
||||
}
|
||||
|
||||
Repaint();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
}
|
||||
|
||||
private void DrawObjectPool(IMemPoolBase objectPool)
|
||||
{
|
||||
bool lastState = m_OpenedItems.Contains(objectPool.GetName());
|
||||
bool currentState = EditorGUILayout.Foldout(lastState, objectPool.GetName());
|
||||
if (currentState != lastState)
|
||||
{
|
||||
if (currentState)
|
||||
{
|
||||
m_OpenedItems.Add(objectPool.GetName());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_OpenedItems.Remove(objectPool.GetName());
|
||||
}
|
||||
}
|
||||
|
||||
if (currentState)
|
||||
{
|
||||
EditorGUILayout.BeginVertical("box");
|
||||
{
|
||||
EditorGUILayout.LabelField("Name", objectPool.GetName());
|
||||
EditorGUILayout.LabelField("Type", objectPool.GetName());
|
||||
EditorGUILayout.LabelField("Capacity", objectPool.GetPoolItemCount().ToString());
|
||||
EditorGUILayout.LabelField("Used Count", objectPool.GetPoolItemCount().ToString());
|
||||
EditorGUILayout.LabelField("Can Release Count", objectPool.GetPoolItemCount().ToString());
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
|
||||
EditorGUILayout.Separator();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor.UI;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
[CustomEditor(typeof(LocalizeText), true)]
|
||||
[CanEditMultipleObjects]
|
||||
public class LocalizeTextEditor : TextEditor
|
||||
{
|
||||
public SerializedProperty Key;
|
||||
|
||||
protected override void OnEnable()
|
||||
{
|
||||
UnityEngine.Debug.Log(serializedObject.FindProperty("Key"));
|
||||
base.OnEnable();
|
||||
Key = serializedObject.FindProperty("Key");
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
EditorGUILayout.Space();
|
||||
serializedObject.Update();
|
||||
EditorGUILayout.PropertyField(Key);
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
base.OnInspectorGUI();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,98 +0,0 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Copyright (c) TEngine. All rights reserved.
|
||||
// Author: TangXiao
|
||||
// Date: 2022/5/14 16:29:13
|
||||
//-----------------------------------------------------------------------
|
||||
const http = require("http");
|
||||
const url = require("url");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const mime = {
|
||||
css: "text/css",
|
||||
gif: "image/gif",
|
||||
html: "text/html",
|
||||
ico: "image/x-icon",
|
||||
jpeg: "image/jpeg",
|
||||
jpg: "image/jpeg",
|
||||
js: "text/javascript",
|
||||
json: "application/json",
|
||||
pdf: "application/pdf",
|
||||
png: "image/png",
|
||||
svg: "image/svg+xml",
|
||||
swf: "application/x-shockwave-flash",
|
||||
tiff: "image/tiff",
|
||||
txt: "text/plain",
|
||||
wav: "audio/x-wav",
|
||||
wma: "audio/x-ms-wma",
|
||||
wmv: "video/x-ms-wmv",
|
||||
xml: "text/xml",
|
||||
};
|
||||
const port = 8081;
|
||||
|
||||
const httpServer = http.createServer((request, response) => {
|
||||
const requestUrl = request.url;
|
||||
let pathName = url.parse(requestUrl).pathname;
|
||||
|
||||
// 对路径解码,防止中文乱码
|
||||
pathName = decodeURI(pathName);
|
||||
|
||||
// 绝对路径
|
||||
const filePath = path.resolve(__dirname + pathName);
|
||||
|
||||
// 扩展名
|
||||
let ext = path.extname(pathName);
|
||||
ext = ext ? ext.slice(1) : "unknown";
|
||||
|
||||
// 未知的类型一律用"text/plain"类型
|
||||
const contentType = mime[ext] || "text/plain";
|
||||
|
||||
// fs.stat()方法用于判断给定的路径是否存在
|
||||
fs.stat(filePath, (err, stats) => {
|
||||
// 路径不存在,则返回404
|
||||
if (err) {
|
||||
response.writeHead(404, { "content-type": "text/html" });
|
||||
response.end("<h1>404 Not Found</h1>");
|
||||
}
|
||||
// 如果是文件
|
||||
if (!err && stats.isFile()) {
|
||||
response.writeHead(200, { "content-type": contentType });
|
||||
// 建立流对象,读文件
|
||||
const stream = fs.createReadStream(filePath);
|
||||
// 错误处理
|
||||
stream.on("error", function() {
|
||||
response.writeHead(500, { "content-type": contentType });
|
||||
|
||||
response.end("<h1>500 Server Error</h1>");
|
||||
});
|
||||
// 读取文件
|
||||
stream.pipe(response);
|
||||
//response.end(); // 这个地方有坑,加了会关闭对话,看不到内容了
|
||||
}
|
||||
// 如果是路径
|
||||
if (!err && stats.isDirectory()) {
|
||||
let html = " <head><meta charset = 'utf-8'/></head>";
|
||||
// 读取该路径下文件
|
||||
fs.readdir(filePath, (err, files) => {
|
||||
if (err) {
|
||||
response.writeHead(500, { "content-type": contentType });
|
||||
response.end("<h1>路径读取失败!</h1>");
|
||||
} else {
|
||||
for (const file of files) {
|
||||
if (file === "index.html") {
|
||||
response.writeHead(200, { "content-type": "text/html" });
|
||||
response.end(file);
|
||||
break;
|
||||
}
|
||||
html += `<div><a href='${file}'>${file}</a></div>`;
|
||||
}
|
||||
response.writeHead(200, { "content-type": "text/html" });
|
||||
response.end(html);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
httpServer.listen(port, function() {
|
||||
console.log(`File Service: ${port}`);
|
||||
});
|
@@ -1 +0,0 @@
|
||||
node FileSys.js
|
@@ -1 +0,0 @@
|
||||
node FileSys.js
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 41d7a9e682596714196b30c34dba80fc
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Before Width: | Height: | Size: 201 KiB |
@@ -1,872 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0fd21678280ad9c47aa2d32baf438c5d
|
||||
TextureImporter:
|
||||
internalIDToNameTable:
|
||||
- first:
|
||||
213: 21300000
|
||||
second: spinner_square
|
||||
- first:
|
||||
213: 21300002
|
||||
second: spinner_square_thin
|
||||
- first:
|
||||
213: 21300004
|
||||
second: square
|
||||
- first:
|
||||
213: 21300006
|
||||
second: stopwatch_arrow
|
||||
- first:
|
||||
213: 21300008
|
||||
second: stopwatch
|
||||
- first:
|
||||
213: 21300010
|
||||
second: sword
|
||||
- first:
|
||||
213: 21300012
|
||||
second: dot
|
||||
- first:
|
||||
213: 21300014
|
||||
second: triangle
|
||||
- first:
|
||||
213: 21300016
|
||||
second: circle_half
|
||||
- first:
|
||||
213: 21300018
|
||||
second: circle_half_fading
|
||||
- first:
|
||||
213: 21300020
|
||||
second: circle_half_fading_2
|
||||
- first:
|
||||
213: 21300022
|
||||
second: circle_half_fading_3
|
||||
- first:
|
||||
213: 21300024
|
||||
second: circle_half_fading_4
|
||||
- first:
|
||||
213: 21300026
|
||||
second: circle_half_fading_thick
|
||||
- first:
|
||||
213: 21300028
|
||||
second: circle_half_fading_thick_2
|
||||
- first:
|
||||
213: 21300030
|
||||
second: circle_half_opacity
|
||||
- first:
|
||||
213: 21300032
|
||||
second: circle
|
||||
- first:
|
||||
213: 21300034
|
||||
second: circle_open
|
||||
- first:
|
||||
213: 21300036
|
||||
second: circle_quarter
|
||||
- first:
|
||||
213: 21300038
|
||||
second: circle_quarter_2
|
||||
- first:
|
||||
213: 21300040
|
||||
second: circle_quarter_2_opacity
|
||||
- first:
|
||||
213: 21300042
|
||||
second: circle_quarter_3
|
||||
- first:
|
||||
213: 21300044
|
||||
second: circle_quarter_opacity
|
||||
- first:
|
||||
213: 21300046
|
||||
second: cog
|
||||
- first:
|
||||
213: 21300048
|
||||
second: cog_inside
|
||||
- first:
|
||||
213: 21300050
|
||||
second: pickaxe
|
||||
- first:
|
||||
213: 21300052
|
||||
second: rectangle
|
||||
- first:
|
||||
213: 21300054
|
||||
second: rock
|
||||
- first:
|
||||
213: 21300056
|
||||
second: spinner_circle
|
||||
- first:
|
||||
213: 21300058
|
||||
second: spinner
|
||||
- first:
|
||||
213: 21300060
|
||||
second: spinner_rounded_corners
|
||||
- first:
|
||||
213: 21300062
|
||||
second: spinner_rounded_corners_thin
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: -1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 16
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
applyGammaDecoding: 1
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites:
|
||||
- serializedVersion: 2
|
||||
name: spinner_square
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 1706.6666
|
||||
width: 341.33334
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.49999982}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 02305410000000000800000000000000
|
||||
internalID: 21300000
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: spinner_square_thin
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 341
|
||||
y: 1707
|
||||
width: 340
|
||||
height: 341
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 22305410000000000800000000000000
|
||||
internalID: 21300002
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: square
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 682
|
||||
y: 1706.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 42305410000000000800000000000000
|
||||
internalID: 21300004
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: stopwatch_arrow
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1027
|
||||
y: 1709
|
||||
width: 334
|
||||
height: 336
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 62305410000000000800000000000000
|
||||
internalID: 21300006
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: stopwatch
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1364
|
||||
y: 1706.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 82305410000000000800000000000000
|
||||
internalID: 21300008
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: sword
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1705
|
||||
y: 1706.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: a2305410000000000800000000000000
|
||||
internalID: 21300010
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: dot
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 1365.6666
|
||||
width: 341.33334
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: c2305410000000000800000000000000
|
||||
internalID: 21300012
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: triangle
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 343
|
||||
y: 1366
|
||||
width: 339
|
||||
height: 339
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: e2305410000000000800000000000000
|
||||
internalID: 21300014
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_half
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 685
|
||||
y: 1368
|
||||
width: 337
|
||||
height: 336
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 03305410000000000800000000000000
|
||||
internalID: 21300016
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_half_fading
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1023
|
||||
y: 1365.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 23305410000000000800000000000000
|
||||
internalID: 21300018
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_half_fading_2
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1364
|
||||
y: 1365.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 43305410000000000800000000000000
|
||||
internalID: 21300020
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_half_fading_3
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1705
|
||||
y: 1365.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 63305410000000000800000000000000
|
||||
internalID: 21300022
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_half_fading_4
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 1024.6666
|
||||
width: 341.33334
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 83305410000000000800000000000000
|
||||
internalID: 21300024
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_half_fading_thick
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 341
|
||||
y: 1024.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: a3305410000000000800000000000000
|
||||
internalID: 21300026
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_half_fading_thick_2
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 682
|
||||
y: 1024.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: c3305410000000000800000000000000
|
||||
internalID: 21300028
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_half_opacity
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1026
|
||||
y: 1026
|
||||
width: 337
|
||||
height: 338
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: e3305410000000000800000000000000
|
||||
internalID: 21300030
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1364
|
||||
y: 1024.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 04305410000000000800000000000000
|
||||
internalID: 21300032
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_open
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1705
|
||||
y: 1024.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 24305410000000000800000000000000
|
||||
internalID: 21300034
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_quarter
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 683.6666
|
||||
width: 341.33334
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 44305410000000000800000000000000
|
||||
internalID: 21300036
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_quarter_2
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 341
|
||||
y: 683.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 64305410000000000800000000000000
|
||||
internalID: 21300038
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_quarter_2_opacity
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 682
|
||||
y: 683.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 84305410000000000800000000000000
|
||||
internalID: 21300040
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_quarter_3
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1023
|
||||
y: 683.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: a4305410000000000800000000000000
|
||||
internalID: 21300042
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: circle_quarter_opacity
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1364
|
||||
y: 683.6666
|
||||
width: 341.33337
|
||||
height: 341.33337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: c4305410000000000800000000000000
|
||||
internalID: 21300044
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: cog
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1708
|
||||
y: 685
|
||||
width: 338
|
||||
height: 337
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: e4305410000000000800000000000000
|
||||
internalID: 21300046
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: cog_inside
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 341
|
||||
width: 341
|
||||
height: 342
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 1, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 05305410000000000800000000000000
|
||||
internalID: 21300048
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: pickaxe
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 341
|
||||
y: 342.66666
|
||||
width: 341.33337
|
||||
height: 341.33334
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 25305410000000000800000000000000
|
||||
internalID: 21300050
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: rectangle
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 682
|
||||
y: 342.66666
|
||||
width: 341.33337
|
||||
height: 341.33334
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 45305410000000000800000000000000
|
||||
internalID: 21300052
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: rock
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1023
|
||||
y: 342.66666
|
||||
width: 341.33337
|
||||
height: 341.33334
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 65305410000000000800000000000000
|
||||
internalID: 21300054
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: spinner_circle
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1364
|
||||
y: 342.66666
|
||||
width: 341.33337
|
||||
height: 341.33334
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 85305410000000000800000000000000
|
||||
internalID: 21300056
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: spinner
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 1705
|
||||
y: 343
|
||||
width: 341
|
||||
height: 338
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: a5305410000000000800000000000000
|
||||
internalID: 21300058
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: spinner_rounded_corners
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 1.6666565
|
||||
width: 341.33334
|
||||
height: 341.33334
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: c5305410000000000800000000000000
|
||||
internalID: 21300060
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: spinner_rounded_corners_thin
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 341
|
||||
y: 1.6666565
|
||||
width: 341.33337
|
||||
height: 341.33334
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: e5305410000000000800000000000000
|
||||
internalID: 21300062
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f30142cce1e8ff4ba8f043eaac4dcdc
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,329 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!74 &7400000
|
||||
AnimationClip:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: pulsing_4_1
|
||||
serializedVersion: 6
|
||||
m_Legacy: 1
|
||||
m_Compressed: 0
|
||||
m_UseHighQualityCurve: 1
|
||||
m_RotationCurves: []
|
||||
m_CompressedRotationCurves: []
|
||||
m_EulerCurves: []
|
||||
m_PositionCurves: []
|
||||
m_ScaleCurves: []
|
||||
m_FloatCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 55
|
||||
inSlope: 180
|
||||
outSlope: 180
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 85
|
||||
inSlope: 44.999996
|
||||
outSlope: 44.999996
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.5
|
||||
value: 55
|
||||
inSlope: -45.000004
|
||||
outSlope: -45.000004
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.8333334
|
||||
value: 55
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_SizeDelta.x
|
||||
path:
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 55
|
||||
inSlope: 180
|
||||
outSlope: 180
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 85
|
||||
inSlope: 44.999996
|
||||
outSlope: 44.999996
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.5
|
||||
value: 55
|
||||
inSlope: -45.000004
|
||||
outSlope: -45.000004
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.8333334
|
||||
value: 55
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_SizeDelta.y
|
||||
path:
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0.5
|
||||
inSlope: 3
|
||||
outSlope: 3
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 1
|
||||
inSlope: 0.74999994
|
||||
outSlope: 0.74999994
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.5
|
||||
value: 0.5
|
||||
inSlope: -0.75000006
|
||||
outSlope: -0.75000006
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.8333334
|
||||
value: 0.5
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_Alpha
|
||||
path:
|
||||
classID: 225
|
||||
script: {fileID: 0}
|
||||
m_PPtrCurves: []
|
||||
m_SampleRate: 60
|
||||
m_WrapMode: 2
|
||||
m_Bounds:
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
m_Extent: {x: 0, y: 0, z: 0}
|
||||
m_ClipBindingConstant:
|
||||
genericBindings: []
|
||||
pptrCurveMapping: []
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||
m_AdditiveReferencePoseTime: 0
|
||||
m_StartTime: 0
|
||||
m_StopTime: 1.8333334
|
||||
m_OrientationOffsetY: 0
|
||||
m_Level: 0
|
||||
m_CycleOffset: 0
|
||||
m_HasAdditiveReferencePose: 0
|
||||
m_LoopTime: 0
|
||||
m_LoopBlend: 0
|
||||
m_LoopBlendOrientation: 0
|
||||
m_LoopBlendPositionY: 0
|
||||
m_LoopBlendPositionXZ: 0
|
||||
m_KeepOriginalOrientation: 0
|
||||
m_KeepOriginalPositionY: 1
|
||||
m_KeepOriginalPositionXZ: 0
|
||||
m_HeightFromFeet: 0
|
||||
m_Mirror: 0
|
||||
m_EditorCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 55
|
||||
inSlope: 180
|
||||
outSlope: 180
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 85
|
||||
inSlope: 44.999996
|
||||
outSlope: 44.999996
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.5
|
||||
value: 55
|
||||
inSlope: -45.000004
|
||||
outSlope: -45.000004
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.8333334
|
||||
value: 55
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_SizeDelta.x
|
||||
path:
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 55
|
||||
inSlope: 180
|
||||
outSlope: 180
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 85
|
||||
inSlope: 44.999996
|
||||
outSlope: 44.999996
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.5
|
||||
value: 55
|
||||
inSlope: -45.000004
|
||||
outSlope: -45.000004
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.8333334
|
||||
value: 55
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_SizeDelta.y
|
||||
path:
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0.5
|
||||
inSlope: 3
|
||||
outSlope: 3
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 1
|
||||
inSlope: 0.74999994
|
||||
outSlope: 0.74999994
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.5
|
||||
value: 0.5
|
||||
inSlope: -0.75000006
|
||||
outSlope: -0.75000006
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.8333334
|
||||
value: 0.5
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_Alpha
|
||||
path:
|
||||
classID: 225
|
||||
script: {fileID: 0}
|
||||
m_EulerEditorCurves: []
|
||||
m_HasGenericRootTransform: 0
|
||||
m_HasMotionFloatCurves: 0
|
||||
m_Events: []
|
@@ -1,329 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!74 &7400000
|
||||
AnimationClip:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: pulsing_4_2
|
||||
serializedVersion: 6
|
||||
m_Legacy: 1
|
||||
m_Compressed: 0
|
||||
m_UseHighQualityCurve: 1
|
||||
m_RotationCurves: []
|
||||
m_CompressedRotationCurves: []
|
||||
m_EulerCurves: []
|
||||
m_PositionCurves: []
|
||||
m_ScaleCurves: []
|
||||
m_FloatCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.083333336
|
||||
value: 85
|
||||
inSlope: 112
|
||||
outSlope: 112
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: 113
|
||||
inSlope: 14
|
||||
outSlope: 14
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.6666667
|
||||
value: 85
|
||||
inSlope: -42
|
||||
outSlope: -42
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.9166666
|
||||
value: 85
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_SizeDelta.x
|
||||
path:
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.083333336
|
||||
value: 85
|
||||
inSlope: 112
|
||||
outSlope: 112
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: 113
|
||||
inSlope: 14
|
||||
outSlope: 14
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.6666667
|
||||
value: 85
|
||||
inSlope: -42
|
||||
outSlope: -42
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.9166666
|
||||
value: 85
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_SizeDelta.y
|
||||
path:
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.083333336
|
||||
value: 0.25
|
||||
inSlope: 3
|
||||
outSlope: 3
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: 1
|
||||
inSlope: 0.375
|
||||
outSlope: 0.375
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.6666667
|
||||
value: 0.25
|
||||
inSlope: -1.125
|
||||
outSlope: -1.125
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.9166666
|
||||
value: 0.25
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_Alpha
|
||||
path:
|
||||
classID: 225
|
||||
script: {fileID: 0}
|
||||
m_PPtrCurves: []
|
||||
m_SampleRate: 60
|
||||
m_WrapMode: 2
|
||||
m_Bounds:
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
m_Extent: {x: 0, y: 0, z: 0}
|
||||
m_ClipBindingConstant:
|
||||
genericBindings: []
|
||||
pptrCurveMapping: []
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||
m_AdditiveReferencePoseTime: 0
|
||||
m_StartTime: 0
|
||||
m_StopTime: 1.9166666
|
||||
m_OrientationOffsetY: 0
|
||||
m_Level: 0
|
||||
m_CycleOffset: 0
|
||||
m_HasAdditiveReferencePose: 0
|
||||
m_LoopTime: 0
|
||||
m_LoopBlend: 0
|
||||
m_LoopBlendOrientation: 0
|
||||
m_LoopBlendPositionY: 0
|
||||
m_LoopBlendPositionXZ: 0
|
||||
m_KeepOriginalOrientation: 0
|
||||
m_KeepOriginalPositionY: 1
|
||||
m_KeepOriginalPositionXZ: 0
|
||||
m_HeightFromFeet: 0
|
||||
m_Mirror: 0
|
||||
m_EditorCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.083333336
|
||||
value: 85
|
||||
inSlope: 112
|
||||
outSlope: 112
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: 113
|
||||
inSlope: 14
|
||||
outSlope: 14
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.6666667
|
||||
value: 85
|
||||
inSlope: -42
|
||||
outSlope: -42
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.9166666
|
||||
value: 85
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_SizeDelta.x
|
||||
path:
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.083333336
|
||||
value: 85
|
||||
inSlope: 112
|
||||
outSlope: 112
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: 113
|
||||
inSlope: 14
|
||||
outSlope: 14
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.6666667
|
||||
value: 85
|
||||
inSlope: -42
|
||||
outSlope: -42
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.9166666
|
||||
value: 85
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_SizeDelta.y
|
||||
path:
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.083333336
|
||||
value: 0.25
|
||||
inSlope: 3
|
||||
outSlope: 3
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.33333334
|
||||
value: 1
|
||||
inSlope: 0.375
|
||||
outSlope: 0.375
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.6666667
|
||||
value: 0.25
|
||||
inSlope: -1.125
|
||||
outSlope: -1.125
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.9166666
|
||||
value: 0.25
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_Alpha
|
||||
path:
|
||||
classID: 225
|
||||
script: {fileID: 0}
|
||||
m_EulerEditorCurves: []
|
||||
m_HasGenericRootTransform: 0
|
||||
m_HasMotionFloatCurves: 0
|
||||
m_Events: []
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9872cb868c4da1242b6f02e1a430beec
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,329 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!74 &7400000
|
||||
AnimationClip:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: pulsing_4_3
|
||||
serializedVersion: 6
|
||||
m_Legacy: 1
|
||||
m_Compressed: 0
|
||||
m_UseHighQualityCurve: 1
|
||||
m_RotationCurves: []
|
||||
m_CompressedRotationCurves: []
|
||||
m_EulerCurves: []
|
||||
m_PositionCurves: []
|
||||
m_ScaleCurves: []
|
||||
m_FloatCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 0.15
|
||||
inSlope: 3.4000003
|
||||
outSlope: 3.4000003
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.41666666
|
||||
value: 1
|
||||
inSlope: 0.4250002
|
||||
outSlope: 0.4250002
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.75
|
||||
value: 0.15
|
||||
inSlope: -1.425
|
||||
outSlope: -1.425
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.0833334
|
||||
value: 0.05
|
||||
inSlope: -0.14999999
|
||||
outSlope: -0.14999999
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.6666666
|
||||
value: 0.05
|
||||
inSlope: 0.14999999
|
||||
outSlope: 0.14999999
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 2
|
||||
value: 0.15
|
||||
inSlope: 0.29999998
|
||||
outSlope: 0.29999998
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_Alpha
|
||||
path:
|
||||
classID: 225
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 120
|
||||
inSlope: 80.00001
|
||||
outSlope: 80.00001
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.41666666
|
||||
value: 140
|
||||
inSlope: 10.000004
|
||||
outSlope: 10.000004
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.75
|
||||
value: 120
|
||||
inSlope: -60
|
||||
outSlope: -60
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_SizeDelta.x
|
||||
path:
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 120
|
||||
inSlope: 80.00001
|
||||
outSlope: 80.00001
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.41666666
|
||||
value: 140
|
||||
inSlope: 10.000004
|
||||
outSlope: 10.000004
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.75
|
||||
value: 120
|
||||
inSlope: -60
|
||||
outSlope: -60
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_SizeDelta.y
|
||||
path:
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
m_PPtrCurves: []
|
||||
m_SampleRate: 60
|
||||
m_WrapMode: 2
|
||||
m_Bounds:
|
||||
m_Center: {x: 0, y: 0, z: 0}
|
||||
m_Extent: {x: 0, y: 0, z: 0}
|
||||
m_ClipBindingConstant:
|
||||
genericBindings: []
|
||||
pptrCurveMapping: []
|
||||
m_AnimationClipSettings:
|
||||
serializedVersion: 2
|
||||
m_AdditiveReferencePoseClip: {fileID: 0}
|
||||
m_AdditiveReferencePoseTime: 0
|
||||
m_StartTime: 0
|
||||
m_StopTime: 2
|
||||
m_OrientationOffsetY: 0
|
||||
m_Level: 0
|
||||
m_CycleOffset: 0
|
||||
m_HasAdditiveReferencePose: 0
|
||||
m_LoopTime: 0
|
||||
m_LoopBlend: 0
|
||||
m_LoopBlendOrientation: 0
|
||||
m_LoopBlendPositionY: 0
|
||||
m_LoopBlendPositionXZ: 0
|
||||
m_KeepOriginalOrientation: 0
|
||||
m_KeepOriginalPositionY: 1
|
||||
m_KeepOriginalPositionXZ: 0
|
||||
m_HeightFromFeet: 0
|
||||
m_Mirror: 0
|
||||
m_EditorCurves:
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 0.15
|
||||
inSlope: 3.4000003
|
||||
outSlope: 3.4000003
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.41666666
|
||||
value: 1
|
||||
inSlope: 0.4250002
|
||||
outSlope: 0.4250002
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.75
|
||||
value: 0.15
|
||||
inSlope: -1.425
|
||||
outSlope: -1.425
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.0833334
|
||||
value: 0.05
|
||||
inSlope: -0.14999999
|
||||
outSlope: -0.14999999
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1.6666666
|
||||
value: 0.05
|
||||
inSlope: 0.14999999
|
||||
outSlope: 0.14999999
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 2
|
||||
value: 0.15
|
||||
inSlope: 0.29999998
|
||||
outSlope: 0.29999998
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_Alpha
|
||||
path:
|
||||
classID: 225
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 120
|
||||
inSlope: 80.00001
|
||||
outSlope: 80.00001
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.41666666
|
||||
value: 140
|
||||
inSlope: 10.000004
|
||||
outSlope: 10.000004
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.75
|
||||
value: 120
|
||||
inSlope: -60
|
||||
outSlope: -60
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_SizeDelta.x
|
||||
path:
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
- curve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0.16666667
|
||||
value: 120
|
||||
inSlope: 80.00001
|
||||
outSlope: 80.00001
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.41666666
|
||||
value: 140
|
||||
inSlope: 10.000004
|
||||
outSlope: 10.000004
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 0.75
|
||||
value: 120
|
||||
inSlope: -60
|
||||
outSlope: -60
|
||||
tangentMode: 34
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
attribute: m_SizeDelta.y
|
||||
path:
|
||||
classID: 224
|
||||
script: {fileID: 0}
|
||||
m_EulerEditorCurves: []
|
||||
m_HasGenericRootTransform: 0
|
||||
m_HasMotionFloatCurves: 0
|
||||
m_Events: []
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65d69a13d3f3f9e45aab048438948a51
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
@@ -1,128 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92581ac34d887534ca61ddbbdeb2ebf0
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
applyGammaDecoding: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,87 +0,0 @@
|
||||
# TEngine
|
||||
TEngine
|
||||
<p align="center">
|
||||
<img src="http://1.12.241.46:8081/temp/TEngine512.png" alt="logo" width="256" height="256">
|
||||
</p>
|
||||
|
||||
<h3 align="center">TEngine</h3>
|
||||
|
||||
<p align="center">
|
||||
Unity框架解决方案
|
||||
<br>
|
||||
<a style="text-decoration:none">
|
||||
<img src="https://img.shields.io/badge/Unity%20Ver-2019.4.12++-blue.svg?style=flat-square" alt="status" />
|
||||
</a>
|
||||
<a style="text-decoration:none">
|
||||
<img src="https://img.shields.io/github/license/ALEXTANGXIAO/TEngine" alt="license" />
|
||||
</a>
|
||||
<a style="text-decoration:none">
|
||||
<img src="https://img.shields.io/github/last-commit/ALEXTANGXIAO/TEngine" alt="last" />
|
||||
</a>
|
||||
<a style="text-decoration:none">
|
||||
<img src="https://img.shields.io/github/issues/ALEXTANGXIAO/TEngine" alt="issue" />
|
||||
</a>
|
||||
<a style="text-decoration:none">
|
||||
<img src="https://img.shields.io/github/languages/top/ALEXTANGXIAO/TEngine" alt="topLanguage" />
|
||||
</a>
|
||||
<a style="text-decoration:none">
|
||||
<img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2FJasonXuDeveloper%2FJEngine.svg?type=shield" alt="status" />
|
||||
</a>
|
||||
<br>
|
||||
|
||||
<br>
|
||||
<a href="http://1.12.241.46:5000/"><strong>框架文档 »</strong></a>
|
||||
<br>
|
||||
·
|
||||
<br>
|
||||
<a href="https://github.com/ALEXTANGXIAO/TEngine">框架首页 »</a>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
# TEngine v1.0.0
|
||||
|
||||
TEngine
|
||||
```Json
|
||||
TEngine项目结构
|
||||
|
||||
Assets
|
||||
├── TResources // TResources资源加载和打包目录
|
||||
├── ConfigStruct // 生成的配置表结构体
|
||||
├── TEngine // TEngine
|
||||
└── Scripts // 脚本资源
|
||||
|
||||
com.tx.tengine
|
||||
├── Tools~ // 常用工具
|
||||
├── Config~ // 转表工具
|
||||
├── FileServer~ // 基于Node.js热更服务器,有条件用OSS
|
||||
├── Runtime // TEngine 脚本资源
|
||||
└── TEnginePackage~ // TEngine 差异化插件,如UI、网络、热更等
|
||||
|
||||
com.tx.tengine/Runtime
|
||||
├── ClientSaveData // 本地化储存
|
||||
├── 3rd // 三方插件(Json库、Protobuf)
|
||||
├── Config // Config配置表
|
||||
├── Editor // Editor
|
||||
├── Event // Event事件驱动系统
|
||||
├── ECS // ECS架构
|
||||
├── FileSystem // FileSystem
|
||||
├── Json // Json库文件
|
||||
├── Game // 核心逻辑
|
||||
├── Unitity // Unitity工具类
|
||||
├── Res // Res资源加载模块
|
||||
└── Core // TEngine核心
|
||||
├── BaseLogicSys // 基础系统模块,依赖TEngine实现生命周期
|
||||
├── MemPoolMgr // 内存缓存池
|
||||
├── TEngineRedux // DVA/Redux
|
||||
├── TSingleton // 单例以及单例管理器
|
||||
└── TEngine // 主入口
|
||||
|
||||
可定制化模块
|
||||
Assets/TEngine/Runtime/UI
|
||||
├── Editor // 脚本从预制体自动生成UI代码
|
||||
├── Extend // 转表工具
|
||||
├── Res // 基于Node.js热更服务器,有条件用OSS
|
||||
//TODO
|
||||
|
||||
```
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 99bd65c4be7ea5b46a417cdbed6b9064
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
@@ -1,33 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fc1df66dc43ec00438f5efe32d149c89
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,75 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 17aef65a15b471f468b5fbeb4ff0c6a1
|
||||
timeCreated: 1466788349
|
||||
licenseType: Store
|
||||
PluginImporter:
|
||||
serializedVersion: 1
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
isPreloaded: 0
|
||||
platformData:
|
||||
Android:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
Any:
|
||||
enabled: 0
|
||||
settings: {}
|
||||
Editor:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
Linux:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86
|
||||
Linux64:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86_64
|
||||
LinuxUniversal:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OSXIntel:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OSXIntel64:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
OSXUniversal:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
SamsungTV:
|
||||
enabled: 0
|
||||
settings:
|
||||
STV_MODEL: STANDARD_13
|
||||
Win:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
Win64:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
WindowsStoreApps:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DontProcess: False
|
||||
PlaceholderPath:
|
||||
SDK: AnySDK
|
||||
ScriptingBackend: Il2Cpp
|
||||
iOS:
|
||||
enabled: 0
|
||||
settings:
|
||||
CompileFlags:
|
||||
FrameworkDependencies:
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 46219589f03af2b47b31b78944e8a61d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,122 +0,0 @@
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
public abstract class BaseClientData<T> where T : class
|
||||
{
|
||||
public T Value;
|
||||
|
||||
private string m_configName;
|
||||
|
||||
public void Init(string configName)
|
||||
{
|
||||
m_configName = configName;
|
||||
Load();
|
||||
}
|
||||
|
||||
public void Load()
|
||||
{
|
||||
string fullName = ClientSaveData.GetSaveUniqPrefix() + m_configName;
|
||||
var jsonString = PlayerPrefs.GetString(fullName);
|
||||
if (!string.IsNullOrEmpty(jsonString))
|
||||
{
|
||||
Value = ClientSaveData.Deserialize<T>(jsonString);
|
||||
}
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
string fullName = ClientSaveData.GetSaveUniqPrefix() + m_configName;
|
||||
var jsonTex = ClientSaveData.Serialize<T>(Value);
|
||||
if (!string.IsNullOrEmpty(jsonTex))
|
||||
{
|
||||
PlayerPrefs.SetString(fullName, jsonTex);
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract string Serialize(T type);
|
||||
|
||||
protected abstract T Deserialize(string value);
|
||||
}
|
||||
|
||||
public class ClientSaveData
|
||||
{
|
||||
private StringBuilder _stringBuilder = new StringBuilder();
|
||||
|
||||
public static string GetSaveUniqPrefix()
|
||||
{
|
||||
string hashPath = UnityUtil.GetHashCodeByString(Application.dataPath).ToString();
|
||||
string uniqInstance = SystemInfo.deviceUniqueIdentifier;
|
||||
string uniqKey = hashPath + uniqInstance;
|
||||
return uniqKey;
|
||||
}
|
||||
|
||||
public static string Serialize<T>(T type) where T : class
|
||||
{
|
||||
var ret = JsonConvert.SerializeObject(type);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static T Deserialize<T>(string json) where T : class
|
||||
{
|
||||
var ret = JsonConvert.DeserializeObject<T>(json);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static T Load<T>(string keyName, int userId = 0) where T : class
|
||||
{
|
||||
T ret = default(T);
|
||||
|
||||
string typeName = typeof(T).Name + keyName;
|
||||
|
||||
string fullName = GetSaveUniqPrefix() + typeName + userId;
|
||||
|
||||
var jsonString = PlayerPrefs.GetString(fullName);
|
||||
|
||||
if (!string.IsNullOrEmpty(jsonString))
|
||||
{
|
||||
ret = Deserialize<T>(jsonString);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool Save<T>(string keyName, T type, int userId = 0) where T : class
|
||||
{
|
||||
var jsonTex = Serialize<T>(type);
|
||||
|
||||
if (!string.IsNullOrEmpty(jsonTex))
|
||||
{
|
||||
TLogger.LogInfoSuccessd(jsonTex);
|
||||
|
||||
return Save<T>(keyName, jsonTex, userId);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool Save<T>(string keyName, string json, int userId = 0) where T : class
|
||||
{
|
||||
var ret = false;
|
||||
|
||||
string typeName = typeof(T).Name + keyName;
|
||||
|
||||
string fullName = GetSaveUniqPrefix() + typeName + userId;
|
||||
|
||||
if (!string.IsNullOrEmpty(json))
|
||||
{
|
||||
PlayerPrefs.SetString(fullName, json);
|
||||
|
||||
PlayerPrefs.Save();
|
||||
|
||||
ret = true;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 19999af1b542c4040bea4b45f95d1807
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,21 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
public class ClientSaveMgr
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f849a863ac1f7546b02342f75753f55
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,119 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// 统一获取游戏内的时间处理,减少多处调用Unity的时间函数
|
||||
/// </summary>
|
||||
public static class GameTime
|
||||
{
|
||||
/// <summary>
|
||||
/// 开始记录
|
||||
/// </summary>
|
||||
public static void Start()
|
||||
{
|
||||
_lastFrameTimeStamp = TimeStamp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 这一帧的记录
|
||||
/// </summary>
|
||||
public static void StartFrame()
|
||||
{
|
||||
time = Time.time;
|
||||
deltaTime = Time.deltaTime;
|
||||
quickRealTime = Time.realtimeSinceStartup;
|
||||
frameCount = Time.frameCount;
|
||||
unscaledTime = Time.unscaledTime;
|
||||
|
||||
long now = TimeStamp;
|
||||
|
||||
if (ServerTimeStamp > 0)
|
||||
{
|
||||
ServerTimeStamp += now - _lastFrameTimeStamp;
|
||||
}
|
||||
else
|
||||
{
|
||||
ServerTimeStamp = now;
|
||||
}
|
||||
_lastFrameTimeStamp = now;
|
||||
}
|
||||
|
||||
public static float time;
|
||||
public static float deltaTime;
|
||||
public static int frameCount;
|
||||
public static float unscaledTime;
|
||||
public static long ServerTimeStamp;
|
||||
private static System.DateTime _epochDateTime = System.TimeZoneInfo.ConvertTime(new System.DateTime(1970, 1, 1), System.TimeZoneInfo.Local);
|
||||
public static float quickRealTime;
|
||||
public static long TimeStamp => System.DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
private static long _lastFrameTimeStamp;
|
||||
private static bool _isPause = false;
|
||||
private static float _keepTimeScale = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// 从游戏启动到现在的真实时长(秒)
|
||||
/// </summary>
|
||||
public static float RealtimeSinceStartup
|
||||
{
|
||||
get
|
||||
{
|
||||
return Time.realtimeSinceStartup;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 服务器同步时间
|
||||
/// </summary>
|
||||
/// <param name="serverTime"></param>
|
||||
public static void ServerTimeSync(long serverTime)
|
||||
{
|
||||
ServerTimeStamp = serverTime;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取、设置TimeScale
|
||||
/// </summary>
|
||||
public static float TimeScale
|
||||
{
|
||||
get
|
||||
{
|
||||
return Time.timeScale;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!_isPause)
|
||||
{
|
||||
_keepTimeScale = Time.timeScale;
|
||||
Time.timeScale = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 时间停止,所有基于DeltaTime更新的逻辑都会停滞
|
||||
/// </summary>
|
||||
public static void Pause()
|
||||
{
|
||||
if (!_isPause)
|
||||
{
|
||||
_keepTimeScale = Time.timeScale;
|
||||
Time.timeScale = 0f;
|
||||
_isPause = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 时间恢复
|
||||
/// </summary>
|
||||
public static void Resume()
|
||||
{
|
||||
if (_isPause)
|
||||
{
|
||||
Time.timeScale = _keepTimeScale;
|
||||
_isPause = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ca71b5731c97f341b9014200faecbf0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,23 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
public class MemPoolComponent:UnitySingleton<MemPoolComponent>
|
||||
{
|
||||
public MemPoolMgr PoolMgr;
|
||||
|
||||
protected override void OnLoad()
|
||||
{
|
||||
base.OnLoad();
|
||||
PoolMgr = MemPoolMgr.Instance;
|
||||
}
|
||||
|
||||
public int Count => PoolMgr.Count;
|
||||
|
||||
public List<IMemPoolBase> GetAllObjectPools()
|
||||
{
|
||||
return PoolMgr.GetAllObjectPools();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f83b489779008a4aaf472eb9b490ac5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,132 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
public interface IMemPoolObject
|
||||
{
|
||||
void Init();
|
||||
void Destroy();
|
||||
}
|
||||
|
||||
public interface IMemPoolBase
|
||||
{
|
||||
string GetName();
|
||||
int GetPoolItemCount();
|
||||
void ClearPool();
|
||||
}
|
||||
|
||||
public class MemPoolMgr : TSingleton<MemPoolMgr>
|
||||
{
|
||||
protected override void Init()
|
||||
{
|
||||
base.Init();
|
||||
#if UNITY_EDITOR
|
||||
MemPoolComponent.Active();
|
||||
#endif
|
||||
}
|
||||
|
||||
public int Count => m_listPool.Count;
|
||||
|
||||
List<IMemPoolBase> m_listPool = new List<IMemPoolBase>();
|
||||
|
||||
[Conditional("UNITY_EDITOR")]
|
||||
public void ShowCount()
|
||||
{
|
||||
int totalCnt = 0;
|
||||
for (int i = 0; i < m_listPool.Count; i++)
|
||||
{
|
||||
var pool = m_listPool[i];
|
||||
totalCnt += pool.GetPoolItemCount();
|
||||
TLogger.LogInfoSuccessd("[pool][{0}] [{1}]", pool.GetName(), pool.GetPoolItemCount());
|
||||
}
|
||||
TLogger.LogInfoSuccessd("-------------------------memory pool count: {0}", totalCnt);
|
||||
}
|
||||
|
||||
public void RegMemPool(IMemPoolBase pool)
|
||||
{
|
||||
m_listPool.Add(pool);
|
||||
}
|
||||
|
||||
public void ClearAllPool()
|
||||
{
|
||||
for (int i = 0; i < m_listPool.Count; i++)
|
||||
{
|
||||
var pool = m_listPool[i];
|
||||
pool.ClearPool();
|
||||
}
|
||||
}
|
||||
|
||||
public List<IMemPoolBase> GetAllObjectPools()
|
||||
{
|
||||
return m_listPool;
|
||||
}
|
||||
}
|
||||
|
||||
public class GameMemPool<T> : TSingleton<GameMemPool<T>>, IMemPoolBase where T : IMemPoolObject, new()
|
||||
{
|
||||
private List<T> m_objPool = new List<T>();
|
||||
|
||||
public static T Alloc()
|
||||
{
|
||||
return GameMemPool<T>.Instance.DoAlloc();
|
||||
}
|
||||
|
||||
public static void Free(T obj)
|
||||
{
|
||||
GameMemPool<T>.Instance.DoFree(obj);
|
||||
}
|
||||
|
||||
public GameMemPool()
|
||||
{
|
||||
MemPoolMgr.Instance.RegMemPool(this);
|
||||
}
|
||||
|
||||
private T DoAlloc()
|
||||
{
|
||||
T newObj;
|
||||
if (m_objPool.Count > 0)
|
||||
{
|
||||
var lastIndex = m_objPool.Count - 1;
|
||||
newObj = m_objPool[lastIndex];
|
||||
m_objPool.RemoveAt(lastIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
newObj = new T();
|
||||
}
|
||||
|
||||
newObj.Init();
|
||||
return newObj;
|
||||
}
|
||||
|
||||
private void DoFree(T obj)
|
||||
{
|
||||
if (obj == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
obj.Destroy();
|
||||
m_objPool.Add(obj);
|
||||
}
|
||||
|
||||
public void ClearPool()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
TLogger.LogInfo("clear memory[{0}] count[{1}]", GetName(), m_objPool.Count);
|
||||
#endif
|
||||
m_objPool.Clear();
|
||||
}
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return typeof(T).FullName;
|
||||
}
|
||||
|
||||
public int GetPoolItemCount()
|
||||
{
|
||||
return m_objPool.Count;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 538182f774d67f0449e479ce28993300
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,94 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// 对象池管理器
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public static class ObjectPoolMgr<T>
|
||||
{
|
||||
private static readonly ObjectPool<List<T>> m_ListPool = new ObjectPool<List<T>>(null, Clear);
|
||||
|
||||
static void Clear(List<T> list)
|
||||
{
|
||||
list.Clear();
|
||||
}
|
||||
|
||||
public static List<T> Get()
|
||||
{
|
||||
return m_ListPool.Get();
|
||||
}
|
||||
|
||||
public static void Release(List<T> toRelease)
|
||||
{
|
||||
m_ListPool.Release(toRelease);
|
||||
}
|
||||
}
|
||||
|
||||
public class ObjectPool<T> where T : new()
|
||||
{
|
||||
private readonly Stack<T> m_Stack = new Stack<T>();
|
||||
private readonly UnityAction<T> m_ActionGet;
|
||||
private readonly UnityAction<T> m_ActionRelease;
|
||||
|
||||
public int CountAll { get; private set; }
|
||||
public int CountActive
|
||||
{
|
||||
get
|
||||
{
|
||||
return CountAll - CountInActive;
|
||||
}
|
||||
}
|
||||
|
||||
public int CountInActive
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Stack.Count;
|
||||
}
|
||||
}
|
||||
|
||||
public ObjectPool()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ObjectPool(UnityAction<T> actionGet, UnityAction<T> actionRelease)
|
||||
{
|
||||
m_ActionGet = actionGet;
|
||||
m_ActionRelease = actionRelease;
|
||||
}
|
||||
|
||||
public T Get()
|
||||
{
|
||||
T element;
|
||||
if (m_Stack.Count <= 0)
|
||||
{
|
||||
element = new T();
|
||||
CountAll++;
|
||||
}
|
||||
else
|
||||
{
|
||||
element = m_Stack.Pop();
|
||||
}
|
||||
|
||||
if (m_ActionGet != null)
|
||||
{
|
||||
m_ActionGet.Invoke(element);
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
public void Release(T element)
|
||||
{
|
||||
if (m_Stack.Count > 0 && ReferenceEquals(m_Stack.Peek(), element))
|
||||
{
|
||||
TLogger.LogError("Internal error. Trying to destroy object that is already released to pool.");
|
||||
}
|
||||
m_ActionRelease?.Invoke(element);
|
||||
m_Stack.Push(element);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 521d4cc35b3e9d84d9ad2e5de2c4cc09
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,28 +0,0 @@
|
||||
namespace TEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// 通用单例,无需释放和销毁
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public class Singleton<T> where T : new()
|
||||
{
|
||||
private static T _instance;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = new T();
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
public static T Active()
|
||||
{
|
||||
return Instance;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80e398d58b294df4596e470547c69b01
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24d05fd49961e7848a44005a652f95c9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,880 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TEngine.Redux
|
||||
{
|
||||
#region Architecture
|
||||
|
||||
public interface IArchitecture
|
||||
{
|
||||
void RegisterSystem<T>(T system) where T : ISystem;
|
||||
|
||||
void RegisterModel<T>(T model) where T : IModel;
|
||||
|
||||
void RegisterUtility<T>(T utility) where T : IUtility;
|
||||
|
||||
T GetSystem<T>() where T : class, ISystem;
|
||||
|
||||
T GetModel<T>() where T : class, IModel;
|
||||
|
||||
T GetUtility<T>() where T : class, IUtility;
|
||||
|
||||
void SendCommand<T>() where T : ICommand, new();
|
||||
|
||||
void SendCommand<T>(T command) where T : ICommand;
|
||||
|
||||
TResult SendQuery<TResult>(IQuery<TResult> query);
|
||||
|
||||
void SendEvent<T>() where T : new();
|
||||
|
||||
void SendEvent<T>(T e);
|
||||
|
||||
IUnRegister RegisterEvent<T>(Action<T> onEvent);
|
||||
|
||||
void UnRegisterEvent<T>(Action<T> onEvent);
|
||||
}
|
||||
|
||||
public abstract class Architecture<T> : IArchitecture where T : Architecture<T>, new()
|
||||
{
|
||||
private bool _Inited = false;
|
||||
|
||||
private List<ISystem> _Systems = new List<ISystem>();
|
||||
|
||||
private List<IModel> _Models = new List<IModel>();
|
||||
|
||||
public static Action<T> OnRegisterPatch = architecture => { };
|
||||
|
||||
private static T _Architecture;
|
||||
|
||||
public static IArchitecture Interface
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Architecture == null)
|
||||
{
|
||||
MakeSureArchitecture();
|
||||
}
|
||||
|
||||
return _Architecture;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void MakeSureArchitecture()
|
||||
{
|
||||
if (_Architecture == null)
|
||||
{
|
||||
_Architecture = new T();
|
||||
_Architecture.Init();
|
||||
|
||||
OnRegisterPatch?.Invoke(_Architecture);
|
||||
|
||||
foreach (var architectureModel in _Architecture._Models)
|
||||
{
|
||||
architectureModel.Init();
|
||||
}
|
||||
|
||||
_Architecture._Models.Clear();
|
||||
|
||||
foreach (var architectureSystem in _Architecture._Systems)
|
||||
{
|
||||
architectureSystem.Init();
|
||||
}
|
||||
|
||||
_Architecture._Systems.Clear();
|
||||
|
||||
_Architecture._Inited = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void Init();
|
||||
|
||||
private TEngineContainer mContainer = new TEngineContainer();
|
||||
|
||||
public void RegisterSystem<TSystem>(TSystem system) where TSystem : ISystem
|
||||
{
|
||||
system.SetArchitecture(this);
|
||||
mContainer.Register<TSystem>(system);
|
||||
|
||||
if (!_Inited)
|
||||
{
|
||||
_Systems.Add(system);
|
||||
}
|
||||
else
|
||||
{
|
||||
system.Init();
|
||||
}
|
||||
}
|
||||
|
||||
public void RegisterModel<TModel>(TModel model) where TModel : IModel
|
||||
{
|
||||
model.SetArchitecture(this);
|
||||
mContainer.Register<TModel>(model);
|
||||
|
||||
if (!_Inited)
|
||||
{
|
||||
_Models.Add(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
model.Init();
|
||||
}
|
||||
}
|
||||
|
||||
public void RegisterUtility<TUtility>(TUtility utility) where TUtility : IUtility
|
||||
{
|
||||
mContainer.Register<TUtility>(utility);
|
||||
}
|
||||
|
||||
public TSystem GetSystem<TSystem>() where TSystem : class, ISystem
|
||||
{
|
||||
return mContainer.Get<TSystem>();
|
||||
}
|
||||
|
||||
public TModel GetModel<TModel>() where TModel : class, IModel
|
||||
{
|
||||
return mContainer.Get<TModel>();
|
||||
}
|
||||
|
||||
public TUtility GetUtility<TUtility>() where TUtility : class, IUtility
|
||||
{
|
||||
return mContainer.Get<TUtility>();
|
||||
}
|
||||
|
||||
public void SendCommand<TCommand>() where TCommand : ICommand, new()
|
||||
{
|
||||
var command = new TCommand();
|
||||
command.SetArchitecture(this);
|
||||
command.Execute();
|
||||
}
|
||||
|
||||
public void SendCommand<TCommand>(TCommand command) where TCommand : ICommand
|
||||
{
|
||||
command.SetArchitecture(this);
|
||||
command.Execute();
|
||||
}
|
||||
|
||||
public TResult SendQuery<TResult>(IQuery<TResult> query)
|
||||
{
|
||||
query.SetArchitecture(this);
|
||||
return query.Do();
|
||||
}
|
||||
|
||||
private TypeEventSystem mTypeEventSystem = new TypeEventSystem();
|
||||
|
||||
public void SendEvent<TEvent>() where TEvent : new()
|
||||
{
|
||||
mTypeEventSystem.Send<TEvent>();
|
||||
}
|
||||
|
||||
public void SendEvent<TEvent>(TEvent e)
|
||||
{
|
||||
mTypeEventSystem.Send<TEvent>(e);
|
||||
}
|
||||
|
||||
public IUnRegister RegisterEvent<TEvent>(Action<TEvent> onEvent)
|
||||
{
|
||||
return mTypeEventSystem.Register<TEvent>(onEvent);
|
||||
}
|
||||
|
||||
public void UnRegisterEvent<TEvent>(Action<TEvent> onEvent)
|
||||
{
|
||||
mTypeEventSystem.UnRegister<TEvent>(onEvent);
|
||||
}
|
||||
}
|
||||
|
||||
public interface IOnEvent<T>
|
||||
{
|
||||
void OnEvent(T e);
|
||||
}
|
||||
|
||||
public static class OnGlobalEventExtension
|
||||
{
|
||||
public static IUnRegister RegisterEvent<T>(this IOnEvent<T> self) where T : struct
|
||||
{
|
||||
return TypeEventSystem.Global.Register<T>(self.OnEvent);
|
||||
}
|
||||
|
||||
public static void UnRegisterEvent<T>(this IOnEvent<T> self) where T : struct
|
||||
{
|
||||
TypeEventSystem.Global.UnRegister<T>(self.OnEvent);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Controller
|
||||
|
||||
public interface IController : IBelongToArchitecture, ICanSendCommand, ICanGetSystem, ICanGetModel,
|
||||
ICanRegisterEvent, ICanSendQuery
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region System
|
||||
|
||||
public interface ISystem : IBelongToArchitecture, ICanSetArchitecture, ICanGetModel, ICanGetUtility,
|
||||
ICanRegisterEvent, ICanSendEvent, ICanGetSystem
|
||||
{
|
||||
void Init();
|
||||
}
|
||||
|
||||
public abstract class AbstractSystem : ISystem
|
||||
{
|
||||
private IArchitecture _Architecture;
|
||||
|
||||
IArchitecture IBelongToArchitecture.GetArchitecture()
|
||||
{
|
||||
return _Architecture;
|
||||
}
|
||||
|
||||
void ICanSetArchitecture.SetArchitecture(IArchitecture architecture)
|
||||
{
|
||||
_Architecture = architecture;
|
||||
}
|
||||
|
||||
void ISystem.Init()
|
||||
{
|
||||
OnInit();
|
||||
}
|
||||
|
||||
protected abstract void OnInit();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Model
|
||||
|
||||
public interface IModel : IBelongToArchitecture, ICanSetArchitecture, ICanGetUtility, ICanSendEvent
|
||||
{
|
||||
void Init();
|
||||
}
|
||||
|
||||
public abstract class AbstractModel : IModel
|
||||
{
|
||||
private IArchitecture _Architecturel;
|
||||
|
||||
IArchitecture IBelongToArchitecture.GetArchitecture()
|
||||
{
|
||||
return _Architecturel;
|
||||
}
|
||||
|
||||
void ICanSetArchitecture.SetArchitecture(IArchitecture architecture)
|
||||
{
|
||||
_Architecturel = architecture;
|
||||
}
|
||||
|
||||
void IModel.Init()
|
||||
{
|
||||
OnInit();
|
||||
}
|
||||
|
||||
protected abstract void OnInit();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Utility
|
||||
|
||||
public interface IUtility
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
|
||||
public interface ICommand : IBelongToArchitecture, ICanSetArchitecture, ICanGetSystem, ICanGetModel, ICanGetUtility,
|
||||
ICanSendEvent, ICanSendCommand, ICanSendQuery
|
||||
{
|
||||
void Execute();
|
||||
}
|
||||
|
||||
public abstract class AbstractCommand : ICommand
|
||||
{
|
||||
private IArchitecture _Architecture;
|
||||
|
||||
IArchitecture IBelongToArchitecture.GetArchitecture()
|
||||
{
|
||||
return _Architecture;
|
||||
}
|
||||
|
||||
void ICanSetArchitecture.SetArchitecture(IArchitecture architecture)
|
||||
{
|
||||
_Architecture = architecture;
|
||||
}
|
||||
|
||||
void ICommand.Execute()
|
||||
{
|
||||
OnExecute();
|
||||
}
|
||||
|
||||
protected abstract void OnExecute();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Query
|
||||
|
||||
public interface IQuery<TResult> : IBelongToArchitecture, ICanSetArchitecture, ICanGetModel, ICanGetSystem,
|
||||
ICanSendQuery
|
||||
{
|
||||
TResult Do();
|
||||
}
|
||||
|
||||
public abstract class AbstractQuery<T> : IQuery<T>
|
||||
{
|
||||
public T Do()
|
||||
{
|
||||
return OnDo();
|
||||
}
|
||||
|
||||
protected abstract T OnDo();
|
||||
|
||||
|
||||
private IArchitecture _Architecture;
|
||||
|
||||
public IArchitecture GetArchitecture()
|
||||
{
|
||||
return _Architecture;
|
||||
}
|
||||
|
||||
public void SetArchitecture(IArchitecture architecture)
|
||||
{
|
||||
_Architecture = architecture;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Rule
|
||||
|
||||
public interface IBelongToArchitecture
|
||||
{
|
||||
IArchitecture GetArchitecture();
|
||||
}
|
||||
|
||||
public interface ICanSetArchitecture
|
||||
{
|
||||
void SetArchitecture(IArchitecture architecture);
|
||||
}
|
||||
|
||||
public interface ICanGetModel : IBelongToArchitecture
|
||||
{
|
||||
}
|
||||
|
||||
public static class CanGetModelExtension
|
||||
{
|
||||
public static T GetModel<T>(this ICanGetModel self) where T : class, IModel
|
||||
{
|
||||
return self.GetArchitecture().GetModel<T>();
|
||||
}
|
||||
}
|
||||
|
||||
public interface ICanGetSystem : IBelongToArchitecture
|
||||
{
|
||||
}
|
||||
|
||||
public static class CanGetSystemExtension
|
||||
{
|
||||
public static T GetSystem<T>(this ICanGetSystem self) where T : class, ISystem
|
||||
{
|
||||
return self.GetArchitecture().GetSystem<T>();
|
||||
}
|
||||
}
|
||||
|
||||
public interface ICanGetUtility : IBelongToArchitecture
|
||||
{
|
||||
}
|
||||
|
||||
public static class CanGetUtilityExtension
|
||||
{
|
||||
public static T GetUtility<T>(this ICanGetUtility self) where T : class, IUtility
|
||||
{
|
||||
return self.GetArchitecture().GetUtility<T>();
|
||||
}
|
||||
}
|
||||
|
||||
public interface ICanRegisterEvent : IBelongToArchitecture
|
||||
{
|
||||
}
|
||||
|
||||
public static class CanRegisterEventExtension
|
||||
{
|
||||
public static IUnRegister RegisterEvent<T>(this ICanRegisterEvent self, Action<T> onEvent)
|
||||
{
|
||||
return self.GetArchitecture().RegisterEvent<T>(onEvent);
|
||||
}
|
||||
|
||||
public static void UnRegisterEvent<T>(this ICanRegisterEvent self, Action<T> onEvent)
|
||||
{
|
||||
self.GetArchitecture().UnRegisterEvent<T>(onEvent);
|
||||
}
|
||||
}
|
||||
|
||||
public interface ICanSendCommand : IBelongToArchitecture
|
||||
{
|
||||
}
|
||||
|
||||
public static class CanSendCommandExtension
|
||||
{
|
||||
public static void SendCommand<T>(this ICanSendCommand self) where T : ICommand, new()
|
||||
{
|
||||
self.GetArchitecture().SendCommand<T>();
|
||||
}
|
||||
|
||||
public static void SendCommand<T>(this ICanSendCommand self, T command) where T : ICommand
|
||||
{
|
||||
self.GetArchitecture().SendCommand<T>(command);
|
||||
}
|
||||
}
|
||||
|
||||
public interface ICanSendEvent : IBelongToArchitecture
|
||||
{
|
||||
}
|
||||
|
||||
public static class CanSendEventExtension
|
||||
{
|
||||
public static void SendEvent<T>(this ICanSendEvent self) where T : new()
|
||||
{
|
||||
self.GetArchitecture().SendEvent<T>();
|
||||
}
|
||||
|
||||
public static void SendEvent<T>(this ICanSendEvent self, T e)
|
||||
{
|
||||
self.GetArchitecture().SendEvent<T>(e);
|
||||
}
|
||||
}
|
||||
|
||||
public interface ICanSendQuery : IBelongToArchitecture
|
||||
{
|
||||
}
|
||||
|
||||
public static class CanSendQueryExtension
|
||||
{
|
||||
public static TResult SendQuery<TResult>(this ICanSendQuery self, IQuery<TResult> query)
|
||||
{
|
||||
return self.GetArchitecture().SendQuery(query);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region TypeEventSystem
|
||||
|
||||
public interface IUnRegister
|
||||
{
|
||||
void UnRegister();
|
||||
}
|
||||
|
||||
public interface IUnRegisterList
|
||||
{
|
||||
List<IUnRegister> UnregisterList { get; }
|
||||
}
|
||||
|
||||
public static class IUnRegisterListExtension
|
||||
{
|
||||
public static void AddToUnregisterList(this IUnRegister self, IUnRegisterList unRegisterList)
|
||||
{
|
||||
unRegisterList.UnregisterList.Add(self);
|
||||
}
|
||||
|
||||
public static void UnRegisterAll(this IUnRegisterList self)
|
||||
{
|
||||
foreach (var unRegister in self.UnregisterList)
|
||||
{
|
||||
unRegister.UnRegister();
|
||||
}
|
||||
|
||||
self.UnregisterList.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自定义可注销的类
|
||||
/// </summary>
|
||||
public struct CustomUnRegister : IUnRegister
|
||||
{
|
||||
/// <summary>
|
||||
/// 委托对象
|
||||
/// </summary>
|
||||
private Action mOnUnRegister { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 带参构造函数
|
||||
/// </summary>
|
||||
/// <param name="onDispose"></param>
|
||||
public CustomUnRegister(Action onUnRegsiter)
|
||||
{
|
||||
mOnUnRegister = onUnRegsiter;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 资源释放
|
||||
/// </summary>
|
||||
public void UnRegister()
|
||||
{
|
||||
mOnUnRegister.Invoke();
|
||||
mOnUnRegister = null;
|
||||
}
|
||||
}
|
||||
|
||||
public class UnRegisterOnDestroyTrigger : MonoBehaviour
|
||||
{
|
||||
private readonly HashSet<IUnRegister> mUnRegisters = new HashSet<IUnRegister>();
|
||||
|
||||
public void AddUnRegister(IUnRegister unRegister)
|
||||
{
|
||||
mUnRegisters.Add(unRegister);
|
||||
}
|
||||
|
||||
public void RemoveUnRegister(IUnRegister unRegister)
|
||||
{
|
||||
mUnRegisters.Remove(unRegister);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
foreach (var unRegister in mUnRegisters)
|
||||
{
|
||||
unRegister.UnRegister();
|
||||
}
|
||||
|
||||
mUnRegisters.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public static class UnRegisterExtension
|
||||
{
|
||||
public static IUnRegister UnRegisterWhenGameObjectDestroyed(this IUnRegister unRegister, GameObject gameObject)
|
||||
{
|
||||
var trigger = gameObject.GetComponent<UnRegisterOnDestroyTrigger>();
|
||||
|
||||
if (!trigger)
|
||||
{
|
||||
trigger = gameObject.AddComponent<UnRegisterOnDestroyTrigger>();
|
||||
}
|
||||
|
||||
trigger.AddUnRegister(unRegister);
|
||||
|
||||
return unRegister;
|
||||
}
|
||||
}
|
||||
|
||||
public class TypeEventSystem
|
||||
{
|
||||
private readonly EasyEvents mEvents = new EasyEvents();
|
||||
|
||||
|
||||
public static readonly TypeEventSystem Global = new TypeEventSystem();
|
||||
|
||||
public void Send<T>() where T : new()
|
||||
{
|
||||
mEvents.GetEvent<EasyEvent<T>>()?.Trigger(new T());
|
||||
}
|
||||
|
||||
public void Send<T>(T e)
|
||||
{
|
||||
mEvents.GetEvent<EasyEvent<T>>()?.Trigger(e);
|
||||
}
|
||||
|
||||
public IUnRegister Register<T>(Action<T> onEvent)
|
||||
{
|
||||
var e = mEvents.GetOrAddEvent<EasyEvent<T>>();
|
||||
return e.Register(onEvent);
|
||||
}
|
||||
|
||||
public void UnRegister<T>(Action<T> onEvent)
|
||||
{
|
||||
var e = mEvents.GetEvent<EasyEvent<T>>();
|
||||
if (e != null)
|
||||
{
|
||||
e.UnRegister(onEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region TEngine
|
||||
|
||||
public class TEngineContainer
|
||||
{
|
||||
private Dictionary<Type, object> _Instances = new Dictionary<Type, object>();
|
||||
|
||||
public void Register<T>(T instance)
|
||||
{
|
||||
var key = typeof(T);
|
||||
|
||||
if (_Instances.ContainsKey(key))
|
||||
{
|
||||
_Instances[key] = instance;
|
||||
}
|
||||
else
|
||||
{
|
||||
_Instances.Add(key, instance);
|
||||
}
|
||||
}
|
||||
|
||||
public T Get<T>() where T : class
|
||||
{
|
||||
var key = typeof(T);
|
||||
|
||||
if (_Instances.TryGetValue(key, out var retInstance))
|
||||
{
|
||||
return retInstance as T;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region BindableProperty
|
||||
|
||||
public interface IBindableProperty<T> : IReadonlyBindableProperty<T>
|
||||
{
|
||||
new T Value { get; set; }
|
||||
void SetValueWithoutEvent(T newValue);
|
||||
}
|
||||
|
||||
public interface IReadonlyBindableProperty<T>
|
||||
{
|
||||
T Value { get; }
|
||||
|
||||
IUnRegister RegisterWithInitValue(Action<T> action);
|
||||
void UnRegister(Action<T> onValueChanged);
|
||||
IUnRegister Register(Action<T> onValueChanged);
|
||||
}
|
||||
|
||||
public class BindableProperty<T> : IBindableProperty<T>
|
||||
{
|
||||
public BindableProperty(T defaultValue = default)
|
||||
{
|
||||
mValue = defaultValue;
|
||||
}
|
||||
|
||||
protected T mValue;
|
||||
|
||||
public T Value
|
||||
{
|
||||
get => GetValue();
|
||||
set
|
||||
{
|
||||
if (value == null && mValue == null) return;
|
||||
if (value != null && value.Equals(mValue)) return;
|
||||
|
||||
SetValue(value);
|
||||
mOnValueChanged?.Invoke(value);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void SetValue(T newValue)
|
||||
{
|
||||
mValue = newValue;
|
||||
}
|
||||
|
||||
protected virtual T GetValue()
|
||||
{
|
||||
return mValue;
|
||||
}
|
||||
|
||||
public void SetValueWithoutEvent(T newValue)
|
||||
{
|
||||
mValue = newValue;
|
||||
}
|
||||
|
||||
private Action<T> mOnValueChanged = (v) => { };
|
||||
|
||||
public IUnRegister Register(Action<T> onValueChanged)
|
||||
{
|
||||
mOnValueChanged += onValueChanged;
|
||||
return new BindablePropertyUnRegister<T>()
|
||||
{
|
||||
BindableProperty = this,
|
||||
OnValueChanged = onValueChanged
|
||||
};
|
||||
}
|
||||
|
||||
public IUnRegister RegisterWithInitValue(Action<T> onValueChanged)
|
||||
{
|
||||
onValueChanged(mValue);
|
||||
return Register(onValueChanged);
|
||||
}
|
||||
|
||||
public static implicit operator T(BindableProperty<T> property)
|
||||
{
|
||||
return property.Value;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Value.ToString();
|
||||
}
|
||||
|
||||
public void UnRegister(Action<T> onValueChanged)
|
||||
{
|
||||
mOnValueChanged -= onValueChanged;
|
||||
}
|
||||
}
|
||||
|
||||
public class BindablePropertyUnRegister<T> : IUnRegister
|
||||
{
|
||||
public BindableProperty<T> BindableProperty { get; set; }
|
||||
|
||||
public Action<T> OnValueChanged { get; set; }
|
||||
|
||||
public void UnRegister()
|
||||
{
|
||||
BindableProperty.UnRegister(OnValueChanged);
|
||||
|
||||
BindableProperty = null;
|
||||
OnValueChanged = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region EasyEvent
|
||||
|
||||
public interface IEasyEvent
|
||||
{
|
||||
}
|
||||
|
||||
public class EasyEvent : IEasyEvent
|
||||
{
|
||||
private Action mOnEvent = () => { };
|
||||
|
||||
public IUnRegister Register(Action onEvent)
|
||||
{
|
||||
mOnEvent += onEvent;
|
||||
return new CustomUnRegister(() => { UnRegister(onEvent); });
|
||||
}
|
||||
|
||||
public void UnRegister(Action onEvent)
|
||||
{
|
||||
mOnEvent -= onEvent;
|
||||
}
|
||||
|
||||
public void Trigger()
|
||||
{
|
||||
mOnEvent?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
public class EasyEvent<T> : IEasyEvent
|
||||
{
|
||||
private Action<T> mOnEvent = e => { };
|
||||
|
||||
public IUnRegister Register(Action<T> onEvent)
|
||||
{
|
||||
mOnEvent += onEvent;
|
||||
return new CustomUnRegister(() => { UnRegister(onEvent); });
|
||||
}
|
||||
|
||||
public void UnRegister(Action<T> onEvent)
|
||||
{
|
||||
mOnEvent -= onEvent;
|
||||
}
|
||||
|
||||
public void Trigger(T t)
|
||||
{
|
||||
mOnEvent?.Invoke(t);
|
||||
}
|
||||
}
|
||||
|
||||
public class EasyEvent<T, K> : IEasyEvent
|
||||
{
|
||||
private Action<T, K> mOnEvent = (t, k) => { };
|
||||
|
||||
public IUnRegister Register(Action<T, K> onEvent)
|
||||
{
|
||||
mOnEvent += onEvent;
|
||||
return new CustomUnRegister(() => { UnRegister(onEvent); });
|
||||
}
|
||||
|
||||
public void UnRegister(Action<T, K> onEvent)
|
||||
{
|
||||
mOnEvent -= onEvent;
|
||||
}
|
||||
|
||||
public void Trigger(T t, K k)
|
||||
{
|
||||
mOnEvent?.Invoke(t, k);
|
||||
}
|
||||
}
|
||||
|
||||
public class EasyEvent<T, K, S> : IEasyEvent
|
||||
{
|
||||
private Action<T, K, S> mOnEvent = (t, k, s) => { };
|
||||
|
||||
public IUnRegister Register(Action<T, K, S> onEvent)
|
||||
{
|
||||
mOnEvent += onEvent;
|
||||
return new CustomUnRegister(() => { UnRegister(onEvent); });
|
||||
}
|
||||
|
||||
public void UnRegister(Action<T, K, S> onEvent)
|
||||
{
|
||||
mOnEvent -= onEvent;
|
||||
}
|
||||
|
||||
public void Trigger(T t, K k, S s)
|
||||
{
|
||||
mOnEvent?.Invoke(t, k, s);
|
||||
}
|
||||
}
|
||||
|
||||
public class EasyEvents
|
||||
{
|
||||
private static EasyEvents mGlobalEvents = new EasyEvents();
|
||||
|
||||
public static T Get<T>() where T : IEasyEvent
|
||||
{
|
||||
return mGlobalEvents.GetEvent<T>();
|
||||
}
|
||||
|
||||
|
||||
public static void Register<T>() where T : IEasyEvent, new()
|
||||
{
|
||||
mGlobalEvents.AddEvent<T>();
|
||||
}
|
||||
|
||||
private Dictionary<Type, IEasyEvent> mTypeEvents = new Dictionary<Type, IEasyEvent>();
|
||||
|
||||
public void AddEvent<T>() where T : IEasyEvent, new()
|
||||
{
|
||||
mTypeEvents.Add(typeof(T), new T());
|
||||
}
|
||||
|
||||
public T GetEvent<T>() where T : IEasyEvent
|
||||
{
|
||||
IEasyEvent e;
|
||||
|
||||
if (mTypeEvents.TryGetValue(typeof(T), out e))
|
||||
{
|
||||
return (T)e;
|
||||
}
|
||||
|
||||
return default;
|
||||
}
|
||||
|
||||
public T GetOrAddEvent<T>() where T : IEasyEvent, new()
|
||||
{
|
||||
var eType = typeof(T);
|
||||
if (mTypeEvents.TryGetValue(eType, out var e))
|
||||
{
|
||||
return (T)e;
|
||||
}
|
||||
|
||||
var t = new T();
|
||||
mTypeEvents.Add(eType, t);
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d6ac57b69a5ba014c86bb71d54e8c24d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,450 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
public class TimerMgr : UnitySingleton<TimerMgr>
|
||||
{
|
||||
public delegate void TimerHandler(object[] args);
|
||||
|
||||
public class Timer
|
||||
{
|
||||
public int timerId = 0;
|
||||
public float curTime = 0;
|
||||
public float time = 0;
|
||||
public TimerHandler handler;
|
||||
public bool isLoop = false;
|
||||
public bool isNeedRemove = false;
|
||||
public bool isRunning = false;
|
||||
public bool isUnscaled = false; //是否使用非缩放的时间
|
||||
public object[] args = null; //回调参数
|
||||
}
|
||||
|
||||
private int _curTimerId = 0;
|
||||
private List<Timer> _timerList = new List<Timer>();
|
||||
private List<Timer> _unscaledTimerList = new List<Timer>();
|
||||
private List<int> _cacheRemoveTimers = new List<int>();
|
||||
private List<int> _cacheRemoveUnscaledTimers = new List<int>();
|
||||
|
||||
/// <summary>
|
||||
/// 添加计时器
|
||||
/// </summary>
|
||||
/// <param name="callback"></param>
|
||||
/// <param name="time"></param>
|
||||
/// <param name="isLoop"></param>
|
||||
/// <param name="isUnscaled"></param>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
public int AddTimer(TimerHandler callback, float time, bool isLoop = false, bool isUnscaled = false, params object[] args)
|
||||
{
|
||||
Timer timer = new Timer();
|
||||
timer.timerId = ++_curTimerId;
|
||||
timer.curTime = time;
|
||||
timer.time = time;
|
||||
timer.handler = callback;
|
||||
timer.isLoop = isLoop;
|
||||
timer.isUnscaled = isUnscaled;
|
||||
timer.args = args;
|
||||
timer.isNeedRemove = false;
|
||||
timer.isRunning = true;
|
||||
|
||||
InsertTimer(timer);
|
||||
return timer.timerId;
|
||||
}
|
||||
|
||||
private void InsertTimer(Timer timer)
|
||||
{
|
||||
bool isInsert = false;
|
||||
if (timer.isUnscaled)
|
||||
{
|
||||
for (int i = 0, len = _unscaledTimerList.Count; i < len; i++)
|
||||
{
|
||||
if (_unscaledTimerList[i].curTime > timer.curTime)
|
||||
{
|
||||
_unscaledTimerList.Insert(i, timer);
|
||||
isInsert = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isInsert)
|
||||
{
|
||||
_unscaledTimerList.Add(timer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0, len = _timerList.Count; i < len; i++)
|
||||
{
|
||||
if (_timerList[i].curTime > timer.curTime)
|
||||
{
|
||||
_timerList.Insert(i, timer);
|
||||
isInsert = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isInsert)
|
||||
{
|
||||
_timerList.Add(timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 暂停计时
|
||||
/// </summary>
|
||||
public void Stop(int timerId)
|
||||
{
|
||||
Timer timer = GetTimer(timerId);
|
||||
if (timer != null) timer.isRunning = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 恢复计时
|
||||
/// </summary>
|
||||
public void Resume(int timerId)
|
||||
{
|
||||
Timer timer = GetTimer(timerId);
|
||||
if (timer != null) timer.isRunning = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计时器是否在运行中
|
||||
/// </summary>
|
||||
public bool IsRunning(int timerId)
|
||||
{
|
||||
Timer timer = GetTimer(timerId);
|
||||
return timer != null && timer.isRunning;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获得计时器剩余时间
|
||||
/// </summary>
|
||||
public float GetLeftTime(int timerId)
|
||||
{
|
||||
Timer timer = GetTimer(timerId);
|
||||
if (timer == null) return 0;
|
||||
return timer.curTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置计时器,恢复到开始状态
|
||||
/// </summary>
|
||||
public void Restart(int timerId)
|
||||
{
|
||||
Timer timer = GetTimer(timerId);
|
||||
if (timer != null)
|
||||
{
|
||||
timer.curTime = timer.time;
|
||||
timer.isRunning = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置计时器
|
||||
/// </summary>
|
||||
public void Reset(int timerId, TimerHandler callback, float time, bool isLoop = false, bool isUnscaled = false)
|
||||
{
|
||||
Timer timer = GetTimer(timerId);
|
||||
if (timer != null)
|
||||
{
|
||||
timer.curTime = time;
|
||||
timer.time = time;
|
||||
timer.handler = callback;
|
||||
timer.isLoop = isLoop;
|
||||
timer.isNeedRemove = false;
|
||||
if (timer.isUnscaled != isUnscaled)
|
||||
{
|
||||
RemoveTimerImmediate(timerId);
|
||||
|
||||
timer.isUnscaled = isUnscaled;
|
||||
InsertTimer(timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置计时器
|
||||
/// </summary>
|
||||
public void Reset(int timerId, float time, bool isLoop, bool isUnscaled)
|
||||
{
|
||||
Timer timer = GetTimer(timerId);
|
||||
if (timer != null)
|
||||
{
|
||||
timer.curTime = time;
|
||||
timer.time = time;
|
||||
timer.isLoop = isLoop;
|
||||
timer.isNeedRemove = false;
|
||||
if (timer.isUnscaled != isUnscaled)
|
||||
{
|
||||
RemoveTimerImmediate(timerId);
|
||||
|
||||
timer.isUnscaled = isUnscaled;
|
||||
InsertTimer(timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 立即移除
|
||||
/// </summary>
|
||||
/// <param name="timerId"></param>
|
||||
private void RemoveTimerImmediate(int timerId)
|
||||
{
|
||||
for (int i = 0, len = _timerList.Count; i < len; i++)
|
||||
{
|
||||
if (_timerList[i].timerId == timerId)
|
||||
{
|
||||
_timerList.RemoveAt(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0, len = _unscaledTimerList.Count; i < len; i++)
|
||||
{
|
||||
if (_unscaledTimerList[i].timerId == timerId)
|
||||
{
|
||||
_unscaledTimerList.RemoveAt(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除计时器
|
||||
/// </summary>
|
||||
/// <param name="timerId"></param>
|
||||
public void RemoveTimer(int timerId)
|
||||
{
|
||||
for (int i = 0, len = _timerList.Count; i < len; i++)
|
||||
{
|
||||
if (_timerList[i].timerId == timerId)
|
||||
{
|
||||
_timerList[i].isNeedRemove = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0, len = _unscaledTimerList.Count; i < len; i++)
|
||||
{
|
||||
if (_unscaledTimerList[i].timerId == timerId)
|
||||
{
|
||||
_unscaledTimerList[i].isNeedRemove = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除所有计时器
|
||||
/// </summary>
|
||||
public void RemoveAllTimer()
|
||||
{
|
||||
_timerList.Clear();
|
||||
_unscaledTimerList.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据TimerId获取计时器
|
||||
/// </summary>
|
||||
/// <param name="timerId"></param>
|
||||
/// <returns></returns>
|
||||
private Timer GetTimer(int timerId)
|
||||
{
|
||||
for (int i = 0, len = _timerList.Count; i < len; i++)
|
||||
{
|
||||
if (_timerList[i].timerId == timerId)
|
||||
{
|
||||
return _timerList[i];
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0, len = _unscaledTimerList.Count; i < len; i++)
|
||||
{
|
||||
if (_unscaledTimerList[i].timerId == timerId)
|
||||
{
|
||||
return _unscaledTimerList[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void LoopCallInBadFrame()
|
||||
{
|
||||
bool isLoopCall = false;
|
||||
for (int i = 0, len = _timerList.Count; i < len; i++)
|
||||
{
|
||||
Timer timer = _timerList[i];
|
||||
if (timer.isLoop && timer.curTime <= 0)
|
||||
{
|
||||
if (timer.handler != null)
|
||||
{
|
||||
timer.handler(timer.args);
|
||||
}
|
||||
timer.curTime += timer.time;
|
||||
if (timer.curTime <= 0)
|
||||
{
|
||||
isLoopCall = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isLoopCall)
|
||||
{
|
||||
LoopCallInBadFrame();
|
||||
}
|
||||
}
|
||||
|
||||
private void LoopCallUnscaledInBadFrame()
|
||||
{
|
||||
bool isLoopCall = false;
|
||||
for (int i = 0, len = _unscaledTimerList.Count; i < len; i++)
|
||||
{
|
||||
Timer timer = _unscaledTimerList[i];
|
||||
if (timer.isLoop && timer.curTime <= 0)
|
||||
{
|
||||
if (timer.handler != null)
|
||||
{
|
||||
timer.handler(timer.args);
|
||||
}
|
||||
timer.curTime += timer.time;
|
||||
if (timer.curTime <= 0)
|
||||
{
|
||||
isLoopCall = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isLoopCall)
|
||||
{
|
||||
LoopCallUnscaledInBadFrame();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTimer()
|
||||
{
|
||||
bool isLoopCall = false;
|
||||
for (int i = 0, len = _timerList.Count; i < len; i++)
|
||||
{
|
||||
Timer timer = _timerList[i];
|
||||
if (timer.isNeedRemove)
|
||||
{
|
||||
_cacheRemoveTimers.Add(i);
|
||||
continue;
|
||||
}
|
||||
if (!timer.isRunning) continue;
|
||||
timer.curTime -= Time.deltaTime;
|
||||
if (timer.curTime <= 0)
|
||||
{
|
||||
if (timer.handler != null)
|
||||
{
|
||||
timer.handler(timer.args);
|
||||
}
|
||||
if (timer.isLoop)
|
||||
{
|
||||
timer.curTime += timer.time;
|
||||
if (timer.curTime <= 0)
|
||||
{
|
||||
isLoopCall = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_cacheRemoveTimers.Add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = _cacheRemoveTimers.Count - 1; i >= 0; i--)
|
||||
{
|
||||
_timerList.RemoveAt(_cacheRemoveTimers[i]);
|
||||
_cacheRemoveTimers.RemoveAt(i);
|
||||
}
|
||||
if (isLoopCall)
|
||||
{
|
||||
LoopCallInBadFrame();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void UpdateUnscaledTimer()
|
||||
{
|
||||
bool isLoopCall = false;
|
||||
for (int i = 0, len = _unscaledTimerList.Count; i < len; i++)
|
||||
{
|
||||
Timer timer = _unscaledTimerList[i];
|
||||
if (timer.isNeedRemove)
|
||||
{
|
||||
_cacheRemoveUnscaledTimers.Add(i);
|
||||
continue;
|
||||
}
|
||||
if (!timer.isRunning) continue;
|
||||
timer.curTime -= Time.unscaledDeltaTime;
|
||||
if (timer.curTime <= 0)
|
||||
{
|
||||
if (timer.handler != null)
|
||||
{
|
||||
timer.handler(timer.args);
|
||||
}
|
||||
if (timer.isLoop)
|
||||
{
|
||||
timer.curTime += timer.time;
|
||||
if (timer.curTime <= 0)
|
||||
{
|
||||
isLoopCall = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_cacheRemoveUnscaledTimers.Add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = _cacheRemoveUnscaledTimers.Count - 1; i >= 0; i--)
|
||||
{
|
||||
_unscaledTimerList.RemoveAt(_cacheRemoveUnscaledTimers[i]);
|
||||
_cacheRemoveUnscaledTimers.RemoveAt(i);
|
||||
}
|
||||
if (isLoopCall)
|
||||
{
|
||||
LoopCallUnscaledInBadFrame();
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
UpdateTimer();
|
||||
UpdateUnscaledTimer();
|
||||
}
|
||||
|
||||
private List<System.Timers.Timer> _ticker = new List<System.Timers.Timer>();
|
||||
public System.Timers.Timer AddSystemTimer(Action<object,System.Timers.ElapsedEventArgs> callBack)
|
||||
{
|
||||
var timerTick = new System.Timers.Timer();
|
||||
int interval = 1000;
|
||||
timerTick = new System.Timers.Timer(interval);
|
||||
timerTick.AutoReset = true;
|
||||
timerTick.Enabled = true;
|
||||
timerTick.Elapsed += new System.Timers.ElapsedEventHandler(callBack);
|
||||
|
||||
_ticker.Add(timerTick);
|
||||
|
||||
return timerTick;
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
DestroySystemTimer();
|
||||
base.OnDestroy();
|
||||
}
|
||||
|
||||
private void DestroySystemTimer()
|
||||
{
|
||||
for (int i = 0; i < _ticker.Count; i++)
|
||||
{
|
||||
if (_ticker[i] != null)
|
||||
{
|
||||
_ticker[i].Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 55d1c4bdcd29e244a8e8263c0831aeca
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d941eb2d2cbae294bb5d2788bb724e80
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,113 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace TEngine.EntityModule
|
||||
{
|
||||
public interface IIndex
|
||||
{
|
||||
int Index { get; set; }
|
||||
}
|
||||
|
||||
internal class HashSetDebugView<T> where T : IIndex
|
||||
{
|
||||
private readonly ArrayPool<T> _set;
|
||||
|
||||
public HashSetDebugView(ArrayPool<T> set)
|
||||
{
|
||||
_set = set ?? throw new ArgumentNullException(nameof(set));
|
||||
}
|
||||
|
||||
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
|
||||
public T[] Items
|
||||
{
|
||||
get
|
||||
{
|
||||
return _set.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[DebuggerTypeProxy(typeof(HashSetDebugView<>))]
|
||||
[DebuggerDisplay("Count = {Count}")]
|
||||
public class ArrayPool<T> where T:IIndex
|
||||
{
|
||||
internal T[] Items = new T[256];
|
||||
internal bool[] Buckets = new bool[256];
|
||||
private int _index;
|
||||
private int _count;
|
||||
|
||||
public T this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
return Items[index];
|
||||
}
|
||||
set
|
||||
{
|
||||
Items[index] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return _count;
|
||||
}
|
||||
}
|
||||
|
||||
public T[] ToArray()
|
||||
{
|
||||
List<T> elements = new List<T>();
|
||||
for (int i = 0; i < Items.Length; i++)
|
||||
{
|
||||
if (Buckets[i])
|
||||
{
|
||||
elements.Add(Items[i]);
|
||||
}
|
||||
}
|
||||
return elements.ToArray();
|
||||
}
|
||||
|
||||
public void Remove(T item)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
Items[item.Index] = default;
|
||||
Buckets[item.Index] = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void Add(T item)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
if (item.Index != -1)
|
||||
{
|
||||
if (!Buckets[item.Index])
|
||||
{
|
||||
Items[item.Index] = item;
|
||||
Buckets[item.Index] = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Items[_index] = item;
|
||||
Buckets[_index] = true;
|
||||
item.Index = _index;
|
||||
_index++;
|
||||
if (_index >= Items.Length)
|
||||
{
|
||||
T[] newItems = new T[Items.Length * 2];
|
||||
bool[] newBuckets = new bool[Items.Length * 2];
|
||||
Array.Copy(Items,0,newItems,0,Items.Length);
|
||||
Array.Copy(Buckets, 0, newBuckets, 0, Buckets.Length);
|
||||
Items = newItems;
|
||||
Buckets = newBuckets;
|
||||
}
|
||||
_count = _index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1abd052a77e45b44ebcde5803fb36afd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 49e862743b5e66f49a708ca914634041
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,9 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
||||
public class BaseAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 951727040b1247947a8009f67e241b60
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,9 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
||||
public class EntitySystemAttribute : BaseAttribute
|
||||
{
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 418bff9105ad99345837c9356c38d68b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 385b1863dab169f4fa291611477e106c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,46 +0,0 @@
|
||||
using System;
|
||||
using TEngine.EntityModule;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
public class EcsDemoApp : MonoBehaviour
|
||||
{
|
||||
public GameObject @object;
|
||||
|
||||
void Start()
|
||||
{
|
||||
var entity = Entity.Create<GameObjectEntity>();
|
||||
entity.AddComponent<TestUpdateCmpt>();
|
||||
entity.Bind(Instantiate(@object));
|
||||
Debug.Log(entity.ToString());
|
||||
|
||||
var entity2 = Entity.Create<GameObjectEntity>();
|
||||
entity2.Bind(Instantiate(@object));
|
||||
Debug.Log(entity2.ToString());
|
||||
|
||||
|
||||
TimerMgr.Instance.AddTimer((args =>
|
||||
{
|
||||
GameEventMgr.Instance.Send<int,Action<EcsObject>>(EntityEvent.AttachToEntity,entity.InstanceId,(obj)=>
|
||||
{
|
||||
TLogger.LogInfoSuccessd("Attach Success"+obj.HashCode);
|
||||
});
|
||||
Entity.Destroy(entity);
|
||||
Entity.Destroy(entity2);
|
||||
|
||||
|
||||
TimerMgr.Instance.AddTimer(objects =>
|
||||
{
|
||||
Start();
|
||||
}, 3f);
|
||||
}), 3f,false);
|
||||
}
|
||||
|
||||
|
||||
void Update()
|
||||
{
|
||||
EntitySystem.Instance.Update();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb5cf3287e9bf3949820b50049e4bd8c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,342 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!29 &1
|
||||
OcclusionCullingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_OcclusionBakeSettings:
|
||||
smallestOccluder: 5
|
||||
smallestHole: 0.25
|
||||
backfaceThreshold: 100
|
||||
m_SceneGUID: 00000000000000000000000000000000
|
||||
m_OcclusionCullingData: {fileID: 0}
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
m_FogDensity: 0.01
|
||||
m_LinearFogStart: 0
|
||||
m_LinearFogEnd: 300
|
||||
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
|
||||
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
|
||||
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
|
||||
m_AmbientIntensity: 1
|
||||
m_AmbientMode: 0
|
||||
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
|
||||
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_HaloStrength: 0.5
|
||||
m_FlareStrength: 1
|
||||
m_FlareFadeSpeed: 3
|
||||
m_HaloTexture: {fileID: 0}
|
||||
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_DefaultReflectionMode: 0
|
||||
m_DefaultReflectionResolution: 128
|
||||
m_ReflectionBounces: 1
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 1
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 12
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAmbientOcclusion: 0
|
||||
m_Padding: 2
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 1
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
agentSlope: 45
|
||||
agentClimb: 0.4
|
||||
ledgeDropHeight: 0
|
||||
maxJumpAcrossDistance: 0
|
||||
minRegionArea: 2
|
||||
manualCellSize: 0
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &38966529
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 38966531}
|
||||
- component: {fileID: 38966530}
|
||||
m_Layer: 0
|
||||
m_Name: EcsSystem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &38966530
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 38966529}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fb5cf3287e9bf3949820b50049e4bd8c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
object: {fileID: 3159855139361589346, guid: 5417ada688c10cf4cb2a929e4f5a5b84, type: 3}
|
||||
--- !u!4 &38966531
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 38966529}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &152798934
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 152798936}
|
||||
- component: {fileID: 152798935}
|
||||
m_Layer: 0
|
||||
m_Name: Directional Light
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!108 &152798935
|
||||
Light:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 152798934}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 10
|
||||
m_Type: 1
|
||||
m_Shape: 0
|
||||
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
|
||||
m_Intensity: 1
|
||||
m_Range: 10
|
||||
m_SpotAngle: 30
|
||||
m_InnerSpotAngle: 21.80208
|
||||
m_CookieSize: 10
|
||||
m_Shadows:
|
||||
m_Type: 2
|
||||
m_Resolution: -1
|
||||
m_CustomResolution: -1
|
||||
m_Strength: 1
|
||||
m_Bias: 0.05
|
||||
m_NormalBias: 0.4
|
||||
m_NearPlane: 0.2
|
||||
m_CullingMatrixOverride:
|
||||
e00: 1
|
||||
e01: 0
|
||||
e02: 0
|
||||
e03: 0
|
||||
e10: 0
|
||||
e11: 1
|
||||
e12: 0
|
||||
e13: 0
|
||||
e20: 0
|
||||
e21: 0
|
||||
e22: 1
|
||||
e23: 0
|
||||
e30: 0
|
||||
e31: 0
|
||||
e32: 0
|
||||
e33: 1
|
||||
m_UseCullingMatrixOverride: 0
|
||||
m_Cookie: {fileID: 0}
|
||||
m_DrawHalo: 0
|
||||
m_Flare: {fileID: 0}
|
||||
m_RenderMode: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingLayerMask: 1
|
||||
m_Lightmapping: 4
|
||||
m_LightShadowCasterMode: 0
|
||||
m_AreaSize: {x: 1, y: 1}
|
||||
m_BounceIntensity: 1
|
||||
m_ColorTemperature: 6570
|
||||
m_UseColorTemperature: 0
|
||||
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_UseBoundingSphereOverride: 0
|
||||
m_ShadowRadius: 0
|
||||
m_ShadowAngle: 0
|
||||
--- !u!4 &152798936
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 152798934}
|
||||
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
|
||||
m_LocalPosition: {x: 0, y: 3, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
|
||||
--- !u!1 &770039736
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 770039739}
|
||||
- component: {fileID: 770039738}
|
||||
- component: {fileID: 770039737}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &770039737
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 770039736}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &770039738
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 770039736}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 1
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 60
|
||||
orthographic: 0
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &770039739
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 770039736}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 1, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
@@ -1,32 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &3159855139361589346
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8488366394885562912}
|
||||
m_Layer: 0
|
||||
m_Name: EcsUnit
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &8488366394885562912
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3159855139361589346}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
@@ -1,15 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TEngine;
|
||||
using TEngine.EntityModule;
|
||||
|
||||
public class TestUpdateCmpt : EntityComponent,IUpdate
|
||||
{
|
||||
public void Update()
|
||||
{
|
||||
TLogger.LogInfo("update");
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb79036f03a4ecc4f9e5445e185abe50
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,72 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TEngine.EntityModule
|
||||
{
|
||||
public enum EcsDebugType
|
||||
{
|
||||
Entity,
|
||||
System,
|
||||
Component
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class EcsCmptDebugKeyInfo
|
||||
{
|
||||
public string m_name;
|
||||
public string val;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class EcsCmptDebugInfo
|
||||
{
|
||||
public string m_name;
|
||||
public EcsDebugType Type = EcsDebugType.Component;
|
||||
public List<EcsCmptDebugKeyInfo> m_info = new List<EcsCmptDebugKeyInfo>();
|
||||
}
|
||||
|
||||
public class EcsDebugBehaviour : UnityEngine.MonoBehaviour
|
||||
{
|
||||
public List<EcsCmptDebugInfo> m_EcsInfo = new List<EcsCmptDebugInfo>();
|
||||
public EcsCmptDebugInfo AddDebugCmpt(string cmptName)
|
||||
{
|
||||
var cmptInfo = m_EcsInfo.Find((item) => { return item.m_name == cmptName; });
|
||||
if (cmptInfo == null)
|
||||
{
|
||||
cmptInfo = new EcsCmptDebugInfo();
|
||||
cmptInfo.m_name = cmptName;
|
||||
m_EcsInfo.Add(cmptInfo); ;
|
||||
}
|
||||
|
||||
return cmptInfo;
|
||||
}
|
||||
|
||||
public void RmvDebugCmpt(string cmptName)
|
||||
{
|
||||
m_EcsInfo.RemoveAll((item) => { return item.m_name == cmptName; });
|
||||
}
|
||||
|
||||
public void SetDebugInfo(string cmptName, string key, string val)
|
||||
{
|
||||
var cmptInfo = AddDebugCmpt(cmptName);
|
||||
var entry = cmptInfo.m_info.Find((t) => { return t.m_name == key; });
|
||||
if (entry == null)
|
||||
{
|
||||
entry = new EcsCmptDebugKeyInfo();
|
||||
entry.m_name = key;
|
||||
cmptInfo.m_info.Add(entry);
|
||||
}
|
||||
|
||||
entry.val = val;
|
||||
}
|
||||
|
||||
public void RemoveAllDebugInfo(string cmpName)
|
||||
{
|
||||
var cmpInfo = m_EcsInfo.Find((item) => { return item.m_name == cmpName; });
|
||||
if (cmpInfo != null)
|
||||
{
|
||||
cmpInfo.m_info.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2dc3e456c545c0c419624e068b9249dc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,153 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace TEngine.EntityModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity架构基类Object
|
||||
/// </summary>
|
||||
public class EcsObject
|
||||
{
|
||||
public int InstanceId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
internal int HashCode
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
internal EntitySystem System;
|
||||
|
||||
|
||||
[IgnoreDataMember]
|
||||
public bool IsDisposed => this.InstanceId == 0;
|
||||
|
||||
public EcsObject()
|
||||
{
|
||||
HashCode = GetType().GetHashCode();
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
if (InstanceId != 0)
|
||||
{
|
||||
EntitySystem.Instance.EcsObjects.Remove(InstanceId);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"{this.ToString()} Instance is 0 but still Dispose");
|
||||
}
|
||||
InstanceId = 0;
|
||||
}
|
||||
|
||||
public virtual void Awake() { }
|
||||
|
||||
public virtual void OnDestroy() { }
|
||||
|
||||
/// <summary>
|
||||
/// Remove The EcsEntity or Component And Throw the EcsObject to ArrayPool When AddComponent Or Create Can Use Again
|
||||
/// </summary>
|
||||
/// <param name="ecsObject">EcsEntity/Component/System</param>
|
||||
/// <param name="reuse">此对象是否可以复用,复用会将对象丢入System对象池中 等待再次使用,如果是Entity对象,并且不复用的话,则把Entity所使用的组件也不复用</param>
|
||||
public static void Destroy(EcsObject ecsObject, bool reuse = true)
|
||||
{
|
||||
if (ecsObject is EntityComponent entityComponent)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
TLogger.LogWarning($"Destroy ID {entityComponent.InstanceId} EntityComponent{entityComponent.ToString()},reuse {reuse}");
|
||||
#endif
|
||||
entityComponent.Entity.Components.Remove(entityComponent);
|
||||
if (entityComponent is IUpdate update)
|
||||
{
|
||||
entityComponent.Entity.Updates.Remove(update);
|
||||
}
|
||||
if (entityComponent is IFixedUpdate fixedupdate)
|
||||
{
|
||||
entityComponent.Entity.FixedUpdates.Remove(fixedupdate);
|
||||
}
|
||||
if (entityComponent is ILateUpdate lateupdate)
|
||||
{
|
||||
entityComponent.Entity.LateUpdates.Remove(lateupdate);
|
||||
}
|
||||
if (reuse)
|
||||
{
|
||||
entityComponent.Entity.System.Push(entityComponent);
|
||||
}
|
||||
ecsObject.OnDestroy();
|
||||
}
|
||||
else if (ecsObject is Entity entity)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
TLogger.LogWarning($"Destroy ID {entity.InstanceId} Entity{entity.ToString()},reuse {reuse}");
|
||||
#endif
|
||||
entity.System.RemoveEntity(entity);
|
||||
entity.OnDestroy();
|
||||
while (entity.Components.Count > 0)
|
||||
{
|
||||
EntityComponent entityComponentTemp = entity.Components[0];
|
||||
entity.Components.RemoveAt(0);
|
||||
entityComponentTemp.OnDestroy();
|
||||
if (reuse)
|
||||
{
|
||||
Destroy(entityComponentTemp);
|
||||
}
|
||||
}
|
||||
entity.IsDispose = true;
|
||||
if (reuse)
|
||||
{
|
||||
entity.System.Push(entity);
|
||||
}
|
||||
}
|
||||
ecsObject.Dispose();
|
||||
}
|
||||
|
||||
public T FindObjectOfType<T>() where T : EcsObject
|
||||
{
|
||||
Type type = typeof(T);
|
||||
var elements = System.Entities.ToArray();
|
||||
for (int i = 0; i < elements.Length; i++)
|
||||
{
|
||||
if (elements[i].GetType() == type)
|
||||
{
|
||||
return elements[i] as T;
|
||||
}
|
||||
for (int n = 0; n < elements[i].Components.Count; n++)
|
||||
{
|
||||
if (elements[i].Components[n].GetType() == type)
|
||||
{
|
||||
return elements[i].Components[n] as T;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public T[] FindObjectsOfType<T>() where T : EcsObject
|
||||
{
|
||||
Type type = typeof(T);
|
||||
var items = System.Entities.ToArray();
|
||||
List<T> elements = new List<T>();
|
||||
for (int i = 0; i < items.Length; i++)
|
||||
{
|
||||
if (items[i].GetType() == type)
|
||||
{
|
||||
elements.Add(items[i] as T);
|
||||
}
|
||||
for (int n = 0; n < items[i].Components.Count; n++)
|
||||
{
|
||||
if (items[i].Components[n].GetType() == type)
|
||||
{
|
||||
elements.Add(items[i].Components[n] as T);
|
||||
}
|
||||
}
|
||||
}
|
||||
return elements.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 003794832e9179348a633bdafe92ff3c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,175 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using UnityEngine;
|
||||
|
||||
namespace TEngine.EntityModule
|
||||
{
|
||||
[Flags]
|
||||
public enum EntityStatus : byte
|
||||
{
|
||||
None = 0,
|
||||
IsFromPool = 1,
|
||||
IsRegister = 1 << 1,
|
||||
IsComponent = 1 << 2,
|
||||
IsUsing = 1 << 3,
|
||||
IsDispose = 1 << 4,
|
||||
}
|
||||
|
||||
public partial class Entity : EcsObject, IIndex
|
||||
{
|
||||
[IgnoreDataMember]
|
||||
private EntityStatus status = EntityStatus.None;
|
||||
|
||||
#region Status
|
||||
[IgnoreDataMember]
|
||||
internal bool IsFromPool
|
||||
{
|
||||
get => (this.status & EntityStatus.IsFromPool) == EntityStatus.IsFromPool;
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
this.status |= EntityStatus.IsFromPool;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.status &= ~EntityStatus.IsFromPool;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
internal bool IsDispose
|
||||
{
|
||||
get => (this.status & EntityStatus.IsDispose) == EntityStatus.IsDispose;
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
this.status |= EntityStatus.IsDispose;
|
||||
CanUpdate = false;
|
||||
CanFixedUpdate = false;
|
||||
CanLateUpdates = false;
|
||||
Updates.Clear();
|
||||
FixedUpdates.Clear();
|
||||
LateUpdates.Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.status &= ~EntityStatus.IsDispose;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
[SerializeField]
|
||||
internal List<EntityComponent> Components = new List<EntityComponent>();
|
||||
internal List<IUpdate> Updates = new List<IUpdate>();
|
||||
internal List<IFixedUpdate> FixedUpdates = new List<IFixedUpdate>();
|
||||
internal List<ILateUpdate> LateUpdates = new List<ILateUpdate>();
|
||||
internal bool CanUpdate;
|
||||
internal bool CanFixedUpdate;
|
||||
internal bool CanLateUpdates;
|
||||
|
||||
public int Index { get; set; } = -1;
|
||||
public Entity()
|
||||
{
|
||||
System = EntitySystem.Instance;
|
||||
}
|
||||
|
||||
~Entity()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
internal void Update()
|
||||
{
|
||||
for (int i = 0; i < Updates.Count; i++)
|
||||
{
|
||||
Updates[i].Update();
|
||||
}
|
||||
}
|
||||
|
||||
internal void FixedUpdate()
|
||||
{
|
||||
for (int i = 0; i < FixedUpdates.Count; i++)
|
||||
{
|
||||
FixedUpdates[i].FixedUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
internal void LateUpdate()
|
||||
{
|
||||
for (int i = 0; i < LateUpdates.Count; i++)
|
||||
{
|
||||
LateUpdates[i].LateUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string str = "[";
|
||||
for (int i = 0; i < Components.Count; i++)
|
||||
{
|
||||
str += Components[i].GetType().Name + ",";
|
||||
}
|
||||
str = str.TrimEnd(',');
|
||||
str += "]";
|
||||
return $"{GetType().Name} InstanceId {this.InstanceId} Components: {str}";
|
||||
}
|
||||
|
||||
|
||||
public void CheckDebugInfo(GameObject gameObject)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (gameObject == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var debugBehaviour = UnityUtil.AddMonoBehaviour<EcsDebugBehaviour>(gameObject);
|
||||
debugBehaviour.m_EcsInfo.Clear();
|
||||
for (int i = 0; i < this.Components.Count; i++)
|
||||
{
|
||||
var component = this.Components[i];
|
||||
var cmptName = component.GetType().Name;
|
||||
debugBehaviour.SetDebugInfo(cmptName, "", "");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
public void CheckDebugInfo()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
//var actorEntity = this as Entity;
|
||||
|
||||
//if (actorEntity.gameObject == null)
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
|
||||
//var debugBehaviour = UnityUtil.AddMonoBehaviour<EcsDebugBehaviour>(actorEntity.gameObject);
|
||||
//debugBehaviour.m_EcsInfo.Clear();
|
||||
//for (int i = 0; i < this.Components.Count; i++)
|
||||
//{
|
||||
// var component = this.Components[i];
|
||||
// var cmptName = component.GetType().Name;
|
||||
// debugBehaviour.SetDebugInfo(cmptName, "", "");
|
||||
//}
|
||||
#endif
|
||||
}
|
||||
|
||||
#region Static
|
||||
public static T Create<T>() where T : Entity, new()
|
||||
{
|
||||
var entity = EntitySystem.Instance.Create<T>();
|
||||
#if UNITY_EDITOR
|
||||
TLogger.LogWarning($"Create ID {entity.InstanceId} EntityComponent{entity.ToString()}");
|
||||
#endif
|
||||
return entity;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f5bc14d7a4aee34695c39d02ae1c71f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,22 +0,0 @@
|
||||
namespace TEngine.EntityModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity构架可以将此组件从Entity上移除这个组件并丢入对象池,给其他此刻需要此组件的Entity使用,
|
||||
/// 因此可以节省大量的内存反复创建和释放, 这也是Entity的特性可以大量重复使用组件
|
||||
/// </summary>
|
||||
public abstract class EntityComponent : EcsObject
|
||||
{
|
||||
public Entity Entity { get; set; }
|
||||
|
||||
#region Static
|
||||
public static T Create<T>() where T : EntityComponent, new()
|
||||
{
|
||||
var entity = EntitySystem.Instance.CreateComponent<T>();
|
||||
#if UNITY_EDITOR
|
||||
TLogger.LogInfoSuccessd($"Create ID {entity.InstanceId} EntityComponent{ entity.ToString()}");
|
||||
#endif
|
||||
return entity;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f60a73d6fbcb0a4ab868419f1a7706e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,134 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TEngine.EntityModule
|
||||
{
|
||||
partial class Entity
|
||||
{
|
||||
public void RmvComponent<T>(T component) where T :EntityComponent, new()
|
||||
{
|
||||
Destroy(component);
|
||||
|
||||
CheckUpdate();
|
||||
}
|
||||
|
||||
public T AddComponent<T>() where T :EntityComponent, new()
|
||||
{
|
||||
T component = EntityComponent.Create<T>();
|
||||
component.Entity = this;
|
||||
component.System = System;
|
||||
Components.Add(component);
|
||||
component.Awake();
|
||||
if (component is IUpdate update)
|
||||
{
|
||||
Updates.Add(update);
|
||||
}
|
||||
else if (component is IFixedUpdate fixedUpdate)
|
||||
{
|
||||
FixedUpdates.Add(fixedUpdate);
|
||||
}
|
||||
else if (component is ILateUpdate lateUpdate)
|
||||
{
|
||||
LateUpdates.Add(lateUpdate);
|
||||
}
|
||||
CheckUpdate();
|
||||
return component;
|
||||
}
|
||||
|
||||
public EntityComponent AddComponent(EntityComponent component)
|
||||
{
|
||||
component.Entity = this;
|
||||
component.System = System;
|
||||
Components.Add(component);
|
||||
component.Awake();
|
||||
if (component is IUpdate update)
|
||||
{
|
||||
Updates.Add(update);
|
||||
}
|
||||
else if (component is IFixedUpdate fixedUpdate)
|
||||
{
|
||||
FixedUpdates.Add(fixedUpdate);
|
||||
}
|
||||
else if (component is ILateUpdate lateUpdate)
|
||||
{
|
||||
LateUpdates.Add(lateUpdate);
|
||||
}
|
||||
CheckUpdate();
|
||||
return component;
|
||||
}
|
||||
|
||||
public T GetComponent<T>() where T :EntityComponent
|
||||
{
|
||||
for (int i = 0; i < Components.Count; i++)
|
||||
{
|
||||
if (Components[i] is T type)
|
||||
{
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public EntityComponent GetComponent(Type componentType)
|
||||
{
|
||||
for (int i = 0; i < Components.Count; i++)
|
||||
{
|
||||
if (Components[i].GetType() == componentType)
|
||||
{
|
||||
return Components[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public T[] GetComponents<T>() where T :EntityComponent
|
||||
{
|
||||
List<T> elements = new List<T>();
|
||||
for (int i = 0; i < Components.Count; i++)
|
||||
{
|
||||
if (Components[i] is T type)
|
||||
{
|
||||
elements.Add(type);
|
||||
}
|
||||
}
|
||||
return elements.ToArray();
|
||||
}
|
||||
|
||||
public List<T> GetComponentsList<T>() where T :EntityComponent
|
||||
{
|
||||
List<T> elements = new List<T>();
|
||||
for (int i = 0; i < Components.Count; i++)
|
||||
{
|
||||
if (Components[i] is T type)
|
||||
{
|
||||
elements.Add(type);
|
||||
}
|
||||
}
|
||||
return elements;
|
||||
}
|
||||
|
||||
public EntityComponent[] GetComponents(Type comType)
|
||||
{
|
||||
List<EntityComponent> elements = new List<EntityComponent>();
|
||||
for (int i = 0; i < Components.Count; i++)
|
||||
{
|
||||
{
|
||||
if (Components[i].GetType() == comType)
|
||||
{
|
||||
elements.Add(Components[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return elements.ToArray();
|
||||
}
|
||||
|
||||
private void CheckUpdate()
|
||||
{
|
||||
CanUpdate = Updates.Count > 0;
|
||||
CanFixedUpdate = FixedUpdates.Count > 0;
|
||||
CanLateUpdates = LateUpdates.Count > 0;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: db2d67ed7f48ae44fb071c9663fe1c90
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,266 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TEngine.EntityModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity系统
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class EntitySystem : IDisposable
|
||||
{
|
||||
private static EntitySystem _instance;
|
||||
|
||||
public static EntitySystem Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
_instance = new EntitySystem();
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
private EntitySystem()
|
||||
{
|
||||
GameEventMgr.Instance.AddEventListener<int,Action<EcsObject>>(EntityEvent.AttachToEntity, AttachToEntity);
|
||||
//Update(true);
|
||||
MonoUtility.AddUpdateListener((() =>
|
||||
{
|
||||
Update(false);
|
||||
}));
|
||||
MonoUtility.AddFixedUpdateListener(FixedUpdate);
|
||||
MonoUtility.AddLateUpdateListener(LateUpdate);
|
||||
}
|
||||
/// <summary>
|
||||
/// Key -> HashSet(type) / Value -> Stack(EcsObject)
|
||||
/// </summary>
|
||||
internal readonly Dictionary<int, Stack<EcsObject>> ObjectPool = new Dictionary<int, Stack<EcsObject>>();
|
||||
internal readonly ArrayPool<Entity> Entities = new ArrayPool<Entity>();
|
||||
internal readonly Dictionary<int, EcsObject> EcsObjects = new Dictionary<int, EcsObject>();
|
||||
internal int CurInstanceId = 1000;
|
||||
|
||||
#region internal
|
||||
internal void AddEntity(Entity entity)
|
||||
{
|
||||
entity.System = this;
|
||||
entity.Awake();
|
||||
Entities.Add(entity);
|
||||
}
|
||||
|
||||
internal void RemoveEntity(Entity entity)
|
||||
{
|
||||
Entities.Buckets[entity.Index] = false;
|
||||
}
|
||||
|
||||
private T Get<T>() where T : EcsObject, new()
|
||||
{
|
||||
int type = typeof(T).GetHashCode();
|
||||
if (ObjectPool.TryGetValue(type, out Stack<EcsObject> stack))
|
||||
{
|
||||
if (stack.Count > 0)
|
||||
{
|
||||
var poolObj = (T)stack.Pop();
|
||||
GenInstanceId(poolObj);
|
||||
return poolObj;
|
||||
}
|
||||
goto Instantiate;
|
||||
}
|
||||
stack = new Stack<EcsObject>();
|
||||
ObjectPool.Add(type, stack);
|
||||
Instantiate: T ecsObject = new T();
|
||||
GenInstanceId(ecsObject);
|
||||
return ecsObject;
|
||||
}
|
||||
|
||||
private void GenInstanceId(EcsObject ecsObject)
|
||||
{
|
||||
ecsObject.InstanceId = CurInstanceId;
|
||||
Instance.CurInstanceId++;
|
||||
EcsObjects.Add(ecsObject.InstanceId, ecsObject);
|
||||
}
|
||||
|
||||
internal void Push(EcsObject ecsObject)
|
||||
{
|
||||
int type = ecsObject.HashCode;
|
||||
if (ObjectPool.TryGetValue(type, out Stack<EcsObject> stack))
|
||||
{
|
||||
stack.Push(ecsObject);
|
||||
return;
|
||||
}
|
||||
stack = new Stack<EcsObject>();
|
||||
ObjectPool.Add(type, stack);
|
||||
stack.Push(ecsObject);
|
||||
}
|
||||
internal T Create<T>() where T : Entity, new()
|
||||
{
|
||||
T entity = Get<T>();
|
||||
entity.IsDispose = false;
|
||||
AddEntity(entity);
|
||||
return entity;
|
||||
}
|
||||
internal T CreateComponent<T>() where T : EntityComponent, new()
|
||||
{
|
||||
T component = Get<T>();
|
||||
return component;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Update
|
||||
/// <summary>
|
||||
/// 更新Entity系统
|
||||
/// </summary>
|
||||
/// <param name="worker">线程池是否并行</param>
|
||||
public void Update(bool worker = false)
|
||||
{
|
||||
int count = Entities.Count;
|
||||
if (!worker)
|
||||
{
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (!Entities.Buckets[i])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Entities[i].CanUpdate)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Entities[i].Update();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Parallel.For(0, count, i =>
|
||||
{
|
||||
if (!Entities.Buckets[i])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Entities[i].CanUpdate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Entities[i].Update();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void FixedUpdate()
|
||||
{
|
||||
int count = Entities.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (!Entities.Buckets[i])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Entities[i].CanFixedUpdate)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Entities[i].FixedUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void LateUpdate()
|
||||
{
|
||||
int count = Entities.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (!Entities.Buckets[i])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Entities[i].CanLateUpdates)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Entities[i].LateUpdate();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Dispose
|
||||
public void Dispose()
|
||||
{
|
||||
_instance = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region FindObjectOfType
|
||||
public T FindObjectOfType<T>() where T : EcsObject
|
||||
{
|
||||
Type type = typeof(T);
|
||||
var elements = Entities.ToArray();
|
||||
for (int i = 0; i < elements.Length; i++)
|
||||
{
|
||||
if (elements[i].GetType() == type)
|
||||
{
|
||||
return elements[i] as T;
|
||||
}
|
||||
|
||||
for (int j = 0; j < elements[i].Components.Count; j++)
|
||||
{
|
||||
if (elements[i].Components[j].GetType() == type)
|
||||
{
|
||||
return elements[i].Components[j] as T;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public T[] FindObjectsOfType<T>() where T : EcsObject
|
||||
{
|
||||
Type type = typeof(T);
|
||||
var entities = Entities.ToArray();
|
||||
List<T> elements = new List<T>();
|
||||
for (int i = 0; i < entities.Length; i++)
|
||||
{
|
||||
if (entities[i].GetType() == type)
|
||||
{
|
||||
elements.Add(entities[i] as T);
|
||||
}
|
||||
for (int n = 0; n < entities[i].Components.Count; n++)
|
||||
{
|
||||
if (entities[i].Components[n].GetType() == type)
|
||||
{
|
||||
elements.Add(entities[i].Components[n] as T);
|
||||
}
|
||||
}
|
||||
}
|
||||
return elements.ToArray();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region AttachEventToEntity
|
||||
|
||||
public void AttachToEntity(int instanceId,Action<EcsObject> callback)
|
||||
{
|
||||
if (EcsObjects.TryGetValue(instanceId,out var entity))
|
||||
{
|
||||
if (entity.IsDisposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
callback?.Invoke(entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public static class EntityEvent
|
||||
{
|
||||
public static int AttachToEntity = StringId.StringToHash("EntityEvent.AttachToEntity");
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d2bd4af51a518164c8da0dff296b2bb1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,94 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace TEngine.EntityModule
|
||||
{
|
||||
public class EventCmpt :EntityComponent
|
||||
{
|
||||
private GameEvent _gameEvent;
|
||||
|
||||
#region AddEventListener
|
||||
public void AddEventListener<T>(int eventId, Action<T> action)
|
||||
{
|
||||
_gameEvent.AddEventListener(eventId, action);
|
||||
}
|
||||
|
||||
public void AddEventListener<T, U>(int eventId, Action<T, U> action)
|
||||
{
|
||||
_gameEvent.AddEventListener(eventId, action);
|
||||
}
|
||||
|
||||
public void AddEventListener<T, U, W>(int eventId, Action<T, U, W> action)
|
||||
{
|
||||
_gameEvent.AddEventListener(eventId, action);
|
||||
}
|
||||
|
||||
public void AddEventListener(int eventId, Action action)
|
||||
{
|
||||
_gameEvent.AddEventListener(eventId, action);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region RemoveEventListener
|
||||
public void RemoveEventListener<T>(int eventId, Action<T> action)
|
||||
{
|
||||
_gameEvent.RemoveEventListener(eventId, action);
|
||||
}
|
||||
|
||||
public void RemoveEventListener<T, U>(int eventId, Action<T, U> action)
|
||||
{
|
||||
_gameEvent.RemoveEventListener(eventId, action);
|
||||
}
|
||||
|
||||
public void RemoveEventListener<T, U, W>(int eventId, Action<T, U, W> action)
|
||||
{
|
||||
_gameEvent.RemoveEventListener(eventId, action);
|
||||
}
|
||||
|
||||
public void RemoveEventListener(int eventId, Action action)
|
||||
{
|
||||
_gameEvent.RemoveEventListener(eventId, action);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Send
|
||||
public void Send<T>(int eventId, T info)
|
||||
{
|
||||
_gameEvent.Send(eventId, info);
|
||||
}
|
||||
|
||||
public void Send<T, U>(int eventId, T info, U info2)
|
||||
{
|
||||
_gameEvent.Send(eventId, info, info2);
|
||||
}
|
||||
|
||||
public void Send<T, U, W>(int eventId, T info, U info2, W info3)
|
||||
{
|
||||
_gameEvent.Send(eventId, info, info2, info3);
|
||||
}
|
||||
|
||||
public void Send(int eventId)
|
||||
{
|
||||
_gameEvent.Send(eventId);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Clear
|
||||
public void Clear()
|
||||
{
|
||||
GameMemPool<GameEvent>.Free(_gameEvent);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 生命周期
|
||||
public override void OnDestroy()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
public override void Awake()
|
||||
{
|
||||
_gameEvent = GameMemPool<GameEvent>.Alloc();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7e37fd19b27821c49b3bab2d92b2fe37
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -1,30 +0,0 @@
|
||||
using TEngine.EntityModule;
|
||||
using UnityEngine;
|
||||
|
||||
public class GameObjectEntity :Entity
|
||||
{
|
||||
public GameObject gameObject;
|
||||
public Transform tranform;
|
||||
|
||||
public void Bind(GameObject gameObject)
|
||||
{
|
||||
this.gameObject = gameObject;
|
||||
tranform = this.gameObject.transform;
|
||||
}
|
||||
|
||||
public override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
}
|
||||
|
||||
public override void OnDestroy()
|
||||
{
|
||||
if (gameObject != null)
|
||||
{
|
||||
Object.Destroy(gameObject);
|
||||
gameObject = null;
|
||||
}
|
||||
tranform = null;
|
||||
base.OnDestroy();
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user