using System; using UnityEngine; public partial class CombatEntity { public bool IsValid { get { if (isEnabled == false) return false; if (isDestroyEnt) return false; return true; } } public static implicit operator bool(CombatEntity entity) { return entity is { isEnabled: true, isDestroyEnt: false }; } public ReuseGoData GetNewGo(string path, Action callback, int interlockInd = 0) { // todo 关联所属 return GoPoolDic.GetPool(path).GetNewGo(callback, interlockInd); } public ReuseGoData GetNewGo(string path, Action callback, object param) { return GoPoolDic.GetPool(path).GetNewGo(callback, -1, param); } public void ReleaseGo(string path, ReuseGoData go) { GoPoolDic.GetPool(path).ReleaseGo(go); } public void ReleaseGo(ReuseGoData go) { GoPoolDic.GetPool(go.path).ReleaseGo(go); } } public static class CombatEntityExt { public static bool IsValid(this CombatEntity entity) { if (entity == null) return false; if (entity.isEnabled == false) return false; if (entity.isDestroyEnt) return false; return true; } }