12345678910111213141516171819202122 |
- using ET;
- using ET.Client;
- [Event(SceneType.None)]
- public class ChangeModelEventHandler : BEvent<ET.EventType.ChangeModeEvent>
- {
- public override void OnEvent(ET.EventType.ChangeModeEvent args)
- {
- var unitid = args.ObjectId;
- if (!UnitMgr.Instance.HasUnit(unitid))
- {
- Log.Debug($"ignore change event @{unitid}, unit not exist");
- return;
- }
- if (ModelViewComponent.Instance != null)
- {
- ModelViewComponent.Instance.RemoveChild(unitid);
- }
- EventSystem.Instance.Publish(ET.EventType.OnNewZoneObject.Static.Clone(unitid, args.ModelName));
- }
- }
|