This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-10-17 02:12:03 +08:00
parent c85f350e0a
commit dd2e0e8a46
16 changed files with 52 additions and 611 deletions

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using DotRecast.Core.Collections;
using Entitas;
using JNGame.Runtime.Sync;
using JNGame.Sync.Entity;
@@ -104,13 +103,13 @@ namespace JNGame.Sync.Frame.Entity
//生效延迟销毁
public void DelayDestroy()
{
GetEntities().ForEach(child =>
foreach (var child in GetEntities())
{
if (child.IsDelayDestroy)
{
child.Destroy();
}
});
}
}
//生命周期

View File

@@ -1,6 +1,4 @@
using System;
using System.Linq;
using DotRecast.Core.Collections;
using JNGame.Math;
using JNGame.Sync.Entity.Component;
using JNGame.Sync.Frame.Entity;
@@ -107,7 +105,10 @@ namespace JNGame.Sync.Entity
public override void RemoveAllComponents()
{
GetComponents().ForEach(child => (child as JNComponent)?.OnSyncDestroy());
foreach (var child in GetComponents())
{
(child as JNComponent)?.OnSyncDestroy();
}
base.RemoveAllComponents();
}