SimpleEntityView.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using FL.Battle;
  2. using FL.Battle.Components;
  3. using UnityEngine;
  4. using XGame.Framework.Map;
  5. using XGame.Framework.Time;
  6. namespace FL.Map
  7. {
  8. /// <summary>
  9. /// 没有IEntity的对象基类
  10. /// </summary>
  11. /// <typeparam name="TViewModel"></typeparam>
  12. public abstract class SimpleEntityView<TViewModel> : EntityView<TViewModel>, IMoveContext where TViewModel : EntityViewModel
  13. {
  14. /// <summary>
  15. /// 召唤者的EntityId
  16. /// </summary>
  17. public long MasterId { get; set; }
  18. /// <summary>
  19. /// 配置表Id
  20. /// </summary>
  21. public int TableId { get; set; }
  22. /// <summary>
  23. /// 实例id
  24. /// </summary>
  25. public long UID { get; set; }
  26. public ITargetSelector Selector { get; set; }
  27. public ITimeModule Time => Context.Time;
  28. public IMapAssetModule Asset => Context.Asset;
  29. Transform IMoveContext.OwnerTr => VM.Tr;
  30. public MoveComponent Move => GetComponent<MoveComponent>();
  31. protected override void OnEnable(object intent)
  32. {
  33. }
  34. protected override void OnDisable()
  35. {
  36. Selector = null;
  37. }
  38. }
  39. }