mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//生命周期
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user