- Добавил систему диалогов - Создал классы Sequencer.cs и SequenceAction.cs для воссоздания последовательности действий - Добавил иеханику последовательности действий в Message.cs и MessageController.cs
28 lines
736 B
C#
28 lines
736 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;
|
|
|
|
public override IEnumerator Execute(Sequencer sequencer, GameObject targetGO)
|
|
{
|
|
if (sequencer is MessageController messageController)
|
|
{
|
|
GameObject actualTarget = target ? target : targetGO;
|
|
messageController.Add(actualTarget, text);
|
|
}
|
|
yield return null;
|
|
}
|
|
}
|
|
}
|
|
|