BuffInfo.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Excel2Json;
  2. using Fort23.Core;
  3. using Fort23.UTool;
  4. namespace GameLogic.Combat.Buff
  5. {
  6. public class BuffInfo: CObject
  7. {
  8. /// <summary>
  9. /// 来源
  10. /// </summary>
  11. public object source;
  12. public static BuffInfo GetBuffInfo(int id, float buffTime,int count,object source)
  13. {
  14. BuffInfo buffInfo= CObjectPool.Instance.Fetch<BuffInfo>();
  15. buffInfo.Init(id, buffTime,count);
  16. buffInfo.source = source;
  17. return buffInfo;
  18. }
  19. public static BuffInfo GetBuffInfo(int id, int count,object source)
  20. {
  21. BuffInfo buffInfo= CObjectPool.Instance.Fetch<BuffInfo>();
  22. BuffConfig buffConfig= ConfigComponent.Instance.Get<BuffConfig>(id);
  23. buffInfo.Init(id, buffConfig.buffTime,count);
  24. buffInfo.source = source;
  25. return buffInfo;
  26. }
  27. public BuffConfig BuffConfig;
  28. public float buffTime;
  29. public int count;
  30. public void Init(int id, float buffTime,int count)
  31. {
  32. this.buffTime = buffTime;
  33. this.count = count;
  34. BuffConfig = ConfigComponent.Instance.Get<BuffConfig>(id);
  35. }
  36. public override void ActiveObj()
  37. {
  38. }
  39. public override void DormancyObj()
  40. {
  41. source = null;
  42. }
  43. }
  44. }