Exemple #1
0
        private void Awake()
        {
            Instance       = this;
            _uiManager     = gameObject.AddComponent <UIManager>();
            _effectManager = gameObject.AddComponent <UIEffectManager>();
            _layerManager  = gameObject.AddComponent <UILayerManager>();
            _inputManager  = gameObject.AddComponent <InputManager>();
            _btnManager    = gameObject.AddComponent <BtnStateManager>();
            _audioManager  = gameObject.AddComponent <UIAudioManager>();

            _uiManager.AddGetLayerObjectListener(_layerManager.GetLayerObject);
            _uiManager.AddInitCallBackListener((uiTrans) =>
            {
                var list = _uiManager.GetDefaultBtnTrans(uiTrans);
                _btnManager.InitBtnParent(list);
            });
            _audioManager.Init(Path.UI_AUDIO_PATH, LoadManager.Single.LoadAll <AudioClip>);
            _audioManager.PlayBg(UIAudioName.UI_bg.ToString());
        }
Exemple #2
0
        private void Awake()
        {
            Instance = this;

            _audioManager    = gameObject.AddComponent <UIAudioManager>();
            _uiManager       = gameObject.AddComponent <UIManager>();
            _layManager      = gameObject.AddComponent <UILayerManager>();
            _btnStateManager = gameObject.AddComponent <BtnStateManager>();
            _inputManager    = gameObject.AddComponent <InputManager>();

            _uiManager.AddGetLayerObjectListener(_layManager.GetLayerObject);
            _uiManager.AddInitCallBackListener((uiTrans) => {
                var parents = _uiManager.GetBtnParents(uiTrans);
                _btnStateManager.InitBtnParent(parents);
            });

            //实例化effectManager,在显示UI的时候,显示对应的effect;隐藏UI的时候隐藏对应的effect.
            _effectManager = gameObject.AddComponent <UIEffectManager>();

            _audioManager.Init(Path.UI_AUDIO_PATH, LoadManager.Single.LoadAll <AudioClip>);
            _audioManager.PlayBg(UIAudioName.UI_bg.ToString());
        }