32 lines
876 B
C#
32 lines
876 B
C#
|
using ET.EventType;
|
|||
|
using ET;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace ET
|
|||
|
{
|
|||
|
public class OnDisposeUnitEvent : AEvent_Sync<OnDisposeUnit>
|
|||
|
{
|
|||
|
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<UnitView>();
|
|||
|
var foot = unitView.footEffect?.gameObject;
|
|||
|
if (foot != null)
|
|||
|
ResourceViewHelper.DestoryPrefabAsync(foot);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|