fade问题修改
This commit is contained in:
@@ -64,7 +64,7 @@ namespace AibisDream.Test
|
||||
public void OnDestroy()
|
||||
{
|
||||
// 注意在合适的时机移除命令
|
||||
DialogController.Instance.RemoveOptionCommand("show_buttons");
|
||||
DialogController.Instance?.RemoveOptionCommand("show_buttons");
|
||||
}
|
||||
|
||||
[YarnCommand("change_button_name")]
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace AibisDream
|
||||
public void ShowLine(string dialogLine, string actor, Action nextStep)
|
||||
{
|
||||
dialogBox.SetActive(true);
|
||||
dialogText.ShowText("");
|
||||
dialogText.gameObject.SetActive(true);
|
||||
choiceBox.SetActive(false);
|
||||
|
||||
@@ -89,6 +90,7 @@ namespace AibisDream
|
||||
public void ShowAutoLine(string dialogLine, string actor, Action nextStep)
|
||||
{
|
||||
dialogBox.SetActive(true);
|
||||
dialogText.ShowText("");
|
||||
dialogText.gameObject.SetActive(true);
|
||||
choiceBox.SetActive(false);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace AibisDream
|
||||
|
||||
public IEnumerator FadeInSync(float duration)
|
||||
{
|
||||
yield return _blackImage.FadeInSync(duration);
|
||||
return _blackImage.FadeInSync(duration);
|
||||
}
|
||||
|
||||
public void FadeOut(float duration)
|
||||
@@ -42,7 +42,7 @@ namespace AibisDream
|
||||
|
||||
public IEnumerator FadeOutSync(float duration)
|
||||
{
|
||||
yield return _blackImage.FadeOutSync(duration);
|
||||
return _blackImage.FadeOutSync(duration);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -58,7 +58,7 @@ namespace AibisDream
|
||||
public IEnumerator TVFadeInSync(float duration)
|
||||
{
|
||||
_news.FadeIn(duration);
|
||||
yield return _tvScene.FadeInSync(duration);
|
||||
return _tvScene.FadeInSync(duration);
|
||||
}
|
||||
|
||||
public void TVFadeOut(float duration)
|
||||
@@ -70,7 +70,7 @@ namespace AibisDream
|
||||
public IEnumerator TVFadeOutSync(float duration)
|
||||
{
|
||||
_news.FadeOut(duration);
|
||||
yield return _tvScene.FadeOutSync(duration);
|
||||
return _tvScene.FadeOutSync(duration);
|
||||
}
|
||||
|
||||
public void SwitchTV(string newsName)
|
||||
|
||||
@@ -47,7 +47,10 @@ namespace AibisDream
|
||||
{
|
||||
_image.gameObject.SetActive(true);
|
||||
var tweener = _image.DOBlendableColor(Color.white, duration);
|
||||
yield return tweener;
|
||||
while (tweener.active && !tweener.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -67,11 +70,10 @@ namespace AibisDream
|
||||
{
|
||||
_image.gameObject.SetActive(true);
|
||||
var tweener = _image.DOBlendableColor(Color.clear, duration);
|
||||
if (!tweener.IsComplete())
|
||||
while (tweener.active && !tweener.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
// yield return tweener;
|
||||
_image.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace AibisDream
|
||||
{
|
||||
_spriteRenderer.gameObject.SetActive(true);
|
||||
var tweener = _spriteRenderer.DOFade(1, duration);
|
||||
if (!tweener.IsComplete())
|
||||
while (tweener.active && !tweener.IsComplete())
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
@@ -39,16 +39,12 @@ namespace AibisDream
|
||||
public IEnumerator FadeOutSync(float duration)
|
||||
{
|
||||
var tweener = _spriteRenderer.DOFade(0, duration);
|
||||
if (!tweener.IsComplete())
|
||||
while (tweener.active && !tweener.IsComplete())
|
||||
{
|
||||
|
||||
yield return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
_spriteRenderer.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
|
||||
_spriteRenderer.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
public void Show()
|
||||
@@ -62,10 +58,10 @@ namespace AibisDream
|
||||
_spriteRenderer.color = Color.clear;
|
||||
_spriteRenderer.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
|
||||
public void SwitchImage(string imagePath)
|
||||
{
|
||||
_spriteRenderer.sprite = Resources.Load<Sprite>("Art/Character/"+imagePath);
|
||||
_spriteRenderer.sprite = Resources.Load<Sprite>("Art/Character/" + imagePath);
|
||||
}
|
||||
|
||||
public IEnumerator MoveTo(Vector3 targetPos, float duration)
|
||||
|
||||
Reference in New Issue
Block a user