Unity客户端架构-DialogManager

来源:互联网 发布:json格式怎么打开 mock 编辑:程序博客网 时间:2024/06/04 23:26
using UnityEngine;using System.Collections;using System;public class DialogManager : MonoBehaviour {    private Hashtable dialogs = new Hashtable();    public bool DialogExist(DialogType type)    {        return this.dialogs.ContainsKey(type);    }    public DialogInfo AddDialog(DialogType type)    {        DialogInfo dialogInfo = new DialogInfo();        dialogInfo.type = type;        this.dialogs.Add(type, dialogInfo);        return dialogInfo;    }    public void ResetDialog()    {        IDictionaryEnumerator enumerator = this.dialogs.GetEnumerator();        while (enumerator.MoveNext())        {            DialogInfo dialoginfo = enumerator.Value as DialogInfo;            dialoginfo.AsynState = AsynState.Completed;        }    }    public DialogInfo GetDialogInfo(DialogType type)    {        if (!this.DialogExist(type))        {            return this.AddDialog(type);        }        return this.dialogs[type] as DialogInfo;    }    public void RemoveDialog(DialogType type)    {        if (this.DialogExist(type))        {            this.dialogs.Remove(type);        }    }    public void ClearDialog()    {        this.dialogs.Clear();    }    public Transform GetDialog(DialogType type)    {        if (type == DialogType.None)        {            return null;        }        string str = Util.ConvertPanelName(type);        return io.Gui.transform.Find(str);    }}
0 0
原创粉丝点击