fix(day2sleep): 修复风筝坠落与文本表现不一致
This commit is contained in:
@@ -94,6 +94,11 @@ namespace AibisDream
|
||||
_kite.PlayAccent(profile);
|
||||
}
|
||||
|
||||
public IEnumerator FallKiteOutOfFrame(float duration = 1.1f)
|
||||
{
|
||||
yield return _kite.FallOutOfFrame(duration);
|
||||
}
|
||||
|
||||
public IEnumerator HideKite(float duration = 1f)
|
||||
{
|
||||
yield return _kite.Hide(duration);
|
||||
|
||||
@@ -75,6 +75,14 @@ namespace AibisDream
|
||||
yield return new WaitForSeconds(leadDuration);
|
||||
}
|
||||
|
||||
[YarnCommand("kite_fall_out")]
|
||||
public static IEnumerator KiteFallOut(float duration = 1.1f)
|
||||
{
|
||||
var controller = Resolve();
|
||||
if (controller == null) yield break;
|
||||
yield return controller.FallKiteOutOfFrame(duration);
|
||||
}
|
||||
|
||||
[YarnCommand("kite_hide")]
|
||||
public static IEnumerator KiteHide(float duration = 1f)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,17 @@ namespace AibisDream
|
||||
height = Mathf.Clamp(height, 0f, KiteMaxHeight);
|
||||
if (IsShowing)
|
||||
{
|
||||
SetState(height, wind, duration);
|
||||
if (_driver.IsRunning)
|
||||
{
|
||||
SetState(height, wind, duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
_kiteRenderer.transform.localPosition = Vector3.zero;
|
||||
_kiteRenderer.transform.localRotation = Quaternion.identity;
|
||||
_kiteRenderer.SetAlpha(KiteRigDriver.Alpha(height));
|
||||
_driver.Wake(height, wind);
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
|
||||
@@ -210,6 +220,36 @@ namespace AibisDream
|
||||
_accentSequence = sequence;
|
||||
}
|
||||
|
||||
public IEnumerator FallOutOfFrame(float duration = 1.1f)
|
||||
{
|
||||
if (!IsShowing || _kiteRenderer == null || _driver == null) yield break;
|
||||
|
||||
_accentSequence?.Kill();
|
||||
_accentSequence = null;
|
||||
_driver.ResetAndSleep();
|
||||
|
||||
var transform = _kiteRenderer.transform;
|
||||
float frameHeight = _baseRenderer != null && _baseRenderer.sprite != null
|
||||
? _baseRenderer.sprite.bounds.size.y
|
||||
: 6f;
|
||||
float fallDistance = Mathf.Max(frameHeight * 1.1f, 3f);
|
||||
Vector3 target = transform.localPosition + Vector3.down * fallDistance;
|
||||
float fallDuration = Mathf.Max(0.05f, duration);
|
||||
|
||||
var sequence = DOTween.Sequence();
|
||||
sequence.Append(transform.DOLocalMove(target, fallDuration)
|
||||
.SetEase(Ease.InQuad));
|
||||
sequence.Join(transform.DOLocalRotate(new Vector3(-4f, 2f, 8f), fallDuration)
|
||||
.SetEase(Ease.InSine));
|
||||
_accentSequence = sequence;
|
||||
|
||||
yield return sequence.WaitForCompletion();
|
||||
if (_accentSequence != sequence) yield break;
|
||||
|
||||
_kiteRenderer.SetAlpha(0f);
|
||||
_accentSequence = null;
|
||||
}
|
||||
|
||||
public IEnumerator Hide(float duration = 1f)
|
||||
{
|
||||
ClearImmediate();
|
||||
|
||||
@@ -757,7 +757,6 @@ position: 3,280
|
||||
<<kite_accent taut>>
|
||||
风筝线绷得笔直,像是要断掉。 #line:01334ad
|
||||
<<elseif $wind==0>>
|
||||
<<set $h = $h + 1>>
|
||||
<<set $fzAccend = true>>
|
||||
<<kite_state {$h} {$wind}>>
|
||||
风筝在风中轻轻摇晃。 #line:03c1cb3
|
||||
@@ -774,9 +773,7 @@ position: 3,280
|
||||
<<if $h>0>>
|
||||
<<jump 风筝2>>
|
||||
<<elseif $t<10>>
|
||||
<<kite_state 0 -1 1>>
|
||||
<<kite_accent drop>>
|
||||
<<wait 0.8>>
|
||||
<<kite_fall_out 1.1>>
|
||||
风筝掉到了地上。女孩捡起风筝,拍掉上面的尘土。 #line:0079d8f
|
||||
差一点就飞起来了!可惜。 #line:0b780bf
|
||||
<<jump 广场>>
|
||||
|
||||
Reference in New Issue
Block a user