50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
![]() |
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using Fungus;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 演出,农民之叹
|
||
|
/// </summary>
|
||
|
public class PeasantSigh : Stage
|
||
|
{
|
||
|
[Header("农民")]
|
||
|
public Transform peasant;
|
||
|
|
||
|
private bool conversationEnd = false;
|
||
|
private bool conversationEnd1 = false;
|
||
|
|
||
|
protected override void Init(){
|
||
|
base.Init();
|
||
|
}
|
||
|
|
||
|
protected override IEnumerator Main(){
|
||
|
//停止玩家移动
|
||
|
player.inputDir = 0;
|
||
|
yield return new WaitForSeconds(1f);
|
||
|
//触发第一段农民自言自语
|
||
|
Flowchart.BroadcastFungusMessage("农民自语");
|
||
|
yield return new WaitUntil(
|
||
|
() => {
|
||
|
return conversationEnd;
|
||
|
}
|
||
|
);
|
||
|
yield return new WaitForSeconds(1f);
|
||
|
//农民转身
|
||
|
peasant.localScale = new Vector3(1,1,1);
|
||
|
yield return new WaitForSeconds(1f);
|
||
|
//触发第二段对话
|
||
|
Flowchart.BroadcastFungusMessage("农民对话");
|
||
|
yield return new WaitUntil(
|
||
|
() => {
|
||
|
return conversationEnd1;
|
||
|
}
|
||
|
);
|
||
|
//完成善后工作
|
||
|
StartCoroutine(base.Main());
|
||
|
}
|
||
|
|
||
|
public void ConversationEnd(){conversationEnd = true;}
|
||
|
public void ConversationEnd1(){conversationEnd1 = true;}
|
||
|
}
|