Last Dialogue Started#
Game Creator / Dialogue / Last Dialogue Started
Can Read
Cannot Write
Description#
The last Dialogue component that started playing
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
using VisualScript.Runtime;
namespace GameCreator.Runtime.Dialogue
{
[Get]
[Title("Last Dialogue Started")]
[Category("Game Creator/Dialogue/Last Dialogue Started")]
[Description("The last Dialogue component that started playing")]
[Image(typeof(IconDialogue), ColorTheme.Type.Blue, typeof(BadgeArrowRight))]
[Keywords("Script", "Narration", "Text", "Conversation", "Story", "Lines", "Dialogue")]
[Keywords("Current")]
[Serializable]
public class TypeGameObjectLastDialogueStarted : TypeGameObject
{
public override GameObject Get(Args args)
{
return Dialogue.LastStarted != null ? Dialogue.LastStarted.gameObject : null;
}
public override U Get<U>(Args args)
{
if (typeof(U) == typeof(Dialogue))
{
return Dialogue.LastStarted != null
? Dialogue.LastStarted as U
: null;
}
return base.Get<U>(args);
}
public override string ToString()
{
return "Last Dialogue Started";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}