指针功能完成,齿轮未接入
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using AibisDream.Framework;
|
||||
using AibisDream.Kit;
|
||||
using UnityEngine;
|
||||
@@ -14,9 +13,6 @@ namespace AibisDream
|
||||
private DialogueRunner _dialogueRunner;
|
||||
private VariableStorageBehaviour _variableStorage;
|
||||
|
||||
private readonly Dictionary<string, Action<YarnOption[]>> _commandMap = new();
|
||||
private readonly Dictionary<string, Action<YarnContinueStep>> _pauseCommandMap = new();
|
||||
|
||||
# region controller状态标识
|
||||
|
||||
private bool _isTalking;
|
||||
@@ -41,9 +37,6 @@ namespace AibisDream
|
||||
get => _isTalking;
|
||||
}
|
||||
|
||||
// 对话框被阻塞时不能继续对话框交互
|
||||
public bool IsBlock { get; private set; }
|
||||
|
||||
public bool quickRunMode;
|
||||
|
||||
# endregion
|
||||
@@ -58,11 +51,13 @@ namespace AibisDream
|
||||
|
||||
_dialogueRunner.onDialogueStart.AddListener(() =>
|
||||
{
|
||||
EnumEventSystem.Global.Send(InteractionEventEnum.End);
|
||||
OnDialogueStart?.Invoke();
|
||||
IsTalking = true;
|
||||
});
|
||||
_dialogueRunner.onDialogueComplete.AddListener(() =>
|
||||
{
|
||||
EnumEventSystem.Global.Send(InteractionEventEnum.Start);
|
||||
OnDialogueComplete?.Invoke();
|
||||
IsTalking = false;
|
||||
});
|
||||
@@ -141,123 +136,6 @@ namespace AibisDream
|
||||
}
|
||||
}
|
||||
|
||||
#region 选项指令
|
||||
|
||||
/// <summary>
|
||||
/// 调用命令
|
||||
/// </summary>
|
||||
/// <param name="commandName">命令名</param>
|
||||
/// <param name="options">选项</param>
|
||||
public void InvokeOptionCommand(string commandName, YarnOption[] options)
|
||||
{
|
||||
if (commandName == null)
|
||||
{
|
||||
Debug.Log("命令名为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_commandMap.TryGetValue(commandName, out var action))
|
||||
{
|
||||
action(options);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"命令 {commandName} 不存在");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注册命令
|
||||
/// </summary>
|
||||
/// <param name="commandName">命令名称</param>
|
||||
/// <param name="commandAction">注册名称</param>
|
||||
public void RegisterOptionCommand(string commandName, Action<YarnOption[]> commandAction)
|
||||
{
|
||||
if (_commandMap.ContainsKey(commandName))
|
||||
{
|
||||
Debug.Log($"命令 {commandName} 已经存在,将被替换");
|
||||
}
|
||||
|
||||
_commandMap[commandName] = commandAction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除命令
|
||||
/// </summary>
|
||||
/// <param name="commandName">命令名称</param>
|
||||
public void RemoveOptionCommand(string commandName)
|
||||
{
|
||||
if (_commandMap.ContainsKey(commandName))
|
||||
{
|
||||
_commandMap.Remove(commandName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"命令 {commandName} 不存在");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 暂停选项指令
|
||||
|
||||
/// <summary>
|
||||
/// 执行暂停命令
|
||||
/// </summary>
|
||||
/// <param name="commandName">命令名</param>
|
||||
/// <param name="pauseCommand">参数</param>
|
||||
public void InvokePauseCommand(string commandName, YarnContinueStep pauseCommand)
|
||||
{
|
||||
if (string.IsNullOrEmpty(commandName))
|
||||
{
|
||||
Debug.Log("命令名为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_pauseCommandMap.TryGetValue(commandName, out var action))
|
||||
{
|
||||
action(pauseCommand);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning($"命令 {commandName} 不存在");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 注册暂停命令
|
||||
/// </summary>
|
||||
/// <param name="commandName">命令名</param>
|
||||
/// <param name="commandAction">注册命令函数</param>
|
||||
public void RegisterPauseCommand(string commandName, Action<YarnContinueStep> commandAction)
|
||||
{
|
||||
if (_pauseCommandMap.ContainsKey(commandName))
|
||||
{
|
||||
Debug.Log($"命令 {commandName} 已经存在,将被替换");
|
||||
}
|
||||
|
||||
_pauseCommandMap[commandName] = commandAction;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除命令
|
||||
/// </summary>
|
||||
/// <param name="commandName">命令名称</param>
|
||||
public void RemovePauseCommand(string commandName)
|
||||
{
|
||||
if (_pauseCommandMap.ContainsKey(commandName))
|
||||
{
|
||||
_pauseCommandMap.Remove(commandName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"命令 {commandName} 不存在");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 命令名
|
||||
|
||||
[YarnCommand("NextYarn")]
|
||||
@@ -284,8 +162,6 @@ namespace AibisDream
|
||||
public static IEnumerator LoadScene(string sceneName, float duration = 1)
|
||||
{
|
||||
HideDialog();
|
||||
Camera.main.orthographicSize = 5;
|
||||
Camera.main.transform.position = new Vector3(0, 0, -10);
|
||||
yield return SceneLoader.Instance.LoadSceneAsync(sceneName);
|
||||
DialogCanvasManager.Instance.SwitchDialogView(sceneName == "ClinicScene"
|
||||
? DialogViewType.Bubble
|
||||
|
||||
Reference in New Issue
Block a user