25개 이상의 토픽을 선택하실 수 없습니다. 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.

ActionSendMessage.cs 956B

10 년 전
1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. }