diff --git a/Samples.meta b/Editor/CustomDrawer.meta
similarity index 77%
rename from Samples.meta
rename to Editor/CustomDrawer.meta
index 87afc08..aabb588 100644
--- a/Samples.meta
+++ b/Editor/CustomDrawer.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 4d0b936e6a4957548b70fbc19a5d4e70
+guid: 861e0bb053777664c8fd1ff8f6a125d7
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Editor/CustomDrawer/ReName.cs b/Editor/CustomDrawer/ReName.cs
new file mode 100644
index 0000000..29655ce
--- /dev/null
+++ b/Editor/CustomDrawer/ReName.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+using UnityEngine;
+
+#if UNITY_EDITOR
+
+using UnityEditor;
+using XericLibrary.Runtime.CustomDrawer;
+
+namespace XericLibrary.Editor.CustomDrawer
+{
+
+ [CustomPropertyDrawer(typeof(ReNameAttribute))]
+ public class ReNameDrawer : PropertyDrawer
+ {
+ private GUIContent lable = null;
+ public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
+ {
+ if(lable == null)
+ {
+ string name = (attribute as ReNameAttribute).Name;
+ lable = new GUIContent(name);
+ }
+
+ EditorGUI.PropertyField(position, property, lable);
+ }
+ }
+}
+
+#endif
+
diff --git a/Samples/Example/SampleExample.cs.meta b/Editor/CustomDrawer/ReName.cs.meta
similarity index 83%
rename from Samples/Example/SampleExample.cs.meta
rename to Editor/CustomDrawer/ReName.cs.meta
index a37fca9..53c7b8b 100644
--- a/Samples/Example/SampleExample.cs.meta
+++ b/Editor/CustomDrawer/ReName.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: d5c96d394d80e624296ef2777a48dc07
+guid: 16413afe09f44374d8cdefbe1fcb6960
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Editor/EditorExample.cs b/Editor/EditorExample.cs
deleted file mode 100644
index 30f1429..0000000
--- a/Editor/EditorExample.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// -----------------------------------------------------------------------------
-//
-// Use this editor example C# file to develop editor (non-runtime) code.
-//
-// -----------------------------------------------------------------------------
-
-namespace Lrss3.XericLibrary.Editor
-{
- ///
- /// Provide a general description of the public class.
- ///
- ///
- /// Packages require XmlDoc documentation for ALL Package APIs.
- /// https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments
- ///
- public class MyPublicEditorExampleClass
- {
- ///
- /// Provide a description of what this private method does.
- ///
- /// Description of parameter 1
- /// Description of parameter 2
- /// Description of parameter 3
- /// Description of what the function returns
- public int CountThingsAndDoStuff(int parameter1, int parameter2, bool parameter3)
- {
- return parameter3 ? (parameter1 + parameter2) : (parameter1 - parameter2);
- }
- }
-}
\ No newline at end of file
diff --git a/LICENSE.meta b/LICENSE.meta
new file mode 100644
index 0000000..22362f6
--- /dev/null
+++ b/LICENSE.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: b35ade651ed44bb43883217ce64b221b
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Tests.meta b/Runtime/CustomDrawer.meta
similarity index 77%
rename from Tests.meta
rename to Runtime/CustomDrawer.meta
index 76abc03..7649bc3 100644
--- a/Tests.meta
+++ b/Runtime/CustomDrawer.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 78c744bdc2c69df4fafba296e39987eb
+guid: 5acfcc21434615842ba9b630afcffe60
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Runtime/CustomDrawer/ReName.cs b/Runtime/CustomDrawer/ReName.cs
new file mode 100644
index 0000000..629ac83
--- /dev/null
+++ b/Runtime/CustomDrawer/ReName.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+using UnityEngine;
+
+namespace XericLibrary.Runtime.CustomDrawer
+{
+ [AttributeUsage(AttributeTargets.Field)]
+ public class ReNameAttribute : PropertyAttribute
+ {
+ public string Name;
+ public ReNameAttribute(string name)
+ {
+ this.Name = name;
+ }
+ }
+}
diff --git a/Editor/EditorExample.cs.meta b/Runtime/CustomDrawer/ReName.cs.meta
similarity index 83%
rename from Editor/EditorExample.cs.meta
rename to Runtime/CustomDrawer/ReName.cs.meta
index 3c9c1ab..79c67e4 100644
--- a/Editor/EditorExample.cs.meta
+++ b/Runtime/CustomDrawer/ReName.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 96cbfb583c534f946950be81e68280f0
+guid: a38c2728078def2458ddbe0163f6a1d9
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Samples/Example.meta b/Runtime/Logger.meta
similarity index 77%
rename from Samples/Example.meta
rename to Runtime/Logger.meta
index b3303e0..a1e7b0e 100644
--- a/Samples/Example.meta
+++ b/Runtime/Logger.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 48d0ca12b8b36464aa6264d8aff7940c
+guid: 10fcb4f8258542744b6a1e2b639a4d86
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Runtime/Logger/MergeDebug.cs b/Runtime/Logger/MergeDebug.cs
new file mode 100644
index 0000000..d9ca5d8
--- /dev/null
+++ b/Runtime/Logger/MergeDebug.cs
@@ -0,0 +1,148 @@
+using log4net.Util;
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using UnityEngine;
+
+using static Codice.CM.WorkspaceServer.WorkspaceTreeDataStore;
+
+namespace XericLibrary.Runtime.MacroLibrary
+{
+ ///
+ /// Merged debug messages
+ ///
+ ///
+ /// 合并调试消息,
+ /// 如果需要输出连续的一串消息,但又因为太长或太细碎导致调试信息破碎,
+ /// 就适合使用合并消息。
+ ///
+ public class MergeDebug
+ {
+ #region 字段属性
+
+ ///
+ /// 单次发送消息的限制长度
+ ///
+ private const int debugInfomationLengthLimit = 4000;
+
+ ///
+ /// 消息内容
+ ///
+ private StringBuilder messageContext;
+
+ #endregion
+
+ #region 构造函数
+
+ public MergeDebug()
+ {
+ messageContext = new StringBuilder();
+ }
+
+ #endregion
+
+ #region 输入消息
+
+ ///
+ /// Push the message content
+ ///
+ ///
+ /// 压入消息内容
+ ///
+ public void PushLog(string message)
+ {
+ messageContext.Append(message);
+ }
+
+ ///
+ /// Push the message content, with a line feed
+ ///
+ ///
+ /// 压入消息内容,并在末尾追加一个换行符
+ ///
+ public void PushLogLine(string message)
+ {
+ messageContext.AppendLine(message);
+ }
+
+ #endregion
+
+ #region 输出消息
+
+ private static bool IsNewLine(char c)
+ {
+ return c == '\n' || c == '\r';
+ }
+
+ private static void PopLog(StringBuilder sb, Action debugFunc)
+ {
+ //debugInfomationLengthLimit
+ var context = sb.ToString();
+
+ int startIndex = 0;
+ int endIndex = 0;
+
+ while(startIndex < context.Length)
+ {
+ endIndex = Math.Min(startIndex + debugInfomationLengthLimit, context.Length);
+
+ while(endIndex > startIndex && !IsNewLine(context[endIndex - 1]))
+ {
+ endIndex--;
+ }
+
+ string line = context.Substring(startIndex, endIndex - startIndex);
+ debugFunc(line);
+
+ startIndex = endIndex;
+ while(startIndex < context.Length && IsNewLine(context[startIndex]))
+ {
+ startIndex++;
+ }
+ }
+
+ }
+
+ ///
+ /// Send information in a message type
+ ///
+ ///
+ /// 以消息类型发送信息
+ ///
+ public void Log()
+ {
+ PopLog(messageContext, a => Debug.Log(a));
+ messageContext.Clear();
+ }
+
+ ///
+ /// Send information in a Warning type
+ ///
+ ///
+ /// 以警告类型发送信息
+ ///
+ public void LogWarning()
+ {
+ PopLog(messageContext, a => Debug.LogWarning(a));
+ messageContext.Clear();
+ }
+
+ ///
+ /// Send information in a Error type
+ ///
+ ///
+ /// 以错误消息类型发送信息
+ ///
+ public void LogError()
+ {
+ PopLog(messageContext, a => Debug.LogError(a));
+ messageContext.Clear();
+ }
+
+ #endregion
+ }
+}
diff --git a/Tests/Editor/EditorExampleTest.cs.meta b/Runtime/Logger/MergeDebug.cs.meta
similarity index 83%
rename from Tests/Editor/EditorExampleTest.cs.meta
rename to Runtime/Logger/MergeDebug.cs.meta
index def1aa7..8f07be1 100644
--- a/Tests/Editor/EditorExampleTest.cs.meta
+++ b/Runtime/Logger/MergeDebug.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 5fc80c26917602543b1db1cc73b00d15
+guid: 12ca18e1b72f65247a03c7f98672eb00
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Runtime/Lrss3.XericLibrary.asmdef b/Runtime/Lrss3.XericLibrary.asmdef
index 2fc1239..f33b6c6 100644
--- a/Runtime/Lrss3.XericLibrary.asmdef
+++ b/Runtime/Lrss3.XericLibrary.asmdef
@@ -1,6 +1,14 @@
{
"name": "Lrss3.XericLibrary",
+ "rootNamespace": "",
"references": [],
"includePlatforms": [],
- "excludePlatforms": []
-}
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": false,
+ "precompiledReferences": [],
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": false
+}
\ No newline at end of file
diff --git a/Tests/Editor.meta b/Runtime/MicroLibrary.meta
similarity index 77%
rename from Tests/Editor.meta
rename to Runtime/MicroLibrary.meta
index 7f2c27d..c5ac979 100644
--- a/Tests/Editor.meta
+++ b/Runtime/MicroLibrary.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: caece903f4fbc394989879cffabbbd4c
+guid: c3fe6ea067e41f047a94cf2f23dbd2d8
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Runtime/MicroLibrary/MacroConst.cs b/Runtime/MicroLibrary/MacroConst.cs
new file mode 100644
index 0000000..dd45b95
--- /dev/null
+++ b/Runtime/MicroLibrary/MacroConst.cs
@@ -0,0 +1,98 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace XericLibrary.Runtime.MacroLibrary
+{
+ public static partial class MacroMath
+ {
+ #region 常量
+
+ ///
+ /// 弧度转角度
+ ///
+ public const float Rad2Ang = 57.295779513082320876798154814105f;
+ ///
+ /// 弧度转角度
+ ///
+ public const double Rad2Ang_d = 57.295779513082320876798154814105d;
+ ///
+ /// 弧度转角度
+ ///
+ public const decimal Rad2Ang_m = 57.295779513082320876798154814105m;
+
+
+ ///
+ /// 角度转弧度
+ ///
+ public const float Ang2Rad = .01745329251994329576923690768489f;
+ ///
+ /// 角度转弧度
+ ///
+ public const double Ang2Rad_d = .01745329251994329576923690768489d;
+ ///
+ /// 角度转弧度
+ ///
+ public const decimal Ang2Rad_m = .01745329251994329576923690768489m;
+
+
+ ///
+ /// 最大可接受的误差
+ ///
+ public const float MaxError = .000001f;
+ ///
+ /// 最大可接受的误差
+ ///
+ public const double MaxError_d = .0000001d;
+ ///
+ /// 最大可接受的误差
+ ///
+ public const decimal MaxError_m = .00000001m;
+
+
+ ///
+ /// 根号2的一半,用于快速平方根除以二
+ ///
+ public const float Sqrt22 = 0.70710678118654752440084436210485f;
+ ///
+ /// 根号2的一半,用于快速平方根除以二
+ ///
+ public const double Sqrt22_d = 0.70710678118654752440084436210485d;
+ ///
+ /// 根号2的一半,用于快速平方根除以二
+ ///
+ public const decimal Sqrt22_m = 0.70710678118654752440084436210485m;
+
+
+ ///
+ /// 费根鲍姆常数,是周期分叉及混沌现象的一个比值,可用于人口变化,水滴周期等现象
+ ///
+ public const float Feigenbaum = 4.669201609102990671853203820466201617258185577475768632745651343004134f;
+ ///
+ /// 费根鲍姆常数,是周期分叉及混沌现象的一个比值,可用于人口变化,水滴周期等现象
+ ///
+ public const double Feigenbaum_d = 4.669201609102990671853203820466201617258185577475768632745651343004134d;
+ ///
+ /// 费根鲍姆常数,是周期分叉及混沌现象的一个比值,可用于人口变化,水滴周期等现象
+ ///
+ public const decimal Feigenbaum_m = 4.669201609102990671853203820466201617258185577475768632745651343004134m;
+
+
+ ///
+ /// 表示无效的三维整数矢量
+ ///
+ public static readonly Vector3Int Vector3Int_Negate = new Vector3Int(-1, -1, -1);
+
+ ///
+ /// 表示无效的二维整数矢量
+ ///
+ public static readonly Vector2Int Vector2Int_Negate = new Vector2Int(-1, -1);
+
+ ///
+ /// 表示无效的整数
+ ///
+ public static readonly int Int_Negate = -1;
+
+ #endregion
+ }
+}
diff --git a/Runtime/RuntimeExample.cs.meta b/Runtime/MicroLibrary/MacroConst.cs.meta
similarity index 83%
rename from Runtime/RuntimeExample.cs.meta
rename to Runtime/MicroLibrary/MacroConst.cs.meta
index 5a72ef2..033138a 100644
--- a/Runtime/RuntimeExample.cs.meta
+++ b/Runtime/MicroLibrary/MacroConst.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: cf363a55b6e618c44a48334e02a8e03a
+guid: fc508d99ffe561a488e1a2a002f20871
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Runtime/MicroLibrary/MacroEnum.cs b/Runtime/MicroLibrary/MacroEnum.cs
new file mode 100644
index 0000000..a97562c
--- /dev/null
+++ b/Runtime/MicroLibrary/MacroEnum.cs
@@ -0,0 +1,144 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+
+using Unity.VisualScripting.YamlDotNet.Core.Tokens;
+
+using UnityEngine;
+
+
+namespace XericLibrary.Runtime.MacroLibrary
+{
+ ///
+ /// 枚举宏,用于完成枚举项遍历,位操作等
+ ///
+ public class MacroEnum
+ where T: struct, Enum
+ {
+ ///
+ /// 反射组值
+ ///
+ private Array valueArray;
+
+ ///
+ /// 反射组名称
+ ///
+ private string[] nameArray;
+
+ ///
+ /// 构建一个枚举辅助器
+ ///
+ public MacroEnum()
+ {
+ valueArray = typeof(T).GetEnumValues();
+ nameArray = typeof(T).GetEnumNames();
+ }
+
+
+ ///
+ /// 获取列表
+ ///
+ ///
+ public IEnumerable GetValues()
+ {
+ foreach(var type in valueArray)
+ yield return (T)type;
+ }
+
+ ///
+ /// 获取列表
+ ///
+ ///
+ public IEnumerable GetNames()
+ {
+ foreach(var type in nameArray)
+ yield return type;
+ }
+
+ ///
+ /// 获取枚举项目
+ ///
+ ///
+ public IEnumerable<(string, T)> GetEnums()
+ {
+ var output = nameArray
+ .Zip(GetValues(), (name, value) => (name, value));
+ return output;
+ }
+
+
+ ///
+ /// 设置目标的枚举值
+ ///
+ ///
+ ///
+ public static void SetEnum(ref int target, params T[] values)
+ {
+ foreach(var value in values)
+ {
+ target |= Convert.ToInt32(value);
+ }
+ }
+
+ ///
+ /// 设置目标的枚举值
+ ///
+ ///
+ ///
+ public static void SetEnum(ref int target, T value)
+ {
+ target |= Convert.ToInt32(value);
+ }
+
+ ///
+ /// 复位目标的枚举值
+ ///
+ ///
+ ///
+ public static void ResetEnum(ref int target, params T[] values)
+ {
+ int temp = 0;
+ foreach(var value in values)
+ {
+ temp |= Convert.ToInt32(value);
+ }
+ target &= ~temp;
+ }
+
+ ///
+ /// 复位目标的枚举值
+ ///
+ ///
+ ///
+ public static void ResetEnum(ref int target, T value)
+ {
+ target &= ~Convert.ToInt32(value);
+ }
+
+ ///
+ /// 翻转目标的枚举值
+ ///
+ ///
+ ///
+ public static void FlipEnum(ref int target, params T[] values)
+ {
+ int temp = 0;
+ foreach(var value in values)
+ {
+ temp |= Convert.ToInt32(value);
+ }
+ target ^= temp;
+ }
+
+ ///
+ /// 翻转目标的枚举值
+ ///
+ ///
+ ///
+ public static void FlipEnum(ref int target, T value)
+ {
+ target ^= Convert.ToInt32(value);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Runtime/MicroLibrary/MacroEnum.cs.meta b/Runtime/MicroLibrary/MacroEnum.cs.meta
new file mode 100644
index 0000000..0be34f5
--- /dev/null
+++ b/Runtime/MicroLibrary/MacroEnum.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 94a45cbae926bdb4e9a05c822232c00b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/MicroLibrary/MacroMath.cs b/Runtime/MicroLibrary/MacroMath.cs
new file mode 100644
index 0000000..01c137c
--- /dev/null
+++ b/Runtime/MicroLibrary/MacroMath.cs
@@ -0,0 +1,127 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+using UnityEngine;
+
+namespace XericLibrary.Runtime.MacroLibrary
+{
+ ///
+ /// 数学库
+ ///
+ public static partial class MacroMath
+ {
+ #region 随机
+
+ ///
+ /// 哈希后处理
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static ulong MurmurFinalize(ulong index)
+ {
+ index ^= index >> 33;
+ index *= 0xff51afd7ed558ccd;
+ index ^= index >> 33;
+ index *= 0xc4ceb9fe1a85ec53;
+ index ^= index >> 33;
+ return index;
+ }
+
+ ///
+ /// 大范围随机
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static ulong RandomNumber(ulong index)
+ {
+ index *= 1103515245;
+ index += 12345;
+ index *= 6364136223846793005UL;
+ index += 1442695040888963407UL;
+ index %= 18446744073709551615UL;
+ return index;
+ }
+
+ #endregion
+
+ #region 数学
+
+ ///
+ /// pmod
+ ///
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static double PMod(double a, double b)
+ {
+ double z = a % b;
+ double w = (z < 0) ? -1 : 1;
+ z = (z < 0) ? -z : z;
+ if(w < 0)
+ return b - z;
+ else
+ return z;
+ }
+
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float MinPositive(float a, float b)
+ => Math.Min(Math.Max(0, a), Math.Max(0, b));
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int MinPositive(int a, int b)
+ => Math.Min(Math.Max(0, a), Math.Max(0, b));
+
+ #endregion
+
+ #region 字节控制
+
+ ///
+ /// 设置字
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static void SetByteState(ref int target, int site, bool state)
+ {
+ if(state)
+ target |= 1 << site;
+
+ else
+ target &= 0xff - (1 << site);
+ }
+
+ ///
+ /// 设置字
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static void SetByteState(ref int target, Enum site, bool state)
+ {
+ SetByteState(ref target, Convert.ToInt32(site), state);
+ }
+
+ ///
+ /// 检查字
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool GetByteState(int target, int site)
+ {
+ return (target >> site & 0x01) > 0;
+ }
+
+ ///
+ /// 检查字
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool GetByteState(int target, Enum site)
+ {
+ return GetByteState(target, Convert.ToInt32(site));
+ }
+
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/Runtime/MicroLibrary/MacroMath.cs.meta b/Runtime/MicroLibrary/MacroMath.cs.meta
new file mode 100644
index 0000000..0c72ffc
--- /dev/null
+++ b/Runtime/MicroLibrary/MacroMath.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 45a81e001aee8594dbc45766fef9dfcd
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/MicroLibrary/MacroObject.cs b/Runtime/MicroLibrary/MacroObject.cs
new file mode 100644
index 0000000..7cf1f93
--- /dev/null
+++ b/Runtime/MicroLibrary/MacroObject.cs
@@ -0,0 +1,42 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace XericLibrary.Runtime.MacroLibrary
+{
+ public static class MacroObject
+ {
+ #region 对象操作
+
+ ///
+ /// 无论如何都要获取一个组件
+ ///
+ ///
+ ///
+ public static T GetComponentAnyway(this GameObject obj)
+ where T : Component
+ {
+ var component = obj.GetComponent();
+ if(component is null)
+ component = obj.AddComponent();
+ return component;
+ }
+
+ ///
+ /// 无论如何都要获取一个对象
+ ///
+ ///
+ ///
+ ///
+ public static T GetObjectAnyway(this T obj)
+ where T : new()
+ {
+ if(obj is null)
+ obj = new T();
+ return obj;
+ }
+
+ #endregion
+
+ }
+}
diff --git a/Runtime/MicroLibrary/MacroObject.cs.meta b/Runtime/MicroLibrary/MacroObject.cs.meta
new file mode 100644
index 0000000..186b62a
--- /dev/null
+++ b/Runtime/MicroLibrary/MacroObject.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ba90139bc3f0a3347afd4673b38919a1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/MicroLibrary/MacroString.cs b/Runtime/MicroLibrary/MacroString.cs
new file mode 100644
index 0000000..42dcf55
--- /dev/null
+++ b/Runtime/MicroLibrary/MacroString.cs
@@ -0,0 +1,41 @@
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+using UnityEngine;
+
+namespace XericLibrary.Runtime.MacroLibrary
+{
+ public static partial class MacroMath
+ {
+
+ #region 文本
+
+ ///
+ /// 获取此处的物体名称,如果带有(clone)后缀,则省略这个后缀
+ ///
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static string GetGameObjectNameWithoutClone(GameObject gameObject)
+ {
+ return GetGameObjectNameWithoutClone(gameObject.name);
+ }
+
+ ///
+ /// 获取此处的物体名称,如果带有(clone)后缀,则省略这个后缀
+ ///
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static string GetGameObjectNameWithoutClone(string gameObjectName)
+ {
+ const string cloneSuffix = "(Clone)";
+ if(gameObjectName.EndsWith(cloneSuffix))
+ {
+ int suffixIndex = gameObjectName.LastIndexOf(cloneSuffix);
+ string nameWithoutClone = gameObjectName.Substring(0, suffixIndex);
+ return nameWithoutClone;
+ }
+ return gameObjectName;
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Runtime/MicroLibrary/MacroString.cs.meta b/Runtime/MicroLibrary/MacroString.cs.meta
new file mode 100644
index 0000000..913a80d
--- /dev/null
+++ b/Runtime/MicroLibrary/MacroString.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ddcec615e26876649b458ceb73acef9f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/MicroLibrary/MacroTransferAxes.cs b/Runtime/MicroLibrary/MacroTransferAxes.cs
new file mode 100644
index 0000000..ec5c6ea
--- /dev/null
+++ b/Runtime/MicroLibrary/MacroTransferAxes.cs
@@ -0,0 +1,52 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Xeric.Runtime.MicroLibrary
+{
+ ///
+ ///
+ ///
+ ///
+ /// 坐标系统换算库
+ ///
+ public static class MacroTransferAxes
+ {
+ #region 坐标系换算
+
+ /**
+ * 像Maya就是Y向上的三维软件,它原来属于Silicon Graphice,Inc.的硬件开发,使用的也是SGI的标准;
+ * 以及DX,OpenGL也是使用Z缓冲区之类的名称来处理屏幕空间渲染。
+ * Unity,Zbrush,DirectX使用的是Y轴向上的左手坐标系
+ * Maya,OpenGL使用的是Y轴向上的右手坐标系
+ *
+ * 像Unreal诞生时Maya还没诞生,大家都用的是3D Max,所以采用了Z轴向上的左手坐标系。
+ * 另外3D Max,source engine,cry engine, blender使用的是Z轴向上的右手坐标系;
+ *
+ * 数学上可能左手会好些
+ */
+
+ ///
+ /// 将Y轴向上的坐标系转为Z轴向上的坐标系;
+ ///
+ ///
+ ///
+ public static Vector3 YupToZupAxes(Vector3 input)
+ {
+ return new Vector3(input.x, input.y, input.z);
+ }
+
+ ///
+ /// 将Z轴向上的坐标系转为Y轴向上的坐标系;
+ ///
+ ///
+ ///
+ public static Vector3 ZupToYupAxes(Vector3 input)
+ {
+ return new Vector3(input.x, input.y, input.z);
+ }
+
+ #endregion
+
+ }
+}
diff --git a/Runtime/MicroLibrary/MacroTransferAxes.cs.meta b/Runtime/MicroLibrary/MacroTransferAxes.cs.meta
new file mode 100644
index 0000000..da1161d
--- /dev/null
+++ b/Runtime/MicroLibrary/MacroTransferAxes.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6dfe731c33104d5458aa7cc26ea22e32
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/MicroLibrary/NeighborGrid.cs b/Runtime/MicroLibrary/NeighborGrid.cs
new file mode 100644
index 0000000..c405bc9
--- /dev/null
+++ b/Runtime/MicroLibrary/NeighborGrid.cs
@@ -0,0 +1,754 @@
+using XericLibrary.Runtime.MacroLibrary;
+using XericLibrary.Runtime.Type;
+
+using System.Collections;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Runtime.CompilerServices;
+
+using UnityEngine;
+using UnityEngine.UIElements;
+
+namespace XericLibrary.Runtime.MacroLibrary
+{
+ public class NeighborGrid : WeaklyObject,
+ IEnumerable>>
+ {
+ #region 字段属性
+
+ private Vector3 position;
+ private Vector3 cellSize;
+ private Vector3Int numCells;
+ private int maxNeighbor = 8;
+
+
+ public Vector3 Position
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get => position;
+ }
+ public Vector3 CellSize
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get => cellSize;
+ }
+ public Vector3Int NumCells
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get => numCells;
+ }
+
+
+ internal System.Random random = new System.Random();
+ private int NeighborRandomIndex
+ {
+ get => random.Next(maxNeighbor);
+ }
+
+ ///
+ /// 网格系统存储地
+ ///
+ private Dictionary> grid = new Dictionary>();
+
+ ///
+ /// 网格的总尺寸
+ ///
+ public Vector3 Fullsize
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get => cellSize.Mul(numCells);
+ }
+
+ ///
+ /// 此网格系统转为盒体范围
+ ///
+ public Bounds GridBounds
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get => new Bounds(position, Fullsize / 2);
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ set
+ {
+ position = value.center;
+ cellSize = (value.size * 2).Div(numCells);
+ }
+ }
+
+ #endregion
+
+ #region 构造
+
+ ///
+ /// 临近网格
+ ///
+ /// 网格原点坐标
+ /// 网格晶格尺寸
+ /// 网格总尺寸
+ /// 单个晶格内最大邻居数量
+ public NeighborGrid(Vector3 position, Vector3 cellSize, Vector3 fullSize, int maxNeighbor = 8)
+ {
+ this.position = position;
+ this.cellSize = cellSize;
+ this.numCells = fullSize.Div(cellSize).FloorToInt().Max(Vector3Int.one);
+ this.maxNeighbor = maxNeighbor;
+
+ Debug.Log($"原点:{position}, 晶格尺寸{cellSize}, 数量:{numCells}");
+ }
+
+ #endregion
+
+ #region 类内类
+
+ ///
+ /// 网格索引
+ ///
+ public struct NeighborGridIndex
+ {
+ #region 字段属性
+
+ private NeighborGrid grid;
+
+ private NeighborGridSpace drivenSpace;
+
+ private object drivenIndex;
+
+ #endregion
+
+ #region 构造
+
+ public NeighborGridIndex(NeighborGrid grid)
+ {
+ this.grid = grid;
+ drivenSpace = (NeighborGridSpace)(-1);
+ drivenIndex = null;
+ }
+
+ #endregion
+
+ #region 方法
+
+ ///
+ /// 获取为 世界空间
+ ///
+ ///
+ public Vector3 GetDrivenAsWorld()
+ {
+ DrivenTransformTo(NeighborGridSpace.World);
+ return (Vector3)drivenIndex;
+ }
+
+ ///
+ /// 获取为 网格系统本地坐标空间
+ ///
+ ///
+ public Vector3 GetDrivenAsSimulation()
+ {
+ DrivenTransformTo(NeighborGridSpace.Simulation);
+ return (Vector3)drivenIndex;
+ }
+
+ ///
+ /// 获取为 网格系统本地单位空间
+ ///
+ ///
+ public Vector3 GetDrivenAsUnit()
+ {
+ DrivenTransformTo(NeighborGridSpace.Unit);
+ return (Vector3)drivenIndex;
+ }
+
+ ///
+ /// 获取为 三维索引
+ ///
+ ///
+ public Vector3Int GetDrivenAsIndex()
+ {
+ DrivenTransformTo(NeighborGridSpace.Index);
+ return (Vector3Int)drivenIndex;
+ }
+
+ ///
+ /// 获取为 线性索引
+ ///
+ ///
+ public int GetDrivenAsLinear()
+ {
+ DrivenTransformTo(NeighborGridSpace.Linear);
+ return (int)drivenIndex;
+ }
+
+
+ ///
+ /// 设置为 世界空间
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public NeighborGridIndex SetDrivenAsWorld(Vector3 world)
+ {
+ drivenIndex = world;
+ drivenSpace = NeighborGridSpace.World;
+ return this;
+ }
+
+ ///
+ /// 设置为 网格系统本地坐标空间
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public NeighborGridIndex SetDrivenAsSimulation(Vector3 simulation)
+ {
+ drivenIndex = simulation;
+ drivenSpace = NeighborGridSpace.Simulation;
+ return this;
+ }
+
+ ///
+ /// 设置为 网格系统本地单位空间
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public NeighborGridIndex SetDrivenAsUnit(Vector3 unit)
+ {
+ drivenIndex = unit;
+ drivenSpace = NeighborGridSpace.Unit;
+ return this;
+ }
+
+ ///
+ /// 设置为 三维索引
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public NeighborGridIndex SetDrivenAsIndex(Vector3Int index)
+ {
+ drivenIndex = index;
+ drivenSpace = NeighborGridSpace.Index;
+ return this;
+ }
+
+ ///
+ /// 设置为 线性索引
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public NeighborGridIndex SetDrivenAsLinear(int linear)
+ {
+ drivenIndex = linear;
+ drivenSpace = NeighborGridSpace.Linear;
+ return this;
+ }
+
+
+ ///
+ /// 转换当前索引到目标空间
+ ///
+ ///
+ public NeighborGridIndex DrivenTransformTo(NeighborGridSpace targetSpace)
+ {
+ switch(targetSpace)
+ {
+ case NeighborGridSpace.World:
+ TransformToWorld();
+ break;
+
+ case NeighborGridSpace.Simulation:
+ TransformToSimulation();
+ break;
+
+ case NeighborGridSpace.Unit:
+ TransformToUnit();
+ break;
+
+ case NeighborGridSpace.Index:
+ TransformToIndex();
+ break;
+
+ case NeighborGridSpace.Linear:
+ TransformToLiear();
+ break;
+
+ default:
+ throw new System.Exception("转换空间是无效的");
+ }
+ return this;
+ }
+
+
+ ///
+ /// 将当前的目标转换到世界空间
+ ///
+ private void TransformToWorld()
+ {
+ switch(drivenSpace)
+ {
+ case NeighborGridSpace.World:
+ drivenSpace = NeighborGridSpace.World;
+ break;
+
+ case NeighborGridSpace.Simulation:
+ drivenIndex = grid.SimulationToWorld((Vector3)drivenIndex);
+ goto case NeighborGridSpace.World;
+
+ case NeighborGridSpace.Unit:
+ drivenIndex = grid.UnitToSimulation((Vector3)drivenIndex);
+ goto case NeighborGridSpace.Simulation;
+
+ case NeighborGridSpace.Index:
+ drivenIndex = grid.IndexToUnit((Vector3Int)drivenIndex);
+ goto case NeighborGridSpace.Unit;
+
+ case NeighborGridSpace.Linear:
+ drivenIndex = grid.LinearToIndex((int)drivenIndex);
+ goto case NeighborGridSpace.Index;
+
+ default:
+ throw new System.Exception("转换空间是无效的");
+ }
+ }
+
+ ///
+ /// 将当前的目标转换到本地空间
+ ///
+ private void TransformToSimulation()
+ {
+ switch(drivenSpace)
+ {
+ case NeighborGridSpace.World:
+ drivenIndex = grid.WorldToSimulation((Vector3)drivenIndex);
+ goto case NeighborGridSpace.Simulation;
+
+ case NeighborGridSpace.Simulation:
+ drivenSpace = NeighborGridSpace.Simulation;
+ break;
+
+ case NeighborGridSpace.Unit:
+ drivenIndex = grid.UnitToSimulation((Vector3)drivenIndex);
+ goto case NeighborGridSpace.Simulation;
+
+ case NeighborGridSpace.Index:
+ drivenIndex = grid.IndexToUnit((Vector3Int)drivenIndex);
+ goto case NeighborGridSpace.Unit;
+
+ case NeighborGridSpace.Linear:
+ drivenIndex = grid.LinearToIndex((int)drivenIndex);
+ goto case NeighborGridSpace.Index;
+
+ default:
+ throw new System.Exception("转换空间是无效的");
+ }
+ }
+
+ ///
+ /// 将当前的目标转换到单位空间
+ ///
+ private void TransformToUnit()
+ {
+ switch(drivenSpace)
+ {
+ case NeighborGridSpace.World:
+ drivenIndex = grid.WorldToSimulation((Vector3)drivenIndex);
+ goto case NeighborGridSpace.Simulation;
+
+ case NeighborGridSpace.Simulation:
+ drivenIndex = grid.SimulationToUnit((Vector3)drivenIndex);
+ goto case NeighborGridSpace.Unit;
+
+ case NeighborGridSpace.Unit:
+ drivenSpace = NeighborGridSpace.Unit;
+ break;
+
+ case NeighborGridSpace.Index:
+ drivenIndex = grid.IndexToUnit((Vector3Int)drivenIndex);
+ goto case NeighborGridSpace.Unit;
+
+ case NeighborGridSpace.Linear:
+ drivenIndex = grid.LinearToIndex((int)drivenIndex);
+ goto case NeighborGridSpace.Index;
+
+ default:
+ throw new System.Exception("转换空间是无效的");
+ }
+ }
+
+ ///
+ /// 将当前的目标转换到三维索引
+ ///
+ private void TransformToIndex()
+ {
+ switch(drivenSpace)
+ {
+ case NeighborGridSpace.World:
+ drivenIndex = grid.WorldToSimulation((Vector3)drivenIndex);
+ goto case NeighborGridSpace.Simulation;
+
+ case NeighborGridSpace.Simulation:
+ drivenIndex = grid.SimulationToUnit((Vector3)drivenIndex);
+ goto case NeighborGridSpace.Unit;
+
+ case NeighborGridSpace.Unit:
+ drivenIndex = grid.UnitToIndex((Vector3)drivenIndex);
+ goto case NeighborGridSpace.Index;
+
+ case NeighborGridSpace.Index:
+ drivenSpace = NeighborGridSpace.Index;
+ break;
+
+ case NeighborGridSpace.Linear:
+ drivenIndex = grid.LinearToIndex((int)drivenIndex);
+ goto case NeighborGridSpace.Index;
+
+ default:
+ throw new System.Exception("转换空间是无效的");
+ }
+ }
+
+ ///
+ /// 将当前的目标转换到线性索引
+ ///
+ private void TransformToLiear()
+ {
+ switch(drivenSpace)
+ {
+ case NeighborGridSpace.World:
+ drivenIndex = grid.WorldToSimulation((Vector3)drivenIndex);
+ goto case NeighborGridSpace.Simulation;
+
+ case NeighborGridSpace.Simulation:
+ drivenIndex = grid.SimulationToUnit((Vector3)drivenIndex);
+ goto case NeighborGridSpace.Unit;
+
+ case NeighborGridSpace.Unit:
+ drivenIndex = grid.UnitToIndex((Vector3)drivenIndex);
+ goto case NeighborGridSpace.Index;
+
+ case NeighborGridSpace.Index:
+ drivenIndex = grid.IndexToLinear((Vector3Int)drivenIndex);
+ break;
+
+ case NeighborGridSpace.Linear:
+ drivenSpace = NeighborGridSpace.Linear;
+ break;
+
+ default:
+ throw new System.Exception("转换空间是无效的");
+ }
+
+ }
+
+ #endregion
+
+ }
+
+ ///
+ /// 临近网络空间枚举
+ ///
+ public enum NeighborGridSpace
+ {
+ World,
+ Simulation,
+ Unit,
+ Index,
+ Linear
+ }
+
+ #endregion
+
+ #region 索引变换
+
+ ///
+ /// 世界空间 变换为 网格系统本地坐标空间
+ ///
+ /// 项目的世界空间坐标
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public Vector3 WorldToSimulation(Vector3 world)
+ => world - position - (-Fullsize / 2);
+
+ ///
+ /// 网格系统本地坐标空间 变换为 世界空间
+ ///
+ /// 项目的世界空间坐标
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public Vector3 SimulationToWorld(Vector3 simulation)
+ => simulation + position + (-Fullsize / 2);
+
+
+ ///
+ /// 网格系统本地坐标空间 变换为 网格系统本地单位空间
+ ///
+ /// 网格系统本地坐标空间
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public Vector3 SimulationToUnit(Vector3 simulation)
+ => simulation.Div(Fullsize);
+
+ ///
+ /// 网格系统本地坐标空间 变换为 网格系统本地单位空间
+ ///
+ /// 网格系统本地坐标空间
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public Vector3 UnitToSimulation(Vector3 unit)
+ => unit.Mul(Fullsize);
+
+
+ ///
+ /// 网格系统本地单位空间 变换为 三维索引
+ ///
+ /// 网格系统本地单位空间
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public Vector3Int UnitToIndex(Vector3 unit)
+ => unit.IsInUnit() ? unit.Mul(numCells).FloorToInt() : MacroMath.Vector3Int_Negate;
+
+ ///
+ /// 三维索引 变换为 网格系统本地单位空间
+ ///
+ /// 三维索引
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public Vector3 IndexToUnit(Vector3Int index)
+ {
+ if(index.IsValid())
+ {
+ Vector3 unit = ((Vector3)index).Div(numCells);
+ unit.x = numCells.x == 1 && unit.x <= 0 ? .5f : unit.x;
+ unit.y = numCells.y == 1 && unit.y <= 0 ? .5f : unit.y;
+ unit.z = numCells.z == 1 && unit.z <= 0 ? .5f : unit.z;
+ return unit;
+ }
+ return MacroMath.Vector3Int_Negate;
+ }
+
+
+ ///
+ /// 网格系统本地单位空间 变换为 线性索引
+ ///
+ /// 网格系统本地坐标空间
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public int UnitToLinear(Vector3 unit)
+ {
+ if(unit.IsInUnit())
+ {
+ return IndexToLinear(UnitToIndex(unit));
+ }
+ return -1;
+ }
+
+ ///
+ /// 三维索引 变换为 线性索引
+ ///
+ /// 三维索引
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public int IndexToLinear(Vector3Int index)
+ {
+ if(index.IsValid() && index.IsInIndexRange(numCells))
+ {
+ return (int)(index.x +
+ (index.y * numCells.x) +
+ (index.z * numCells.y * numCells.x));
+ }
+ return -1;
+ }
+
+ ///
+ /// 根据线性索引获取网格中索引偏移量
+ ///
+ /// 线性索引
+ /// 边长
+ ///
+ public Vector3Int LinearToGridIndex(int linear, int side)
+ {
+ return new Vector3Int(linear % side, linear / side, linear / side.Quad());
+ }
+
+ ///
+ /// 线性索引 变换为 三维索引
+ ///
+ /// 线性索引
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public Vector3Int LinearToIndex(int linear)
+ {
+ int z = linear / (numCells.x * numCells.y);
+ int y = (linear - (z * numCells.x * numCells.y)) / numCells.x;
+ int x = linear - (z * numCells.x * numCells.y) - (y * numCells.x);
+
+ return new Vector3Int(x, y, z);
+ }
+
+ ///
+ /// 线性索引 变换为 网格系统本地单位空间
+ ///
+ /// 线性索引
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public Vector3 LinearToUnit(int linear)
+ {
+ Debug.Log($"线性转索引空间{LinearToIndex(linear)},再转单位");
+ return IndexToUnit(LinearToIndex(linear));
+ }
+
+ #endregion
+
+ #region 增删查
+
+ ///
+ /// 清空网格
+ ///
+ public void Clean()
+ {
+ grid.Clear();
+ }
+
+ ///
+ /// 在给定索引处添加一个项目
+ ///
+ /// 索引
+ /// 返回是否添加成功
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public bool Insert(int linear, T obj)
+ {
+ if(linear < 0)
+ return false;
+ if(grid.ContainsKey(linear))
+ {
+ int index = grid[linear].IndexOf(obj);
+ if(index < 0)
+ {
+ grid[linear].Add(obj);
+ return true;
+ }
+ return false;
+ }
+ else
+ {
+ grid.Add(linear, new List { obj });
+ return true;
+ }
+ }
+
+ ///
+ /// 移除给定索引处的项目
+ ///
+ /// 索引
+ /// 项目
+ /// 返回是否移除成功
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public bool Remove(int linear, T obj)
+ {
+ if(grid.ContainsKey(linear))
+ {
+ bool resualt = grid[linear].Remove(obj);
+ if(grid[linear].Count <= 0)
+ grid.Remove(linear);
+ return resualt;
+ }
+ return false;
+ }
+ ///
+ /// 移除给定索引下所有项目
+ ///
+ /// 索引
+ /// 返回是否移除成功
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public void Remove(int linear)
+ {
+ if(grid[linear] is not null)
+ {
+ grid[linear].Clear();
+ }
+ }
+
+ ///
+ /// 查询给定索引处是否存在项目
+ ///
+ /// 索引
+ /// 项目
+ /// 返回项目是否存在
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public bool Contains(int linear, T obj)
+ {
+ if(grid[linear] is not null)
+ {
+ return grid[linear].Contains(obj);
+ }
+ return false;
+ }
+
+ ///
+ /// 忽略限制获取所有的邻居
+ ///
+ /// 警告:潜在的高性能开销
+ ///
+ ///
+ ///
+ ///
+ public bool GetAllNeighbor(int linear, out List values)
+ {
+ return grid.TryGetValue(linear, out values);
+ }
+
+ ///
+ /// 获取允许范围内的邻居
+ ///
+ /// 所在位置的索引
+ ///
+ public IEnumerable GetNeighbor(int linear)
+ {
+ int startIndex = NeighborRandomIndex;
+ int count = grid[linear].Count;
+ for(int i = 0; i < maxNeighbor; i++)
+ {
+ yield return grid[linear][(startIndex + i) % count];
+ }
+ }
+
+ ///
+ /// 获取半径内所有允许的邻居
+ ///
+ /// 所在位置的索引
+ /// 检查的范围
+ ///
+ public IEnumerable GetNeighbor(int linear, int radius)
+ {
+ int side = radius * 2 + 1;
+ int length = side.Cubic();
+ Vector3Int index = LinearToIndex(linear);
+ index = index.Sub(radius);
+
+ for(int i = 0; i < length; i++)
+ {
+ var neighbor = GetNeighbor(IndexToLinear(index +
+ LinearToGridIndex(i, side)))
+ .GetEnumerator();
+ while(neighbor.MoveNext())
+ {
+ yield return neighbor.Current;
+ }
+ }
+ }
+
+ #endregion
+
+ #region 实现
+
+ public IEnumerator>> GetEnumerator()
+ {
+ foreach(var list in grid)
+ {
+ yield return list;
+ }
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/Runtime/MicroLibrary/NeighborGrid.cs.meta b/Runtime/MicroLibrary/NeighborGrid.cs.meta
new file mode 100644
index 0000000..d70e9a1
--- /dev/null
+++ b/Runtime/MicroLibrary/NeighborGrid.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1ffd0ac031e48e94990e3501ec6bb5ae
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/MicroLibrary/NeighborGridExtend.cs b/Runtime/MicroLibrary/NeighborGridExtend.cs
new file mode 100644
index 0000000..4bd684d
--- /dev/null
+++ b/Runtime/MicroLibrary/NeighborGridExtend.cs
@@ -0,0 +1,132 @@
+
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+using UnityEngine;
+
+
+namespace XericLibrary.Runtime.MacroLibrary
+{
+ public static class NeighborGridExtend
+ {
+ ///
+ /// 世界空间变换为网格系统本地坐标空间
+ ///
+ ///
+ ///
+ /// 网格目标
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 WorldToSimulation(this Vector3 world, NeighborGrid grid)
+ => grid.WorldToSimulation(world);
+ ///
+ /// 网格系统本地坐标空间变换为世界空间
+ ///
+ ///
+ ///
+ /// 网格目标
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 SimulationToWorld(this Vector3 simulation, NeighborGrid grid)
+ => grid.SimulationToWorld(simulation);
+
+
+ ///
+ /// 网格系统本地坐标空间转为网格系统本地单位空间
+ ///
+ ///
+ ///
+ /// 网格目标
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 SimulationToUnit(this Vector3 simulation, NeighborGrid grid)
+ => grid.SimulationToUnit(simulation);
+ ///
+ /// 网格系统本地坐标空间转为网格系统本地单位空间
+ ///
+ ///
+ ///
+ /// 网格目标
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 UnitToSimulation(this Vector3 unit, NeighborGrid grid)
+ => grid.UnitToSimulation(unit);
+
+
+ ///
+ /// 网格系统本地单位空间转为三维索引
+ ///
+ ///
+ ///
+ /// 网格目标
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int UnitToIndex(this Vector3 unit, NeighborGrid grid)
+ => grid.UnitToIndex(unit);
+ ///
+ /// 三维索引转为网格系统本地单位空间
+ ///
+ ///
+ ///
+ /// 网格目标
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 IndexToUnit(this Vector3Int index, NeighborGrid grid)
+ => grid.IndexToUnit(index);
+
+
+ ///
+ /// 网格系统本地单位空间转为线性索引
+ ///
+ ///
+ /// 网格系统本地坐标空间
+ /// 网格目标
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int UnitToLinear(this Vector3 unit, NeighborGrid grid)
+ => grid.UnitToLinear(unit);
+ ///
+ /// 三维索引转为线性索引
+ ///
+ ///
+ /// 三维索引
+ /// 网格目标
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int IndexToLinear(this Vector3Int index, NeighborGrid grid)
+ => grid.IndexToLinear(index);
+ ///
+ /// 网格系统本地单位空间转为线性索引
+ ///
+ ///
+ /// 网格系统本地坐标空间
+ /// 网格目标
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int LinearToIndex(this int Linear, NeighborGrid grid)
+ => grid.LinearToIndex(Linear);
+ ///
+ /// 三维索引转为线性索引
+ ///
+ ///
+ /// 三维索引
+ /// 网格目标
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 LinearToUnit(this int Linear, NeighborGrid grid)
+ => grid.LinearToUnit(Linear);
+
+
+ ///
+ /// 从世界坐标获取到索引
+ ///
+ ///
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int WorldToLinear(this Vector3 Linear, NeighborGrid grid)
+ => Linear.WorldToSimulation(grid).SimulationToUnit(grid).UnitToLinear(grid);
+ }
+}
diff --git a/Runtime/MicroLibrary/NeighborGridExtend.cs.meta b/Runtime/MicroLibrary/NeighborGridExtend.cs.meta
new file mode 100644
index 0000000..0ca6641
--- /dev/null
+++ b/Runtime/MicroLibrary/NeighborGridExtend.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f67516c9f81441149a09742c65b0ffed
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/MicroLibrary/TypeExtend.cs b/Runtime/MicroLibrary/TypeExtend.cs
new file mode 100644
index 0000000..bd81f5c
--- /dev/null
+++ b/Runtime/MicroLibrary/TypeExtend.cs
@@ -0,0 +1,248 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEditor.Experimental.GraphView;
+
+using System.Runtime.CompilerServices;
+
+using UnityEngine;
+
+using Xorti = XericLibrary.Runtime.MacroLibrary.MacroMath;
+
+namespace XericLibrary.Runtime.MacroLibrary
+{
+ public static class ExtendType
+ {
+ #region 算法
+
+ ///
+ /// 检查给定的值是否在范围内[min, max]
+ ///
+ ///
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool IsInRange(this int value, int min, int max)
+ => value >= min && value <= max;
+
+ ///
+ /// 检查给定的值是否在索引范围内[min, max)
+ ///
+ ///
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool IsInIndexRange(this int value, int min, int max)
+ => value >= min && value < max;
+
+
+ ///
+ /// 二次方
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Quad(this int value)
+ {
+ return value * value;
+ }
+ ///
+ /// 三次方
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Cubic(this int value)
+ {
+ return value * value * value;
+ }
+ ///
+ /// 四次方
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Quart(this int value)
+ {
+ return value * value * value * value;
+ }
+ ///
+ /// 五次方
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int Quint(this int value)
+ {
+ return value * value * value * value * value;
+ }
+
+
+ ///
+ /// 二次方
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Quad(this float value)
+ {
+ return value * value;
+ }
+ ///
+ /// 三次方
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Cubic(this float value)
+ {
+ return value * value * value;
+ }
+ ///
+ /// 四次方
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Quart(this float value)
+ {
+ return value * value * value * value;
+ }
+ ///
+ /// 五次方
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Quint(this float value)
+ {
+ return value * value * value * value * value;
+ }
+
+ #endregion
+
+ #region 事件
+
+ ///
+ /// 保守地调用一个事件分发器
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool InvokeConservative(this Action invokedEvent, int sign, ref int register)
+ {
+ if(Xorti.GetByteState(register, sign))
+ return false;
+ Xorti.SetByteState(ref register, sign, true);
+ invokedEvent?.Invoke();
+ Xorti.SetByteState(ref register, sign, false);
+ return true;
+ }
+
+ ///
+ /// 保守地调用一个事件分发器
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool InvokeConservative(this Action invokedEvent, PARAM input, int sign, ref int register)
+ {
+ if(Xorti.GetByteState(register, sign))
+ return false;
+ Xorti.SetByteState(ref register, sign, true);
+ invokedEvent?.Invoke(input);
+ Xorti.SetByteState(ref register, sign, false);
+ return true;
+ }
+
+ #endregion
+
+ #region 对象
+
+ ///
+ /// 获取组件,并适配函数式编程
+ ///
+ ///
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool GetComponent(this GameObject target, out T component)
+ {
+ component = target.GetComponent();
+ return component is not null;
+ }
+
+ ///
+ /// 此对象的父类是第二者吗
+ ///
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool ParentIs(this GameObject target, GameObject other)
+ {
+ return target.transform.parent == other.transform;
+ }
+
+ ///
+ /// 此对象是第二者的父类吗
+ ///
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool IsParent(this GameObject target, GameObject other)
+ {
+ return target.transform == other.transform.parent;
+ }
+
+ ///
+ /// 此对象与第二者是兄弟吗
+ ///
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool IsBrother(this GameObject target, GameObject other)
+ {
+ return target.transform.parent == other.transform.parent;
+ }
+
+ #endregion
+
+ #region bound
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool IsInUnit(this Vector3 vec, float align = 1)
+ {
+ float negat = 1 - align;
+ return
+ vec.x <= align &&
+ vec.y <= align &&
+ vec.z <= align &&
+ vec.x >= negat &&
+ vec.y >= negat &&
+ vec.z >= negat;
+ }
+
+ #endregion
+
+ #region string
+
+ private static string ListToString(this List> context)
+ {
+ string result = "";
+ Func, string> ListFormat = (List list) =>
+ {
+ string result = "";
+ for (int i = 0; i < list.Count; i++, result += ",")
+ result += $"{i}: {list[i]}";
+ return result;
+ };
+ for(int i = 0; i < context.Count; i++)
+ result += $"List{i}: {{{ListFormat(context[i])}}}\r\n";
+ return result;
+ }
+
+ #endregion
+ }
+}
diff --git a/Runtime/MicroLibrary/TypeExtend.cs.meta b/Runtime/MicroLibrary/TypeExtend.cs.meta
new file mode 100644
index 0000000..3178be9
--- /dev/null
+++ b/Runtime/MicroLibrary/TypeExtend.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5083902ec572f1b449bfe335c374ed4e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/MicroLibrary/Vector2Extend.cs b/Runtime/MicroLibrary/Vector2Extend.cs
new file mode 100644
index 0000000..e3e4d29
--- /dev/null
+++ b/Runtime/MicroLibrary/Vector2Extend.cs
@@ -0,0 +1,113 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+using UnityEngine;
+
+namespace XericLibrary.Runtime.MacroLibrary
+{
+ public static class Vector2Extend
+ {
+ ///
+ /// 李若辰规定的编辑表面坐标转换方法
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 ToVector3(this Vector2 vec)
+ => new Vector3(vec.x, 0, vec.y);
+
+ [Obsolete("unfinished")]
+ public static Vector2 Projection(this Vector2 point, Vector3 start, Vector3 end)
+ {
+ Vector3 vec = end - start;
+ float xx = Mathf.Pow(vec.x, 2f);
+ float yy = Mathf.Pow(vec.y, 2f);
+ float denominator = xx + yy;
+ if(denominator == 0)
+ return point;
+
+ float xy = vec.x * vec.y;
+ //float moleculey = yy *
+ return new Vector2(xx, xy);
+ }
+
+ public static Vector2 Projection(this Vector2 point, Vector2 start, Vector2 end)
+ {
+ Vector2 ab = end - start;
+ Vector2 ap = point - start;
+ return start + ab * Vector2.Dot(ap, ab) / ab.sqrMagnitude;
+ }
+
+ ///
+ /// 矢量正交化
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector2 Orthogonalization(this Vector2 vec)
+ => new Vector2(
+ (float)Math.Round(vec.x),
+ (float)Math.Round(vec.y)
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector2 Min(this Vector2 a, Vector2 b)
+ {
+ return new Vector2(Math.Min(a.x, b.x), Math.Min(a.y, b.y));
+ }
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector2 Max(this Vector2 a, Vector2 b)
+ {
+ return new Vector2(Math.Max(a.x, b.x), Math.Max(a.y, b.y));
+ }
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float MinElement(this Vector2 a)
+ {
+ return Math.Min(a.x, a.y);
+ }
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float MaxElement(this Vector2 a)
+ {
+ return Math.Max(a.x, a.y);
+ }
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector2 Abs(this Vector2 a)
+ {
+ return new Vector2(Math.Abs(a.x), Math.Abs(a.y));
+ }
+ ///
+ /// 获取矢量各轴符号
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector2 Sign(this Vector2 vec)
+ => new Vector2(
+ Math.Sign(vec.x),
+ Math.Sign(vec.y)
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float Cross(this Vector2 lhs, Vector2 rhs)
+ => lhs.x * rhs.y - rhs.x * lhs.y;
+
+ ///
+ /// 延斜线对齐一个点
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector2 ObliqueAlign(this Vector2 point, Vector2 constPoint, out float exec)
+ {
+ float b1 = point.y - point.x, b2 = constPoint.y - constPoint.x;
+ float dt = b1 + (b2 - b1);
+ exec = dt * MacroMath.Sqrt22;
+ Vector2 ab = constPoint - point;
+ bool cool = ab.x * ab.y < 0;
+ return exec * (cool ? Vector2.one : new Vector2(-1, 1));
+ }
+
+ }
+}
diff --git a/Runtime/MicroLibrary/Vector2Extend.cs.meta b/Runtime/MicroLibrary/Vector2Extend.cs.meta
new file mode 100644
index 0000000..95c6928
--- /dev/null
+++ b/Runtime/MicroLibrary/Vector2Extend.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 93b81a983491c7a4791024a82c310d26
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/MicroLibrary/Vector3Extend.cs b/Runtime/MicroLibrary/Vector3Extend.cs
new file mode 100644
index 0000000..6c63fa9
--- /dev/null
+++ b/Runtime/MicroLibrary/Vector3Extend.cs
@@ -0,0 +1,446 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+using UnityEngine;
+
+namespace XericLibrary.Runtime.MacroLibrary
+{
+ public static class Vector3Extend
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Add(this Vector3 a, Vector3 b)
+ => new Vector3(
+ a.x + b.x,
+ a.y + b.y,
+ a.z + b.z
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Add(this Vector3 a, Vector3Int b)
+ => new Vector3(
+ a.x + b.x,
+ a.y + b.y,
+ a.z + b.z
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Add(this Vector3 a, float b)
+ => new Vector3(
+ a.x + b,
+ a.y + b,
+ a.z + b
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Sub(this Vector3 a, Vector3 b)
+ => new Vector3(
+ a.x - b.x,
+ a.y - b.y,
+ a.z - b.z
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Sub(this Vector3 a, Vector3Int b)
+ => new Vector3(
+ a.x - b.x,
+ a.y - b.y,
+ a.z - b.z
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Sub(this Vector3 a, float b)
+ => new Vector3(
+ a.x - b,
+ a.y - b,
+ a.z - b
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Mul(this Vector3 a, Vector3 b)
+ => new Vector3(
+ a.x * b.x,
+ a.y * b.y,
+ a.z * b.z
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Mul(this Vector3 a, Vector3Int b)
+ => new Vector3(
+ a.x * b.x,
+ a.y * b.y,
+ a.z * b.z
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Mul(this Vector3 a, float b)
+ => new Vector3(
+ a.x * b,
+ a.y * b,
+ a.z * b
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Div(this Vector3 a, Vector3 b)
+ => new Vector3(
+ a.x / b.x,
+ a.y / b.y,
+ a.z / b.z
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Div(this Vector3 a, Vector3Int b)
+ => new Vector3(
+ a.x / b.x,
+ a.y / b.y,
+ a.z / b.z
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Div(this Vector3 a, float b)
+ => new Vector3(
+ a.x / b,
+ a.y / b,
+ a.z / b
+ );
+
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Xonly(this Vector3 a)
+ => new Vector3(
+ a.x,
+ 0f,
+ 0f
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Yonly(this Vector3 a)
+ => new Vector3(
+ 0f,
+ a.y,
+ 0f
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Zonly(this Vector3 a)
+ => new Vector3(
+ 0f,
+ 0f,
+ a.z
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Mode(this Vector3 a, Vector3 b)
+ {
+ return new Vector3(a.x % b.x, a.y % b.y, a.z % b.z);
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Mode(this Vector3 a, float b)
+ {
+ return new Vector3(a.x % b, a.y % b, a.z % b);
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Sign(this Vector3 vec)
+ => new Vector3(
+ Math.Sign(vec.x),
+ Math.Sign(vec.y),
+ Math.Sign(vec.z)
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int CeilToInt(this Vector3 vec)
+ => new Vector3Int((int)Mathf.Ceil(vec.x), (int)Mathf.Ceil(vec.y), (int)Mathf.Ceil(vec.z));
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Ceil(this Vector3 vec)
+ => new Vector3(Mathf.Ceil(vec.x), Mathf.Ceil(vec.y), Mathf.Ceil(vec.z));
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int RoundToInt(this Vector3 vec)
+ => new Vector3Int((int)Mathf.Round(vec.x), (int)Mathf.Round(vec.y), (int)Mathf.Round(vec.z));
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Round(this Vector3 vec)
+ => new Vector3(Mathf.Round(vec.x), Mathf.Round(vec.y), Mathf.Round(vec.z));
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int FloorToInt(this Vector3 vec)
+ => new Vector3Int((int)vec.x, (int)vec.y, (int)vec.z);
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Floor(this Vector3 vec)
+ => new Vector3((int)vec.x, (int)vec.y, (int)vec.z);
+
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Min(this Vector3 a, Vector3 b)
+ {
+ return new Vector3(Math.Min(a.x, b.x), Math.Min(a.y, b.y), Math.Min(a.z, b.z));
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Max(this Vector3 a, Vector3 b)
+ {
+ return new Vector3(Math.Max(a.x, b.x), Math.Max(a.y, b.y), Math.Max(a.z, b.z));
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float MinElement(this Vector3 a)
+ {
+ return Math.Min(Math.Min(a.x, a.y), a.z);
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static float MaxElement(this Vector3 a)
+ {
+ return Math.Max(Math.Max(a.x, a.y), a.z);
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Abs(this Vector3 a)
+ {
+ return new Vector3(Mathf.Abs(a.x), Mathf.Abs(a.y), Mathf.Abs(a.z));
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Negative(this Vector3 a)
+ => new Vector3(-a.x, -a.y, -a.z);
+
+
+ ///
+ /// 李若辰规定的编辑表面坐标转换方法
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector2 ToVector2(this Vector3 vec)
+ => new Vector2(vec.x, vec.z);
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static Vector2 ToVector2(this Vector3 vec, string format)
+ {
+ Vector2 result = new Vector2();
+ for(int i = 0; i < format.Length && i < 2; i++)
+ {
+ int index = MacroMath.MinPositive(format[i] - 'X', format[i] - 'x');
+ result[index] = format[i] switch
+ {
+ 'x' => vec.x,
+ 'X' => vec.x,
+ 'y' => vec.y,
+ 'Y' => vec.y,
+ 'z' => vec.z,
+ 'Z' => vec.z,
+ _ => 0
+ };
+ }
+ return result;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static Vector3 AxisZero(this Vector3 vec, string format)
+ {
+ Vector3 result = vec;
+ for(int i = 0; i < format.Length && i < 2; i++)
+ {
+ int index = MacroMath.MinPositive(format[i] - 'X', format[i] - 'x');
+ result[index] = 0;
+ }
+ return result;
+ }
+
+
+ ///
+ /// 将这个向量投影到一个给定坐标的向上的平面上,同时变换到平面坐标
+ ///
+ /// 矢量或坐标
+ /// 平面原点
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 ProjectToUpPlane(this Vector3 vec, Vector3 planeOrigin)
+ => vec - new Vector3(0, (vec - planeOrigin).y, 0);
+
+ ///
+ /// 向量吸附到网格上,在比例中央不进行吸附
+ ///
+ /// 矢量或坐标
+ /// 偏移量
+ /// 网格单位
+ /// 阈值比例[0-1]
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 CoordinateGridAdsorb(this Vector3 vec, Vector3 offset, float unit, float thresholdPorp)
+ {
+ Vector3 vecInUnit = (vec + offset).Mode(unit);
+ Vector3 sig = vecInUnit.Sign() * unit / 2;
+ Vector3 dis = sig - vecInUnit;
+ Vector3 drive = dis.Abs().Sub(unit * thresholdPorp).Sign();
+ Vector3 ofs = (dis - sig).Mul(drive * 2) + vecInUnit;
+ return ofs;
+ }
+
+ ///
+ /// 向量吸附到网格上
+ ///
+ /// 矢量或坐标
+ /// 偏移量
+ /// 网格单位
+ /// 阈值比例[0-1]
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 CoordinateGridAdsorbRound(this Vector3 vec, Vector3 offset, float unit)
+ {
+ return ((vec + offset) / unit).Round() * unit;
+ }
+
+
+ ///
+ /// 矢量正交化
+ ///
+ ///
+ ///
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3 Orthogonalization(this Vector3 vec)
+ => new Vector3(
+ (float)Math.Round(vec.x),
+ (float)Math.Round(vec.y),
+ (float)Math.Round(vec.z)
+ );
+
+ }
+
+
+
+ public static class Vector3IntExtend
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Add(this Vector3Int a, Vector3Int b)
+ => new Vector3Int(
+ a.x + b.x,
+ a.y + b.y,
+ a.z + b.z
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Add(this Vector3Int a, Vector3 b)
+ => new Vector3Int(
+ (int)(a.x + b.x),
+ (int)(a.y + b.y),
+ (int)(a.z + b.z)
+ );
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Add(this Vector3Int a, int b)
+ => new Vector3Int(
+ a.x + b,
+ a.y + b,
+ a.z + b
+ );
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Sub(this Vector3Int a, Vector3Int b)
+ => new Vector3Int(
+ a.x - b.x,
+ a.y - b.y,
+ a.z - b.z
+ );
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Sub(this Vector3Int a, Vector3 b)
+ => new Vector3Int(
+ (int)(a.x - b.x),
+ (int)(a.y - b.y),
+ (int)(a.z - b.z)
+ );
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Sub(this Vector3Int a, int b)
+ => new Vector3Int(
+ a.x - b,
+ a.y - b,
+ a.z - b
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Mul(this Vector3Int a, Vector3Int b)
+ => new Vector3Int(
+ a.x * b.x,
+ a.y * b.y,
+ a.z * b.z
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Mul(this Vector3Int a, Vector3 b)
+ => new Vector3Int(
+ (int)(a.x * b.x),
+ (int)(a.y * b.y),
+ (int)(a.z * b.z)
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Mul(this Vector3Int a, int b)
+ => new Vector3Int(
+ a.x * b,
+ a.y * b,
+ a.z * b
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Div(this Vector3Int a, Vector3Int b)
+ => new Vector3Int(
+ a.x / b.x,
+ a.y / b.y,
+ a.z / b.z
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Div(this Vector3Int a, Vector3 b)
+ => new Vector3Int(
+ (int)(a.x / b.x),
+ (int)(a.y / b.y),
+ (int)(a.z / b.z)
+ );
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Div(this Vector3Int a, int b)
+ => new Vector3Int(
+ a.x / b,
+ a.y / b,
+ a.z / b
+ );
+
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Negative(this Vector3Int a)
+ => new Vector3Int(-a.x, -a.y, -a.z);
+
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Min(this Vector3Int a, Vector3Int b)
+ {
+ return new Vector3Int(Math.Min(a.x, b.x), Math.Min(a.y, b.y), Math.Min(a.z, b.z));
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static Vector3Int Max(this Vector3Int a, Vector3Int b)
+ {
+ return new Vector3Int(Math.Max(a.x, b.x), Math.Max(a.y, b.y), Math.Max(a.z, b.z));
+ }
+
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool IsValid(this Vector3Int lhs)
+ {
+ return lhs.x >= 0 && lhs.y >= 0 && lhs.z >= 0;
+ }
+
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static bool IsInIndexRange(this Vector3Int lhs, Vector3Int max)
+ {
+ return
+ lhs.x.IsInIndexRange(0, max.x) &&
+ lhs.y.IsInIndexRange(0, max.y) &&
+ lhs.z.IsInIndexRange(0, max.z);
+ }
+
+ }
+}
diff --git a/Runtime/MicroLibrary/Vector3Extend.cs.meta b/Runtime/MicroLibrary/Vector3Extend.cs.meta
new file mode 100644
index 0000000..c48789f
--- /dev/null
+++ b/Runtime/MicroLibrary/Vector3Extend.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 61faf554d3acd9b49ad13a6b5697336b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/RuntimeExample.cs b/Runtime/RuntimeExample.cs
deleted file mode 100644
index 48962b6..0000000
--- a/Runtime/RuntimeExample.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-// -----------------------------------------------------------------------------
-//
-// Use this runtime example C# file to develop runtime code.
-//
-// -----------------------------------------------------------------------------
-
-namespace Lrss3.XericLibrary
-{
- ///
- /// Provide a general description of the public class.
- ///
- ///
- /// Packages require XmlDoc documentation for ALL Package APIs.
- /// https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments
- ///
- public class MyPublicRuntimeExampleClass
- {
- ///
- /// Provide a description of what this private method does.
- ///
- /// Description of parameter 1
- /// Description of parameter 2
- /// Description of parameter 3
- /// Description of what the function returns
- public int CountThingsAndDoStuff(int parameter1, int parameter2, bool parameter3)
- {
- return parameter3 ? (parameter1 + parameter2) : (parameter1 - parameter2);
- }
- }
-}
\ No newline at end of file
diff --git a/Runtime/Type.meta b/Runtime/Type.meta
new file mode 100644
index 0000000..f23ddab
--- /dev/null
+++ b/Runtime/Type.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 3b505c52c75ec3f40932605e026e951f
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/Type/WeaklyMonoBase.cs b/Runtime/Type/WeaklyMonoBase.cs
new file mode 100644
index 0000000..f6e14f0
--- /dev/null
+++ b/Runtime/Type/WeaklyMonoBase.cs
@@ -0,0 +1,148 @@
+#define _HISTORY_
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+using UnityEditor;
+
+using UnityEngine;
+
+namespace XericLibrary.Runtime.Type
+{
+ ///
+ /// 弱类型脚本
+ ///
+ public class WeaklyMonoBase : MonoBehaviour
+ {
+ #region 字段
+
+ private WeaklyObjectBase weaklyBase = null;
+
+#if _HISTORY_
+
+ ///
+ /// 历史坐标
+ ///
+ private Vector3 history_Position;
+
+ ///
+ /// 历史旋转
+ ///
+ private Quaternion history_Rotation;
+
+ ///
+ /// 历史缩放
+ ///
+ private Vector3 history_Scale;
+
+ //private
+
+#endif
+
+#if UNITY_EDITOR
+
+ private static PlayModeStateChange playModeState;
+
+ [Obsolete("仅编辑器模式下可用")]
+ public static PlayModeStateChange PlayModeState => playModeState;
+ public static bool IsNotExitingPlayMode
+ {
+ [Obsolete("仅编辑器模式下可用")]
+ get;
+ private set;
+ }
+
+#endif
+
+ #endregion
+
+ #region 属性
+
+#if _HISTORY_
+
+ ///
+ /// 获取历史坐标
+ ///
+ public Vector3 HistoryPosition => history_Position;
+
+ ///
+ /// 获取历史旋转
+ ///
+ public Quaternion HistoryRotation => history_Rotation;
+
+ ///
+ /// 获取历史缩放
+ ///
+ public Vector3 HistoryScale => history_Scale;
+
+#endif
+
+ #endregion
+
+ #region 生命周期
+
+#if UNITY_EDITOR
+
+ [InitializeOnLoadMethod]
+ static void OnLoad()
+ {
+ EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
+ }
+
+#endif
+
+ #endregion
+
+ #region 事件
+
+#if UNITY_EDITOR
+ static void OnPlayModeStateChanged(PlayModeStateChange state)
+ {
+ IsNotExitingPlayMode = state != PlayModeStateChange.ExitingPlayMode;
+ playModeState = state;
+ Debug.Log($">>>>>>> {Enum.GetName(typeof(PlayModeStateChange), state)} <<<<<<<");
+ }
+#endif
+ #endregion
+
+ #region 弱
+
+ public override bool Equals(object obj)
+ {
+ return base.Equals(obj);
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ public override string ToString()
+ {
+ return base.ToString();
+ }
+
+ public static bool operator ==(WeaklyMonoBase lhs, WeaklyMonoBase rhs)
+ {
+ if(lhs == null)
+ return rhs == null;
+ if(rhs == null)
+ return lhs == null;
+ return lhs.Equals(rhs);
+ }
+
+ public static bool operator !=(WeaklyMonoBase lhs, WeaklyMonoBase rhs)
+ {
+ return !(lhs == rhs);
+ }
+
+ public static implicit operator bool(WeaklyMonoBase lhs)
+ {
+ return lhs.Equals(null);
+ }
+
+ #endregion
+
+ }
+}
\ No newline at end of file
diff --git a/Runtime/Type/WeaklyMonoBase.cs.meta b/Runtime/Type/WeaklyMonoBase.cs.meta
new file mode 100644
index 0000000..0f4299e
--- /dev/null
+++ b/Runtime/Type/WeaklyMonoBase.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a8bdf55a4d01a44418c07a6bfcfa7d15
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/Type/WeaklyObject.cs b/Runtime/Type/WeaklyObject.cs
new file mode 100644
index 0000000..5b60406
--- /dev/null
+++ b/Runtime/Type/WeaklyObject.cs
@@ -0,0 +1,44 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace XericLibrary.Runtime.Type
+{
+ public class WeaklyObject
+ {
+
+ public override bool Equals(object obj)
+ {
+ return base.Equals(obj);
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+
+ public override string ToString()
+ {
+ return base.ToString();
+ }
+
+ public static bool operator ==(WeaklyObject lhs, WeaklyObject rhs)
+ {
+ if(lhs == null)
+ return rhs == null;
+ if(rhs == null)
+ return lhs == null;
+ return lhs.Equals(rhs);
+ }
+
+ public static bool operator !=(WeaklyObject lhs, WeaklyObject rhs)
+ {
+ return !(lhs == rhs);
+ }
+
+ public static implicit operator bool(WeaklyObject lhs)
+ {
+ return lhs.Equals(null);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Runtime/Type/WeaklyObject.cs.meta b/Runtime/Type/WeaklyObject.cs.meta
new file mode 100644
index 0000000..a8f149d
--- /dev/null
+++ b/Runtime/Type/WeaklyObject.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bac5cbcb94dfc5847a0b628887919d7b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/Type/WeaklyObjectBase.cs b/Runtime/Type/WeaklyObjectBase.cs
new file mode 100644
index 0000000..5604b49
--- /dev/null
+++ b/Runtime/Type/WeaklyObjectBase.cs
@@ -0,0 +1,112 @@
+#define _HIGHQUALITYRANDOM_
+
+using XericLibrary.Runtime.MacroLibrary;
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+using UnityEngine;
+
+namespace XericLibrary.Runtime.Type
+{
+ ///
+ /// 弱类型基础
+ ///
+ [Serializable]
+ public class WeaklyObjectBase : WeaklyObject
+ {
+ #region 字段
+
+ ///
+ /// 上次操作时的时间标记
+ ///
+ private static DateTime lastDate = DateTime.Now;
+
+ ///
+ /// 上次操作时的时间标记
+ ///
+ private static ulong lastTime = 0;
+
+ ///
+ /// 同一时间中诞生计数, 使用ulong只是为了不转换,但实际上范围只在short以内,超出了其实也没事,就是有可能发生索引重复
+ ///
+ private static ulong sameCount = 0;
+
+ ///
+ /// 序列后缀
+ ///
+ [SerializeField]
+ private ulong suffixIndex = 0;
+
+ ///
+ /// 序列哈希
+ ///
+ [SerializeField]
+ private string suffixHash;
+
+ ///
+ /// 后缀索引
+ ///
+ public ulong SuffixIndex => suffixIndex;
+
+ ///
+ /// 后缀名称
+ ///
+ public string SuffixHash => suffixHash;
+
+ ///
+ /// 实例编号
+ ///
+ private static ulong InstanceCounters
+ {
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ get
+ {
+ if(lastDate.ToString() != DateTime.Now.ToString())
+ {
+ lastDate = DateTime.Now;
+ lastTime = 0;
+ string now = DateTime.Now.ToString();
+ for(int i = 0; i < now.Length; i++)
+ {
+ lastTime ^= (ulong)now[i] << (56 - (int)((float)i / now.Length * 63));
+#if _HIGHQUALITYRANDOM_
+ MacroMath.RandomNumber(lastTime);
+#endif
+ }
+ sameCount = 0;
+ }
+ return sameCount++ + MacroMath.RandomNumber(lastTime);
+ }
+ }
+
+ #endregion
+
+ #region 构造
+
+ ///
+ /// 注意不要在类字段中直接初始化,会导致种子时间不变
+ ///
+ public WeaklyObjectBase()
+ {
+ InitWeaklyObjectIndex();
+ }
+
+ #endregion
+
+ #region 方法
+
+ public void InitWeaklyObjectIndex()
+ {
+ suffixIndex = InstanceCounters;
+ suffixHash = MacroMath.MurmurFinalize(suffixIndex).ToString("X");
+ }
+
+ #endregion
+
+
+
+ }
+}
\ No newline at end of file
diff --git a/Runtime/Type/WeaklyObjectBase.cs.meta b/Runtime/Type/WeaklyObjectBase.cs.meta
new file mode 100644
index 0000000..4983bcc
--- /dev/null
+++ b/Runtime/Type/WeaklyObjectBase.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9cf76d46fc472db4fbd9351402c59c04
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/WindowsSystem.meta b/Runtime/WindowsSystem.meta
new file mode 100644
index 0000000..12549c8
--- /dev/null
+++ b/Runtime/WindowsSystem.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5fc6b770cabbcf04688e4925cfd3dc3b
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Runtime/WindowsSystem/SMTC.cs b/Runtime/WindowsSystem/SMTC.cs
new file mode 100644
index 0000000..d8f30e7
--- /dev/null
+++ b/Runtime/WindowsSystem/SMTC.cs
@@ -0,0 +1,35 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace XericLibrary.Runtime.WindowsSystem
+{
+ ///
+ /// SMTC Transport Protocol Example Library
+ ///
+ ///
+ /// SMTC是System Media Transport Controls的缩写,
+ /// 它是一组通用于所有Windows 10设备的控件,
+ /// 为用户提供一致的方法来控制使用MediaPlayer进行播放的所有正在运行的应用程序的媒体播放12。
+ ///
+ public static class SMTC
+ {
+ //void aaa()
+ //{
+
+ // MediaPlayer mediaPlayer = new MediaPlayer();
+
+ // // 获取SMTC
+ // SystemMediaTransportControls smtc = SystemMediaTransportControls.GetForCurrentView();
+
+ // // 获取当前播放的媒体项的显示属性
+ // MediaItemDisplayProperties props = smtc.DisplayUpdater.MusicProperties;
+
+ // // 获取歌曲信息
+ // string title = props.Title;
+ // string artist = props.Artist;
+ // string albumArtist = props.AlbumArtist;
+
+ //}
+ }
+}
\ No newline at end of file
diff --git a/Runtime/WindowsSystem/SMTC.cs.meta b/Runtime/WindowsSystem/SMTC.cs.meta
new file mode 100644
index 0000000..9c0517a
--- /dev/null
+++ b/Runtime/WindowsSystem/SMTC.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 983cbd90a24344b48b370ebc2d7e374a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample.meta b/Sample.meta
new file mode 100644
index 0000000..1fbad6a
--- /dev/null
+++ b/Sample.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: b7b40f5fb9e82d5489e64e495086efc6
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant.meta b/Sample/FeigenbaumConstant.meta
new file mode 100644
index 0000000..144125b
--- /dev/null
+++ b/Sample/FeigenbaumConstant.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 50284f9be7a194b46ae71888697a7264
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant.meta
new file mode 100644
index 0000000..44a8b03
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5af7e005eb125b74b966d59e1ebcf090
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/App.config b/Sample/FeigenbaumConstant/FeigenbaumConstant/App.config
new file mode 100644
index 0000000..193aecc
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/App.config
@@ -0,0 +1,6 @@
+锘
+
+
+
+
+
\ No newline at end of file
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/App.config.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/App.config.meta
new file mode 100644
index 0000000..799e43d
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/App.config.meta
@@ -0,0 +1,32 @@
+fileFormatVersion: 2
+guid: 26aa23cdf06a1c149940bd9e7a9f753b
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints: []
+ isPreloaded: 0
+ isOverridable: 1
+ isExplicitlyReferenced: 0
+ validateReferences: 1
+ platformData:
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ DefaultValueInitialized: true
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 1
+ settings: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/FeigenbaumConstant.csproj.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/FeigenbaumConstant.csproj.meta
new file mode 100644
index 0000000..c23d93d
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/FeigenbaumConstant.csproj.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 7437ebf70336c604f837a7d3ce4ffbcc
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/FeigenbaumConstant.sln.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/FeigenbaumConstant.sln.meta
new file mode 100644
index 0000000..49c7235
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/FeigenbaumConstant.sln.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 813aec0738ebeb74ebef4f2ed251ecfc
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/Program.cs b/Sample/FeigenbaumConstant/FeigenbaumConstant/Program.cs
new file mode 100644
index 0000000..e34c6f4
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/Program.cs
@@ -0,0 +1,55 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace FeigenbaumConstant
+{
+ ///
+ /// 璐规牴椴嶅甯告暟璁$畻鍣
+ ///
+ /// 璐规牴椴嶅甯告暟鏄竴涓幇浠g瀛﹁绠楃殑甯告暟锛
+ /// 鏄鍛ㄦ湡鍒嗗弶鍙婃贩娌岀幇璞$殑涓涓瘮鍊硷紝绾︿负4.669锛
+ /// 涓栫晫涔冭嚦瀹囧畽涓囩墿鐨勮寰嬮兘璺熻繖涓父鏁版湁鍏筹紝
+ /// 鍖呮嫭鐢熺墿绁炵粡鐢电幇璞★紝缁忔祹锛岀數娴侊紝浜ら氭祦锛岀敋鑷虫按榫欏ご婊村嚭鏉ョ殑姘撮兘鏈夎繖涓幇璞°
+ ///
+ ///
+ internal class Program
+ {
+ ///
+ /// 褰撳墠浜哄彛
+ ///
+ static decimal px= 2;
+
+ ///
+ /// 褰撳墠澧為暱鐜
+ ///
+ static decimal pr = 2;
+
+ static void Main(string[] args)
+ {
+ Console.WriteLine($"寮濮嬩汉鍙px},澧為暱鐜噞pr}");
+ while(px >= 0)
+ {
+ px = RobertMay_PopulationGrowthModel(pr, px);
+ Console.WriteLine($"{px}");
+ }
+ Console.ReadKey();
+ }
+
+ ///
+ /// 鐢ㄦ潵璁$畻鐨勫叕寮忥紝
+ /// 杩欓噷浣跨敤鐨勬槸 缃椾集鐗孤锋 鐨 浜哄彛澧為暱妯″瀷
+ ///
+ /// 浜哄彛澧為暱鐜
+ /// 绗琻浠d汉鍙o紝
+ /// 杈撳嚭X_n+1琛ㄧず涓嬩竴浠g殑浜哄彛
+ static decimal RobertMay_PopulationGrowthModel(decimal r, decimal xn)
+ {
+ // X_n+1 = r X_n ( 1 - X_n )
+
+ return r * xn * (1 - xn);
+ }
+ }
+}
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/Program.cs.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/Program.cs.meta
new file mode 100644
index 0000000..6e3462e
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/Program.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 966be8e483dde584fbda8a4377bd77bf
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/Properties.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/Properties.meta
new file mode 100644
index 0000000..b321ba5
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/Properties.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 0a5bc2d12b7dc7740999c7585accccf8
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/Properties/AssemblyInfo.cs b/Sample/FeigenbaumConstant/FeigenbaumConstant/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..d6cef60
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+锘縰sing System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 鏈夊叧绋嬪簭闆嗙殑涓鑸俊鎭敱浠ヤ笅
+// 鎺у埗銆傛洿鏀硅繖浜涚壒鎬у煎彲淇敼
+// 涓庣▼搴忛泦鍏宠仈鐨勪俊鎭
+[assembly: AssemblyTitle("FeigenbaumConstant")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("FeigenbaumConstant")]
+[assembly: AssemblyCopyright("Copyright 漏 2023")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 灏 ComVisible 璁剧疆涓 false 浼氫娇姝ょ▼搴忛泦涓殑绫诲瀷
+//瀵 COM 缁勪欢涓嶅彲瑙併傚鏋滈渶瑕佷粠 COM 璁块棶姝ょ▼搴忛泦涓殑绫诲瀷
+//璇峰皢姝ょ被鍨嬬殑 ComVisible 鐗规ц缃负 true銆
+[assembly: ComVisible(false)]
+
+// 濡傛灉姝ら」鐩悜 COM 鍏紑锛屽垯涓嬪垪 GUID 鐢ㄤ簬绫诲瀷搴撶殑 ID
+[assembly: Guid("ee221233-2074-4a7d-a0d0-1ddec5624dc4")]
+
+// 绋嬪簭闆嗙殑鐗堟湰淇℃伅鐢变笅鍒楀洓涓肩粍鎴:
+//
+// 涓荤増鏈
+// 娆$増鏈
+// 鐢熸垚鍙
+// 淇鍙
+//
+//鍙互鎸囧畾鎵鏈夎繖浜涘硷紝涔熷彲浠ヤ娇鐢ㄢ滅敓鎴愬彿鈥濆拰鈥滀慨璁㈠彿鈥濈殑榛樿鍊
+//閫氳繃浣跨敤 "*"锛屽涓嬫墍绀:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/Properties/AssemblyInfo.cs.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/Properties/AssemblyInfo.cs.meta
new file mode 100644
index 0000000..89ff530
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/Properties/AssemblyInfo.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 4f7c7d85220ad4346bbfa3665f4f7a0e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/bin.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/bin.meta
new file mode 100644
index 0000000..3bb4aed
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/bin.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f9f096beb45698c41ae41c2142520894
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/bin/Debug.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/bin/Debug.meta
new file mode 100644
index 0000000..0dd338b
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/bin/Debug.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5fad2166d2e250848a1e46a6f82dbeea
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/bin/Debug/FeigenbaumConstant.exe.config b/Sample/FeigenbaumConstant/FeigenbaumConstant/bin/Debug/FeigenbaumConstant.exe.config
new file mode 100644
index 0000000..193aecc
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/bin/Debug/FeigenbaumConstant.exe.config
@@ -0,0 +1,6 @@
+锘
+
+
+
+
+
\ No newline at end of file
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/bin/Debug/FeigenbaumConstant.exe.config.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/bin/Debug/FeigenbaumConstant.exe.config.meta
new file mode 100644
index 0000000..82066c0
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/bin/Debug/FeigenbaumConstant.exe.config.meta
@@ -0,0 +1,32 @@
+fileFormatVersion: 2
+guid: f2435f80b4bc6954b82c112d091c0f0c
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints: []
+ isPreloaded: 0
+ isOverridable: 1
+ isExplicitlyReferenced: 0
+ validateReferences: 1
+ platformData:
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ DefaultValueInitialized: true
+ - first:
+ Windows Store Apps: WindowsStoreApps
+ second:
+ enabled: 1
+ settings: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/bin/Debug/FeigenbaumConstant.exe.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/bin/Debug/FeigenbaumConstant.exe.meta
new file mode 100644
index 0000000..87f2950
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/bin/Debug/FeigenbaumConstant.exe.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: b6b103c29d45eea47afaa9939fc49374
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/obj.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj.meta
new file mode 100644
index 0000000..aa4859f
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: ecbcedec3e2fe8a43820fb40ce3f295d
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug.meta
new file mode 100644
index 0000000..9e2dd43
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6fe415040d3d67e4091b6cdec7abfb46
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs
new file mode 100644
index 0000000..15efebf
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs
@@ -0,0 +1,4 @@
+//
+using System;
+using System.Reflection;
+[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache.meta
new file mode 100644
index 0000000..860ed0b
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: c25c49f9c87f7ad489d78e0be2f4412d
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.AssemblyReference.cache.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.AssemblyReference.cache.meta
new file mode 100644
index 0000000..768c301
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.AssemblyReference.cache.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: eb381742126580b42b6574ccf0877128
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.CoreCompileInputs.cache.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.CoreCompileInputs.cache.meta
new file mode 100644
index 0000000..81e152e
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.CoreCompileInputs.cache.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: bd9fc11cd56677040b2bb913bcbf3338
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.FileListAbsolute.txt b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.FileListAbsolute.txt
new file mode 100644
index 0000000..01e0909
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.FileListAbsolute.txt
@@ -0,0 +1,8 @@
+G:\UnityProject\MyPrit\Packages\com.lrss3.xericlibrary\Sample\FeigenbaumConstant\FeigenbaumConstant\bin\Debug\FeigenbaumConstant.exe.config
+G:\UnityProject\MyPrit\Packages\com.lrss3.xericlibrary\Sample\FeigenbaumConstant\FeigenbaumConstant\bin\Debug\FeigenbaumConstant.exe
+G:\UnityProject\MyPrit\Packages\com.lrss3.xericlibrary\Sample\FeigenbaumConstant\FeigenbaumConstant\bin\Debug\FeigenbaumConstant.pdb
+G:\UnityProject\MyPrit\Packages\com.lrss3.xericlibrary\Sample\FeigenbaumConstant\FeigenbaumConstant\obj\Debug\FeigenbaumConstant.csproj.AssemblyReference.cache
+G:\UnityProject\MyPrit\Packages\com.lrss3.xericlibrary\Sample\FeigenbaumConstant\FeigenbaumConstant\obj\Debug\FeigenbaumConstant.csproj.SuggestedBindingRedirects.cache
+G:\UnityProject\MyPrit\Packages\com.lrss3.xericlibrary\Sample\FeigenbaumConstant\FeigenbaumConstant\obj\Debug\FeigenbaumConstant.csproj.CoreCompileInputs.cache
+G:\UnityProject\MyPrit\Packages\com.lrss3.xericlibrary\Sample\FeigenbaumConstant\FeigenbaumConstant\obj\Debug\FeigenbaumConstant.exe
+G:\UnityProject\MyPrit\Packages\com.lrss3.xericlibrary\Sample\FeigenbaumConstant\FeigenbaumConstant\obj\Debug\FeigenbaumConstant.pdb
diff --git a/Tests/Editor/Lrss3.XericLibrary.Editor.Tests.asmdef.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.FileListAbsolute.txt.meta
similarity index 59%
rename from Tests/Editor/Lrss3.XericLibrary.Editor.Tests.asmdef.meta
rename to Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.FileListAbsolute.txt.meta
index 52560e2..1bc7849 100644
--- a/Tests/Editor/Lrss3.XericLibrary.Editor.Tests.asmdef.meta
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.FileListAbsolute.txt.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
-guid: 51ebe42b1738ff64ea409a84d5b05c3e
-AssemblyDefinitionImporter:
+guid: ce636184b8aeab043b2ab413db44175f
+TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.SuggestedBindingRedirects.cache.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.SuggestedBindingRedirects.cache.meta
new file mode 100644
index 0000000..ceb5317
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.csproj.SuggestedBindingRedirects.cache.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: bf0612e25fc294849a90ec46579e58d3
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.exe.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.exe.meta
new file mode 100644
index 0000000..b3251a8
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/FeigenbaumConstant.exe.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 2cedfacef3c91b44bb4e22b96041f59a
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/TempPE.meta b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/TempPE.meta
new file mode 100644
index 0000000..1f7db97
--- /dev/null
+++ b/Sample/FeigenbaumConstant/FeigenbaumConstant/obj/Debug/TempPE.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 081141d0177247448aedd101e596e33f
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Samples/Example/.sample.json b/Samples/Example/.sample.json
deleted file mode 100644
index 3b43eaf..0000000
--- a/Samples/Example/.sample.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "displayName":"Example Sample",
- "description": "Replace this string with your own description of the sample. Delete the Samples folder if not needed.",
- "createSeparatePackage": false
-}
diff --git a/Samples/Example/SampleExample.cs b/Samples/Example/SampleExample.cs
deleted file mode 100644
index c6aa94c..0000000
--- a/Samples/Example/SampleExample.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-// -----------------------------------------------------------------------------
-//
-// Use this sample example C# file to develop samples to guide usage of APIs
-// in your package.
-//
-// -----------------------------------------------------------------------------
-
-namespace Lrss3.XericLibrary
-{
- ///
- /// Provide a general description of the public class.
- ///
- ///
- /// Packages require XmlDoc documentation for ALL Package APIs.
- /// https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/xmldoc/xml-documentation-comments
- ///
- public class MyPublicSampleExampleClass
- {
- ///
- /// Provide a description of what this public method does.
- ///
- public void CountThingsAndDoStuffAndOutputIt()
- {
- var result = new MyPublicRuntimeExampleClass().CountThingsAndDoStuff(1, 2, false);
- Debug.Log("Call CountThingsAndDoStuffAndOutputIt returns " + result);
- }
- }
-}
\ No newline at end of file
diff --git a/Tests/Editor/EditorExampleTest.cs b/Tests/Editor/EditorExampleTest.cs
deleted file mode 100644
index 7f138d0..0000000
--- a/Tests/Editor/EditorExampleTest.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using UnityEngine;
-using UnityEditor;
-using UnityEngine.TestTools;
-using NUnit.Framework;
-using System.Collections;
-
-namespace Lrss3.XericLibrary.Editor.Tests
-{
-
- class EditorExampleTest
- {
-
- [Test]
- public void EditorSampleTestSimplePasses()
- {
- // Use the Assert class to test conditions.
- }
-
- // A UnityTest behaves like a coroutine in PlayMode
- // and allows you to yield null to skip a frame in EditMode
- [UnityTest]
- public IEnumerator EditorSampleTestWithEnumeratorPasses()
- {
- // Use the Assert class to test conditions.
- // yield to skip a frame
- yield return null;
- }
- }
-}
\ No newline at end of file
diff --git a/Tests/Editor/Lrss3.XericLibrary.Editor.Tests.asmdef b/Tests/Editor/Lrss3.XericLibrary.Editor.Tests.asmdef
deleted file mode 100644
index 078ba4f..0000000
--- a/Tests/Editor/Lrss3.XericLibrary.Editor.Tests.asmdef
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "name": "Lrss3.XericLibrary.Editor.Tests",
- "references": [
- "Lrss3.XericLibrary.Editor",
- "Lrss3.XericLibrary"
- ],
- "optionalUnityReferences": [
- "TestAssemblies"
- ],
- "includePlatforms": [
- "Editor"
- ],
- "excludePlatforms": []
-}
diff --git a/Tests/Runtime.meta b/Tests/Runtime.meta
deleted file mode 100644
index 50082e8..0000000
--- a/Tests/Runtime.meta
+++ /dev/null
@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: 296acdc89982788448c050eb596ad6f8
-folderAsset: yes
-DefaultImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Tests/Runtime/Lrss3.XericLibrary.Tests.asmdef b/Tests/Runtime/Lrss3.XericLibrary.Tests.asmdef
deleted file mode 100644
index f82dac3..0000000
--- a/Tests/Runtime/Lrss3.XericLibrary.Tests.asmdef
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "Lrss3.XericLibrary.Tests",
- "references": [
- "Lrss3.XericLibrary"
- ],
- "optionalUnityReferences": [
- "TestAssemblies"
- ],
- "includePlatforms": [],
- "excludePlatforms": []
-}
diff --git a/Tests/Runtime/Lrss3.XericLibrary.Tests.asmdef.meta b/Tests/Runtime/Lrss3.XericLibrary.Tests.asmdef.meta
deleted file mode 100644
index 45bbe70..0000000
--- a/Tests/Runtime/Lrss3.XericLibrary.Tests.asmdef.meta
+++ /dev/null
@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: 5d2a3c8f571496842b07eb6a6ed1b1b6
-AssemblyDefinitionImporter:
- externalObjects: {}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/Tests/Runtime/RuntimeExampleTest.cs b/Tests/Runtime/RuntimeExampleTest.cs
deleted file mode 100644
index 7f51ccd..0000000
--- a/Tests/Runtime/RuntimeExampleTest.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using UnityEngine;
-using UnityEngine.TestTools;
-using NUnit.Framework;
-using System.Collections;
-
-namespace Lrss3.XericLibrary.Tests
-{
-
- class RuntimeExampleTest
- {
-
- [Test]
- public void PlayModeSampleTestSimplePasses()
- {
- // Use the Assert class to test conditions.
- }
-
- // A UnityTest behaves like a coroutine in PlayMode
- // and allows you to yield null to skip a frame in EditMode
- [UnityTest]
- public IEnumerator PlayModeSampleTestWithEnumeratorPasses()
- {
- // Use the Assert class to test conditions.
- // yield to skip a frame
- yield return null;
- }
- }
-}
\ No newline at end of file
diff --git a/Tests/Runtime/RuntimeExampleTest.cs.meta b/Tests/Runtime/RuntimeExampleTest.cs.meta
deleted file mode 100644
index d4e4a04..0000000
--- a/Tests/Runtime/RuntimeExampleTest.cs.meta
+++ /dev/null
@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: dba38a948462fe547b61062ffe8426c8
-MonoImporter:
- externalObjects: {}
- serializedVersion: 2
- defaultReferences: []
- executionOrder: 0
- icon: {instanceID: 0}
- userData:
- assetBundleName:
- assetBundleVariant:
diff --git a/package.json b/package.json
index f3e970a..8318713 100644
--- a/package.json
+++ b/package.json
@@ -1,9 +1,7 @@
{
- "name": "com.lrss3.xericlibrary",
- "displayName":"Xeric Library",
- "version": "0.1.0",
- "unity": "2021.3",
- "description": "Replace this string with your own description of the package. This description appears in the Package Manager window when the user selects this package from the list. \n\nFor best results, use this text to summarize: \n\u25AA What the package does \n\u25AA How it can benefit the user \n\nNote: Special formatting characters are supported, including line breaks ('\\n') and bullets ('\\u25AA').",
- "dependencies": {
- }
-}
+ "name": "com.lrss3.xericlibrary",
+ "displayName": "Xeric Library",
+ "version": "0.1.1",
+ "unity": "2021.3",
+ "description": "Replace this string with your own description of the package. This description appears in the Package Manager window when the user selects this package from the list. \n\nFor best results, use this text to summarize: \n\u25aa What the package does \n\u25aa How it can benefit the user \n\nNote: Special formatting characters are supported, including line breaks ('\\n') and bullets ('\\u25AA')."
+}
\ No newline at end of file