Unity客户端架构-io

using UnityEngine;
using System.Collections;

//管理调用Manager
public class io : MonoBehaviour {

    private static GameObject _manager;
    private static GameManager _gameManager;
    private static PanelManager _panelManager;
    private static DialogManager _dialogManager;
    private static MusicManager _musicManager;


    private static UIContainer _container;

    public static GameObject manager
    {
        get
        {
            if (io._manager == null)
            {
                io._manager = GameObject.FindWithTag("GameManager");
            }

            return io._manager;
        }
    }

    public static GameManager gameManager
    {
        get
        {
            if (io._gameManager == null)
            {
                io._gameManager = io.manager.GetComponent<GameManager>();
            }

            return io._gameManager;
        }

    }

    public static PanelManager panelManager
    {
        get
        {
            if (io._panelManager == null)
            {
                io._panelManager = io.manager.GetComponent<PanelManager>();
            }

            return io._panelManager;
        }
    }

    public static DialogManager dialogManager
    {
        get
        {
            if (io._dialogManager == null)
            {
                io._dialogManager = io.manager.GetComponent<DialogManager>();
            }
            return io._dialogManager;
        }
    }

    public static GameObject Gui
    {
        get
        {
            return GameObject.FindWithTag("GUI");
        }
    }

    public static UIContainer container
    {
        get
        {
            if (io._container == null)
            {
                io._container = io.Gui.GetComponent<UIContainer>();
            }
            return io._container;
        }
    }
}
发布了181 篇原创文章 · 获赞 129 · 访问量 78万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 精致技术 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览