AddFunctionPoint.cs 894 B

12345678910111213141516171819202122232425262728293031323334
  1. using UnityEngine;
  2. using System.Collections;
  3. public class AddFunctionPoint : TickFunctionEvent
  4. {
  5. public static AddFunctionPoint Creator(BuffFunctionData data)
  6. {
  7. return new AddFunctionPoint(data);
  8. }
  9. public AddFunctionPoint(BuffFunctionData data) : base(data)
  10. {
  11. }
  12. public override void Enter(Fighter fighter)
  13. {
  14. base.Enter(fighter);
  15. if(Data.TargetType == 1)
  16. {
  17. if (Caster != null)
  18. {
  19. Caster.AddFunctionPoint((int)Data.BaseValue, (int)Data.IncVal,Data.SkillLv);
  20. }
  21. }
  22. else if(Data.TargetType == 2)
  23. {
  24. fighter.AddFunctionPoint((int)Data.BaseValue, (int)Data.IncVal, Data.SkillLv);
  25. }
  26. //DebugHelper.LogError("AddFunctionPoint TargetType = " + Data.TargetType + " pointBuffId = "+Data.BaseValue + " point = "+Data.IncVal);
  27. }
  28. }