using System.Collections; using System.Collections.Generic; using UnityEngine; public class ConversationController : UnitySingleton { private AConversation[] conversationList; void Start() { conversationList = FindObjectsOfType(); } public void OnCall(string name) { //找到叫name的对话,并调用其OnCall() foreach (AConversation conversation in conversationList) { if (conversation.conversationName == name) { conversation.OnCall(); //改变玩家地图至Null FindObjectOfType().ToMap("Null"); return; } } //如果没找到,则报错 Debug.LogError("没有找到名为" + name + "的对话"); } }