53 lines
1.6 KiB
C#
53 lines
1.6 KiB
C#
![]() |
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using DG.Tweening;
|
||
|
|
||
|
public class FengHuang : Stage
|
||
|
{
|
||
|
public GameObject yufu;
|
||
|
protected override IEnumerator Main()
|
||
|
{
|
||
|
//呼出CG
|
||
|
CGAdministrator.Instance.CallACG("鸟");
|
||
|
//等待CG结束
|
||
|
yield return new WaitForSeconds(CGAdministrator.Instance.GetPlayingCGTime());
|
||
|
//再等待一秒
|
||
|
yield return new WaitForSeconds(1);
|
||
|
//淡入显示叶片
|
||
|
SpriteRenderer leaf = GameObject.Find("树叶").GetComponent<SpriteRenderer>();
|
||
|
leaf.DOFade(1, 1);
|
||
|
//等待一秒
|
||
|
yield return new WaitForSeconds(1);
|
||
|
//激活渔夫
|
||
|
yufu.SetActive(true);
|
||
|
//等待一秒后淡出树叶
|
||
|
yield return new WaitForSeconds(1);
|
||
|
leaf.DOFade(0, 1);
|
||
|
//等待一秒
|
||
|
yield return new WaitForSeconds(1);
|
||
|
//触发对话“渔夫之指引”
|
||
|
ConversationController.Instance.OnCall("渔夫之指引");
|
||
|
//等到对话结束
|
||
|
yield return new WaitUntil(() => ConversationController.Instance.currentConversation.end);
|
||
|
//渐隐渔夫
|
||
|
SpriteRenderer[] renderers = yufu.GetComponentsInChildren<SpriteRenderer>();
|
||
|
foreach (SpriteRenderer renderer in renderers)
|
||
|
{
|
||
|
renderer.DOFade(0, 1);
|
||
|
}
|
||
|
//一秒后删除渔夫
|
||
|
yield return new WaitForSeconds(1);
|
||
|
Destroy(yufu);
|
||
|
//结束
|
||
|
yield return base.Main();
|
||
|
}
|
||
|
|
||
|
protected override void OnEnd()
|
||
|
{
|
||
|
base.OnEnd();
|
||
|
//删除自己和父物体
|
||
|
Destroy(transform.parent.gameObject);
|
||
|
}
|
||
|
}
|