FiE-Game/Assets/Cinema Director/Cutscene Items/Actor Items/GameObject/SendMessageGameObject.cs
2023-07-27 00:47:00 +05:00

29 lines
No EOL
907 B
C#

using UnityEngine;
namespace CinemaDirector
{
/// <summary>
/// An event for calling the game object send message method.
/// Cannot be reversed.
/// </summary>
[CutsceneItemAttribute("Game Object", "Send Message", CutsceneItemGenre.ActorItem)]
public class SendMessageGameObject : CinemaActorEvent
{
public string MethodName = string.Empty;
public object Parameter = null;
public SendMessageOptions SendMessageOptions = SendMessageOptions.DontRequireReceiver;
/// <summary>
/// Trigger this event and send the message.
/// </summary>
/// <param name="actor">the actor to send the message to.</param>
public override void Trigger(GameObject actor)
{
if (actor != null)
{
actor.SendMessage(MethodName, Parameter, SendMessageOptions);
}
}
}
}