You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

44 lines
956B

  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. class ActionSendMessage : Action
  5. {
  6. protected string message;
  7. protected object param;
  8. protected SendMessageOptions options = SendMessageOptions.DontRequireReceiver;
  9. public ActionSendMessage(string tgtMessage)
  10. : base()
  11. {
  12. message = tgtMessage;
  13. }
  14. public ActionSendMessage(string tgtMessage, object tgtParam)
  15. : base()
  16. {
  17. message = tgtMessage;
  18. param = tgtParam;
  19. }
  20. public ActionSendMessage(string tgtMessage, object tgtParam, SendMessageOptions tgtOptions)
  21. : base()
  22. {
  23. message = tgtMessage;
  24. param = tgtParam;
  25. options = tgtOptions;
  26. }
  27. public override void start()
  28. {
  29. base.start();
  30. if (param != null)
  31. {
  32. target.SendMessage(message, param);
  33. }
  34. else
  35. {
  36. target.SendMessage(message);
  37. }
  38. }
  39. }