CangJie/Assets/Scripts//对话框架/ConversationController.cs
Roman 9b4623c066 任务:编写场景1逻辑
1.推进流程化
(1.新增演出框架,具体结构如图
(2.使用时仅需要重写父类Stage的虚函数,请视情况决定是否用base

2.修改视差类,使其能够自动捕获主摄像机

3.编写开场的第一个演出
(1.命名为:HuangdiAsk
(2.触发对话:黄帝提需求
(3.留下空缺:黄帝手指左方(动画目前还没有)

4.编写玩家找到正确的绳结后的的演出
(1.命名为:HuangdiConfuse
(2.触发对话:黄帝疑惑

可以摸鱼吗😿
2022-03-20 21:45:58 +08:00

48 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ConversationController : UnitySingleton<ConversationController>
{
private AConversation[] conversationList;
void Start()
{
conversationList = FindObjectsOfType<AConversation>();
}
public void OnCall(string name)
{
//找到叫name的对话并调用其OnCall()
foreach (AConversation conversation in conversationList)
{
if (conversation.conversationName == name)
{
Debug.Log("找到对话:" + name);
conversation.OnCall();
//改变玩家地图至Null
FindObjectOfType<Player>().ToMap("Null");
return;
}
}
//如果没找到,则报错
Debug.LogError("没有找到名为" + name + "的对话");
}
/// <summary>
/// 如果正在演出,是不可以还给玩家操作权限的,出此下策,记录此时是否在演出
/// </summary>
/// <returns></returns>
public bool CheckStage(){
Stage[] stageList = FindObjectsOfType<Stage>();
foreach (Stage stage in stageList)
{
if (stage.isPlaying)
{
return true;
}
}
return false;
}
}