29 lines
788 B
C#
29 lines
788 B
C#
using System;
|
|
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
namespace RR.Common.Behaviour
|
|
{
|
|
/// <summary>
|
|
/// Действие добавления сообщения
|
|
/// </summary>
|
|
[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;
|
|
}
|
|
}
|
|
}
|
|
|