解决了内存泄漏问题(BasicSplineJustFollow.Update中判断材质是否变更的方式有误)

This commit is contained in:
2025-10-12 00:54:25 +08:00
parent f14f5a1dda
commit 6af79f0480
6 changed files with 25 additions and 15 deletions

View File

@@ -173,14 +173,6 @@ namespace Demo.Game
if (MyMeshGenerator == null)
return;
base.UpdateTicks(currentTime, deltaTime, tickType);
if (currentTime >= Entries[0].TimePoint && (tickType == TickType.Update))
{
if (MyLineMaterial != MyMeshRenderer.material)
{
MyMeshRenderer.material = MyLineMaterial;
MyMeshGenerator.Rebuild();
}
}
}
public override Vector3 EvaluateClipFromPosition(float time)

View File

@@ -19,7 +19,7 @@ namespace Demo.Game
protected override void UpdateTicks(float currentTime, float deltaTime, TickType tickType)
{
base.UpdateTicks(currentTime, deltaTime, tickType);
//Updater?.Invoke();
Updater?.Invoke();
}
/// <summary>

View File

@@ -42,7 +42,7 @@ namespace Demo.Game
{
var spline = self.SharedInterfaceScriptObject.FindWithPath(path, false);
if (spline == null)
yield return self.SharedInterfaceScriptObject.LoadSubScriptAsync(nameof(SplineCore), path, x => spline = x);
yield return self.SharedInterfaceScriptObject.DoLoadSubScriptAsync(nameof(SplineCore), path, x => spline = x);
if (spline is SplineCore sc)
{
self.MySplineCore = sc;
@@ -160,7 +160,7 @@ namespace Demo.Game
")]
public IEnumerator LoadNode(string path)
{
yield return LoadSubScriptAsync(nameof(SplineNode), path, node =>
yield return DoLoadSubScriptAsync(nameof(SplineNode), path, node =>
{
if (node is SplineNode _node)
{

View File

@@ -61,7 +61,7 @@ namespace Demo.Game
MySplineCore = FindWithPath(path, false) as SplineCore;
if (MySplineCore == null)
{
yield return LoadSubScriptAsync(nameof(SplineCore), path, x =>
yield return DoLoadSubScriptAsync(nameof(SplineCore), path, x =>
{
MySplineCore = x as SplineCore;
});