1234567891011121314151617181920212223242526272829303132333435 |
- using ET.EventType;
- using UnityEngine;
- namespace ET.Client
- {
- [Event]
- public class OnDestroyZoneObjectHandler : BEvent<EventType.OnDestroyZoneObject>
- {
- protected override async ETTask OnEvent( EventType.OnDestroyZoneObject args)
- {
- //Log.Debug($"remove unit view: {args.ObjectId}");
- DestroyUnitModel(args.ObjectId);
- await ETTask.CompletedTask;
- }
- private void DestroyUnitModel(uint unitid)
- {
- if(ModelViewComponent.Instance != null)
- {
- ModelViewComponent.Instance.RemoveChild(unitid);
- }
- if (unitid == UnitMgr.Instance.ActorId)
- {
- //相机跟随主角
- //ModelViewComponent.Instance.AddComponent<CameraComponent>().Unit = unit;
- //固定视角相机
- var camera = Camera.main;
- //camera.transform.position = new Vector3(unit.Position.x, 7, unit.Position.z - 15);
- }
-
- }
- }
- }
|