using ET.EventType; using ET; using System; using System.Collections.Generic; using UnityEngine; namespace ET { public class OnDisposeUnitEvent : AEvent_Sync { public override void Run(OnDisposeUnit args) { Unit 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); UnitView unitView = unit.GetComponent(); GameObject foot = unitView.footEffect?.gameObject; if (foot != null) ResourceViewHelper.DestoryPrefabAsync(foot); } } }