Initial commit
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Yarn.Unity;
|
||||
|
||||
namespace AibisDream
|
||||
{
|
||||
public class DialogController : Singleton<DialogController>
|
||||
{
|
||||
private DialogueRunner dialogueRunner;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
dialogueRunner = GetComponentInChildren<DialogueRunner>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ¿ªÆô¶Ô»°
|
||||
/// </summary>
|
||||
/// <param name="yarnProject"></param>
|
||||
public void StartDialog(YarnProject yarnProject)
|
||||
{
|
||||
dialogueRunner.SetProject(yarnProject);
|
||||
dialogueRunner.StartDialogue("Start");
|
||||
}
|
||||
|
||||
#region ¸÷ÖÖÃüÁî
|
||||
[YarnCommand("switch_tv")]
|
||||
public static void SwitchTV(string picName)
|
||||
{
|
||||
Debug.Log($"switch_tv {picName}");
|
||||
}
|
||||
|
||||
[YarnCommand("indoor")]
|
||||
public static void Indoor()
|
||||
{
|
||||
MainUIController.Instance.HideMainUI();
|
||||
}
|
||||
|
||||
[YarnCommand("character_into")]
|
||||
public static void CharacterInto(string picName)
|
||||
{
|
||||
Debug.Log($"character_into {picName}");
|
||||
}
|
||||
|
||||
[YarnCommand("character_moveto_fix")]
|
||||
public static void CharacterMoveToFix()
|
||||
{
|
||||
Debug.Log("character_moveto_fix");
|
||||
}
|
||||
|
||||
[YarnCommand("cover")]
|
||||
public static void Cover()
|
||||
{
|
||||
Debug.Log("Cover");
|
||||
}
|
||||
|
||||
[YarnCommand("load_scene")]
|
||||
public static IEnumerator LoadScene(string sceneName)
|
||||
{
|
||||
yield return SceneLoader.Instance.LoadSceneAsync(sceneName);
|
||||
}
|
||||
|
||||
[YarnCommand("init_fix")]
|
||||
public static void InitFix()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[YarnCommand("hide_dialog")]
|
||||
public static void HideDialog()
|
||||
{
|
||||
DialogUiViewer.Instance.HideDialog();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user