FSummonEvent.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Security;
  4. using UnityEngine;
  5. namespace Flux
  6. {
  7. [FEvent("Skill/策划/召唤")]
  8. public class FSummonEvent : FEvent
  9. {
  10. [HideInInspector]
  11. [SerializeField]
  12. private int _npcId = 0;
  13. public int NpcId
  14. {
  15. get { return _npcId; }
  16. }
  17. [HideInInspector]
  18. [SerializeField]
  19. private int _npcPos = 0;
  20. public int NpcPos
  21. {
  22. get { return _npcPos; }
  23. }
  24. [SerializeField]
  25. [HideInInspector]
  26. private int _startOffset = 0;
  27. public int StartOffset { get { return _startOffset; } }
  28. public FSummonEvent()
  29. {
  30. _eventType = SkillActionFrameEventType.FE_Summon;
  31. }
  32. protected override void OnSetDefaultValues()
  33. {
  34. base.OnSetDefaultValues();
  35. }
  36. protected override void OnTrigger(float timeSinceTrigger)
  37. {
  38. base.OnTrigger(timeSinceTrigger);
  39. }
  40. protected override void OnPause()
  41. {
  42. base.OnPause();
  43. }
  44. protected override void OnResume()
  45. {
  46. base.OnResume();
  47. }
  48. protected override void OnFinish()
  49. {
  50. base.OnFinish();
  51. }
  52. protected override void OnStop()
  53. {
  54. base.OnStop();
  55. }
  56. public override int GetMaxLength()
  57. {
  58. return base.GetMaxLength();
  59. }
  60. public override string Text
  61. {
  62. get { return "召唤"; }
  63. set { }
  64. }
  65. public override SecurityElement SaveToXml()
  66. {
  67. SecurityElement node = base.SaveToXml();
  68. SecurityElement paramNode = WriteParamNode("npcId",_npcId.ToString(),"int");
  69. node.AddChild(paramNode);
  70. paramNode = WriteParamNode("npcPos", _npcPos.ToString(), "int");
  71. node.AddChild(paramNode);
  72. return node;
  73. }
  74. public override void LoadFromXml(SecurityElement eventNode)
  75. {
  76. base.LoadFromXml(eventNode);
  77. _npcId = GetNParam("npcId");
  78. _npcPos = GetNParam("npcPos");
  79. }
  80. }
  81. }