- 完善设置面板的具体功能,全局性的设置项已经可以发挥作用了
- 调整部分项目结构和AB包设置,打包测试设置面板的功能
This commit is contained in:
@@ -4,7 +4,7 @@ namespace UI
|
||||
{
|
||||
public class DialogFormContext : UIContext
|
||||
{
|
||||
public float PlayingSpeed = 1f;
|
||||
public DialogPlayingSpeed PlayingSpeed = DialogPlayingSpeed.Medium;
|
||||
|
||||
public int ChapterId = 0;
|
||||
public int DialogId = 0;
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace UI
|
||||
private string _rightSpeakerToken = string.Empty;
|
||||
private Sequence _layoutSequence;
|
||||
private DialogWindowAlpha _currentWindowAlpha = DialogWindowAlpha.Medium;
|
||||
private float _currentPlayingSpeed = 10f;
|
||||
|
||||
public override void StartDialog(DialogFormContext context)
|
||||
{
|
||||
@@ -61,7 +62,7 @@ namespace UI
|
||||
DialogWindowAlpha.High => 0.25f,
|
||||
_ => 0.5f
|
||||
};
|
||||
|
||||
|
||||
if (_dialogBgImages.Length == 0)
|
||||
{
|
||||
//TODO:一个很奇怪的问题,在 prefab 里赋好的值实例化出来就没了,只能先这样赋值
|
||||
@@ -76,6 +77,11 @@ namespace UI
|
||||
}
|
||||
}
|
||||
|
||||
if ((int)(_context.PlayingSpeed + 1) * 5 != (int)_currentPlayingSpeed)
|
||||
{
|
||||
_currentPlayingSpeed = 5f * (int)(_context.PlayingSpeed + 1);
|
||||
}
|
||||
|
||||
string speakerName = _context.SpeakerName;
|
||||
|
||||
if (_speakerArea != null)
|
||||
@@ -88,7 +94,7 @@ namespace UI
|
||||
_speakerNameText.text = speakerName;
|
||||
}
|
||||
|
||||
PlayTypewriter(_contentText, _context.Text, _context.PlayingSpeed);
|
||||
PlayTypewriter(_contentText, _context.Text, _currentPlayingSpeed);
|
||||
|
||||
if (string.IsNullOrEmpty(speakerName))
|
||||
{
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace UI
|
||||
[SerializeField] private Image _maskImage;
|
||||
|
||||
[SerializeField] private TMP_Text _text;
|
||||
|
||||
private float _currentPlayingSpeed;
|
||||
|
||||
public override void StartDialog(DialogFormContext context)
|
||||
{
|
||||
@@ -29,7 +31,12 @@ namespace UI
|
||||
_maskImage.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
PlayTypewriter(_text, context.Text, context.PlayingSpeed);
|
||||
if ((int)_context.PlayingSpeed * 5 != (int)_currentPlayingSpeed)
|
||||
{
|
||||
_currentPlayingSpeed = 5f * (int)_context.PlayingSpeed;
|
||||
}
|
||||
|
||||
PlayTypewriter(_text, context.Text, _currentPlayingSpeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace UI
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
_fadeSequence.Kill();
|
||||
KillFadeSequence();
|
||||
_fadeSequence = DOTween.Sequence();
|
||||
_fadeSequence.Append(_bgImage.DOFade(1, _fadeDuration));
|
||||
_onSelect.Invoke();
|
||||
@@ -28,10 +28,19 @@ namespace UI
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
_fadeSequence.Kill();
|
||||
KillFadeSequence();
|
||||
|
||||
_fadeSequence = DOTween.Sequence();
|
||||
_fadeSequence.Append(_bgImage.DOFade(0, _fadeDuration));
|
||||
_onDeselect.Invoke();
|
||||
}
|
||||
|
||||
private void KillFadeSequence()
|
||||
{
|
||||
if (_fadeSequence != null && _fadeSequence.IsActive())
|
||||
{
|
||||
_fadeSequence.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,8 +46,8 @@ namespace UI
|
||||
|
||||
var setting = context.Setting;
|
||||
|
||||
_bgmVolumeSlider.value = setting.BGMVolume * 4;
|
||||
_seVolumeSlider.value = setting.SEVolume * 4;
|
||||
_bgmVolumeSlider.value = setting.BGMVolume * 5;
|
||||
_seVolumeSlider.value = setting.SEVolume * 5;
|
||||
|
||||
_allowBlinkGroup.SetValue(setting.AllowBlink);
|
||||
_allowShakeGroup.SetValue(setting.AllowShake);
|
||||
@@ -77,8 +77,8 @@ namespace UI
|
||||
{
|
||||
var setting = new GameSetting
|
||||
{
|
||||
BGMVolume = _bgmVolumeSlider.value / 4,
|
||||
SEVolume = _seVolumeSlider.value / 4,
|
||||
BGMVolume = _bgmVolumeSlider.value / 5,
|
||||
SEVolume = _seVolumeSlider.value / 5,
|
||||
|
||||
AllowShake = _allowShakeGroup.GetBoolValue(),
|
||||
AllowBlink = _allowBlinkGroup.GetBoolValue(),
|
||||
|
||||
Reference in New Issue
Block a user