FTriggerBuffEvent.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Security;
  4. using UnityEngine;
  5. namespace Flux
  6. {
  7. [FEvent("Skill/策划/触发buff")]
  8. public class FTriggerBuffEvent : FEvent
  9. {
  10. [HideInInspector]
  11. [SerializeField]
  12. private int _buffId = 0;
  13. public int BuffId
  14. {
  15. get { return _buffId; }
  16. }
  17. [HideInInspector]
  18. [SerializeField]
  19. private int _rate = 0;
  20. public int Rate
  21. {
  22. get { return _rate; }
  23. }
  24. public FTriggerBuffEvent()
  25. {
  26. _eventType = SkillActionFrameEventType.FE_Buff;
  27. }
  28. protected override void OnTrigger(float timeSinceTrigger)
  29. {
  30. base.OnTrigger(timeSinceTrigger);
  31. }
  32. protected override void OnPause()
  33. {
  34. base.OnPause();
  35. }
  36. protected override void OnResume()
  37. {
  38. base.OnResume();
  39. }
  40. protected override void OnFinish()
  41. {
  42. base.OnFinish();
  43. }
  44. protected override void OnStop()
  45. {
  46. base.OnStop();
  47. }
  48. public override int GetMaxLength()
  49. {
  50. return base.GetMaxLength();
  51. }
  52. public override string Text
  53. {
  54. get { return "触发buff"; }
  55. set { }
  56. }
  57. public override SecurityElement SaveToXml()
  58. {
  59. SecurityElement node = base.SaveToXml();
  60. SecurityElement paramNode = WriteParamNode("buffid", _buffId.ToString(), "int");
  61. node.AddChild(paramNode);
  62. paramNode = WriteParamNode("rate", _rate.ToString(), "int");
  63. node.AddChild(paramNode);
  64. return node;
  65. }
  66. public override void LoadFromXml(SecurityElement eventNode)
  67. {
  68. base.LoadFromXml(eventNode);
  69. _buffId = GetNParam("buffid");
  70. _rate = GetNParam("rate");
  71. }
  72. }
  73. }