1234567891011121314151617181920212223 |
- using ET;
- using ET.Client;
- [Event]
- public class ChangeModelEventHandler : BEvent<ET.EventType.ChangeModeEvent>
- {
- protected override async ETTask 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.Clone(unitid, args.ModelName));
- await ETTask.CompletedTask;
- }
- }
|