BattleActorMgr.cs 780 B

1234567891011121314151617181920212223242526272829303132333435
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. public class BattleActorMgr : Singleton<BattleActorMgr>
  5. {
  6. private Dictionary<long, ActorData> npcActorList = new Dictionary<long, ActorData>();
  7. public override void Init()
  8. {
  9. base.Init();
  10. }
  11. public override void UnInit()
  12. {
  13. npcActorList.Clear();
  14. base.UnInit();
  15. }
  16. public ActorData GetNpcActorData(long uniqueId,int npcId)
  17. {
  18. ActorData data;
  19. if(!npcActorList.TryGetValue(uniqueId,out data))
  20. {
  21. data = ActorData.CreateNpcPlayerActor(uniqueId, npcId, 1);
  22. npcActorList.Add(uniqueId, data);
  23. }
  24. return data;
  25. }
  26. public void Clear()
  27. {
  28. npcActorList.Clear();
  29. }
  30. }