41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using TMPro;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.Story.UI
|
|
{
|
|
/// <summary>
|
|
/// 教程块视图。点击后由 <see cref="TutorialFlowController"/> 显示确认窗口,
|
|
/// 玩家选择游玩或跳过时都会写入教程剧情变量并刷新故事树。
|
|
/// </summary>
|
|
public class TutorialBlockView : StoryBlockView
|
|
{
|
|
[Header("Tutorial Block")]
|
|
public TMP_Text tutorialNameText;
|
|
|
|
public override void Initialize(StoryBlockDefinition def, Vector2 position, StoryBlockState blockState)
|
|
{
|
|
base.Initialize(def, position, blockState);
|
|
|
|
if (tutorialNameText != null)
|
|
tutorialNameText.text = def.tutorialName;
|
|
}
|
|
|
|
protected override void OnClicked()
|
|
{
|
|
TutorialFlowController.RequestTutorial(definition);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 已处理的教程不再重复弹出“游玩 / 跳过”确认窗口。
|
|
/// 教程重玩将来应由独立的教程入口提供,不复用剧情进度节点。
|
|
/// </summary>
|
|
public override void ApplyState(StoryBlockState newState)
|
|
{
|
|
base.ApplyState(newState);
|
|
|
|
if (button != null && newState == StoryBlockState.Completed)
|
|
button.interactable = false;
|
|
}
|
|
}
|
|
}
|