您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

40 行
1.0 KiB

using System;
using UnityEngine;
namespace LobbyRelaySample.ngo
{
/// <summary>
/// Handles any visual tasks for running the NGO minigame's intro and outro.
/// </summary>
public class IntroOutroRunner : MonoBehaviour
{
[SerializeField] private Animator m_animator;
private Action m_onOutroComplete;
public void DoIntro()
{
m_animator.SetTrigger("DoIntro");
}
public void DoOutro(Action onOutroComplete)
{
m_onOutroComplete = onOutroComplete;
m_animator.SetTrigger("DoOutro");
}
/// <summary>
/// Called via an AnimationEvent.
/// </summary>
public void OnIntroComplete()
{
Locator.Get.Messenger.OnReceiveMessage(MessageType.InstructionsShown, null);
}
/// <summary>
/// Called via an AnimationEvent.
/// </summary>
public void OnOutroComplete()
{
m_onOutroComplete?.Invoke();
}
}
}