using System; using System.Collections; using UnityEngine; namespace RR.Common.Behaviour { /// /// Действие добавления сообщения /// [Serializable] public class AddMessageAction : SequenceAction { [SerializeField] public string text; [SerializeField] public GameObject target; [SerializeField] public Vector3 offset; public override IEnumerator Execute(Sequencer context, GameObject targetGO) { if (context is MessageController messageController) { GameObject actualTarget = target ? target : targetGO; messageController.Add(actualTarget, text, offset); } yield return null; } } }