Merge branch 'feature/delay-talk' into 'develop'
出字速度和跳过延时 See merge request aibis-dream/aibis-dream!46
This commit is contained in:
@@ -1285,7 +1285,7 @@ MonoBehaviour:
|
||||
onMessage:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
waitForNormalChars: 0.1
|
||||
waitForNormalChars: 0.05
|
||||
waitLong: 0.6
|
||||
waitMiddle: 0.2
|
||||
avoidMultiplePunctuactionWait: 0
|
||||
|
||||
@@ -4,7 +4,6 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Yarn.Unity;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AibisDream
|
||||
{
|
||||
@@ -33,6 +32,8 @@ namespace AibisDream
|
||||
|
||||
#endregion
|
||||
|
||||
private bool _skipLineDelay;
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
@@ -154,6 +155,9 @@ namespace AibisDream
|
||||
|
||||
public bool TrySkipLine()
|
||||
{
|
||||
// 开始后0.5秒不给跳过
|
||||
if (_skipLineDelay) return true;
|
||||
|
||||
if (dialogText.isShowingText)
|
||||
{
|
||||
dialogText.SkipTypewriter();
|
||||
@@ -179,6 +183,12 @@ namespace AibisDream
|
||||
quickTalkButton = box.transform.Find(QUICK_TALK).gameObject;
|
||||
|
||||
quickTalkButton.GetComponent<Button>().onClick.AddListener(SwitchQuickTalkMode);
|
||||
|
||||
dialogText.onTypewriterStart.AddListener(() =>
|
||||
{
|
||||
_skipLineDelay = true;
|
||||
CommonUtil.Delay(300, () => { _skipLineDelay = false; });
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,35 +4,27 @@ namespace AibisDream
|
||||
{
|
||||
public class Singleton<T> : MonoBehaviour where T : Singleton<T>
|
||||
{
|
||||
private static T instance;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get { return instance; }
|
||||
}
|
||||
public static T Instance { get; private set; }
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
if (instance != null)
|
||||
if (Instance != null)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
instance = (T)this;
|
||||
Instance = (T)this;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsInitialized
|
||||
{
|
||||
get { return instance != null; }
|
||||
}
|
||||
public static bool IsInitialized => Instance != null;
|
||||
|
||||
protected virtual void OnDestroy()
|
||||
{
|
||||
if (instance == this)
|
||||
if (Instance == this)
|
||||
{
|
||||
instance = null;
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user