Danro/Assets/Scripts/Behaviour/Sequence/AddMessageAction.cs

27 lines
702 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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