using ET.EventType; using ET; using System; using System.Collections.Generic; namespace ET { public class OnDisposeUnitEvent : AEvent_Sync { public override void Run(OnDisposeUnit args) { var unit = args.unit; if (unit.UnitType == UnitType.NPC) { NPCHudComponent.Instance.Remove(unit); } else if (unit.UnitType == UnitType.TransPoint) return; else if (unit.UnitType == UnitType.SceneUnit) return; else HudComponent.Instance.Remove(unit); var unitView = unit.GetComponent(); var foot = unitView.footEffect?.gameObject; if (foot != null) ResourceViewHelper.DestoryPrefabAsync(foot); } } }