添加对话播放速度设置,调整对话以打字机的形式显示
This commit is contained in:
@@ -15,6 +15,8 @@ namespace CustomComponent
|
||||
{
|
||||
#region Property
|
||||
|
||||
[SerializeField] private float _playingSpeed = 1.0f;
|
||||
|
||||
private const int DialogChapterDivisor = 1000;
|
||||
private const int LineChapterDivisor = 100000000;
|
||||
private const int LineDialogDivisor = 100000;
|
||||
@@ -35,6 +37,8 @@ namespace CustomComponent
|
||||
private bool _isInitialized;
|
||||
private bool _isPlaying;
|
||||
|
||||
public float PlayingSpeed => _playingSpeed;
|
||||
|
||||
public bool IsInitialized => _isInitialized;
|
||||
|
||||
public bool IsPlaying => _isPlaying;
|
||||
@@ -211,6 +215,7 @@ namespace CustomComponent
|
||||
_formContext.DialogId = dialogRow.Id;
|
||||
_formContext.DialogTitle = dialogRow.Title;
|
||||
_formContext.DialogUIMode = dialogRow.UIMode;
|
||||
_formContext.PlayingSpeed = Mathf.Max(0f, _playingSpeed);
|
||||
|
||||
_currentLineIndex = 0;
|
||||
ApplyLineToContext(dialogLines[_currentLineIndex], _currentLineIndex, dialogLines.Count);
|
||||
@@ -350,6 +355,7 @@ namespace CustomComponent
|
||||
_formContext.Direction = lineRow.Direction;
|
||||
_formContext.Text = lineRow.Text;
|
||||
_formContext.Emphasis = lineRow.Emphasis;
|
||||
_formContext.PlayingSpeed = Mathf.Max(0f, _playingSpeed);
|
||||
_formContext.LineIndex = lineIndex;
|
||||
_formContext.TotalLines = totalLines;
|
||||
_formContext.IsLastLine = lineIndex >= totalLines - 1;
|
||||
@@ -404,4 +410,4 @@ namespace CustomComponent
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user