OnDestroyZoneObject.cs 892 B

1234567891011121314151617181920212223242526272829
  1. using UnityEngine;
  2. namespace ET.Client
  3. {
  4. [Event(SceneType.Current)]
  5. public class OnDestroyZoneObject : AEvent<EventType.OnDestroyZoneObject>
  6. {
  7. protected override async ETTask Run(Scene scene, EventType.OnDestroyZoneObject args)
  8. {
  9. await DestroyUnitModel(args.Object);
  10. }
  11. private async ETTask DestroyUnitModel(BattleObject unit)
  12. {
  13. ModelViewComponent.Instance.RemoveChild(unit.Id);
  14. if (unit is BattleActor)
  15. {
  16. //相机跟随主角
  17. //ModelViewComponent.Instance.AddComponent<CameraComponent>().Unit = unit;
  18. //固定视角相机
  19. var camera = Camera.main;
  20. //camera.transform.position = new Vector3(unit.Position.x, 7, unit.Position.z - 15);
  21. }
  22. await ETTask.CompletedTask;
  23. }
  24. }
  25. }