1.修复多处错误2.SplineNode依然存在设置不生效的错误

This commit is contained in:
2025-10-05 20:18:48 +08:00
parent c108b2b844
commit 8f8dfcbb64
89 changed files with 104 additions and 1310 deletions

View File

@@ -394,6 +394,11 @@ namespace Demo
{
// 先天支持的工具函数
[Content, SerializeField] private Vector3
EnterGameLocalPosition = Vector3.zero,
EnterGameEulerAngles = Vector3.zero,
EnterGameLocalScaling = Vector3.one;
/// <summary>
/// 设置坐标
/// </summary>
@@ -410,7 +415,7 @@ namespace Demo
")]
public void SetLocalPosition(string x, string y, string z)
{
transform.localPosition = new(Parse(x), Parse(y), Parse(z));
EnterGameLocalPosition = new(Parse(x), Parse(y), Parse(z));
}
/// <summary>
/// 设置欧拉角
@@ -428,7 +433,7 @@ namespace Demo
")]
public void SetLocalEulerAngles(string x, string y, string z)
{
transform.localEulerAngles = new(Parse(x), Parse(y), Parse(z));
EnterGameEulerAngles = new(Parse(x), Parse(y), Parse(z));
}
/// <summary>
/// 设置缩放
@@ -446,7 +451,14 @@ namespace Demo
")]
public void SetLocalScaling(string x, string y, string z)
{
transform.localScale = new(Parse(x), Parse(y), Parse(z));
EnterGameLocalScaling = new(Parse(x), Parse(y), Parse(z));
}
public virtual void ResetEnterGameStatus()
{
transform.localPosition = EnterGameLocalPosition;
transform.localEulerAngles = EnterGameEulerAngles;
transform.localScale = EnterGameLocalScaling;
}
/// <summary>
@@ -473,13 +485,13 @@ namespace Demo
/// 指定多少个<see cref="TickType.Update"/>状态的<see cref="UpdateTicks(float, float, TickType)"/>执行一次更新,不会影响到子物体
/// 属于性能优化的高级选项
/// </summary>
/// <param name="frame">间隔帧数, 小于等于1的值代表无论如何都会更新</param>
/// <param name="frame">每frame帧更新一次, 等于0代表不会在<see cref="TickType.Update"/>状态运行</param>
[ScriptableCall(@"
<summary>
指定多少个Update状态的UpdateTicks执行一次更新,不会影响到子物体
属于性能优化的高级选项
</summary>
<param name=""frame"">间隔帧数, 小于等于1的值代表无论如何都会更新</param>
<param name=""frame"">每frame帧更新一次, 等于0代表不会在Update状态运行</param>
")]
public void SetUpdatePerFrame(string frame)
{
@@ -571,18 +583,24 @@ namespace Demo
// GetParent
ScriptableObject result = Parent;
if (path[0] == '/' || path[0]=='\\')
{
result = GetRoot();
}
if (Parent == null)
{
throw new InvalidOperationException($"Root is nosupport to {nameof(FindWithPath)}");
}
// Find
var components = path.Split('/', '\\');
components[^1] = new ToolFile(components[^1]).GetFilename(true);
foreach (var component in components)
{
if (component == "..")
result = result.Parent;
else if (component == ".")
else if (component == "." || string.IsNullOrEmpty(component))
continue;
else
{
@@ -590,7 +608,7 @@ namespace Demo
string targetScriptObjectPath = component;
Regex regex = new(@"^(.*)\[(\d*)\]$");
var match = regex.Match(component);
if(match.Success)
if (match.Success)
{
targetScriptObjectPath = match.Groups[1].Value;
index = int.Parse(match.Groups[2].Value);
@@ -901,7 +919,12 @@ namespace Demo
#if UNITY_EDITOR
s_PreparePerfMarker.Begin(this);
#endif
if (tickType == TickType.Reset)
{
ResetEnterGameStatus();
}
// UpdateTicks
if (UpdatePerFrame > 0)
{
if (ScriptUpdateCounter % UpdatePerFrame == 0)
UpdateTicks(currentTime, deltaTime, tickType);