Ejemplo n.º 1
0
 void SetNowView(AView view, object data = null)
 {
     _nowViewName = view.gameObject.name;
     _nowView     = view;
     _nowView.onDestroyHandler += OnViewDestroy;
     view.SetData(data);
 }
Ejemplo n.º 2
0
        void SetNowView(AView view, object data = null)
        {
            _nowViewName = view.gameObject.name;
            _nowView     = view;
            _nowView.onDestroyHandler += OnViewDestroy;
            view.SetData(data);

            //执行一次垃圾回收
            ResMgr.Ins.DoGC();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 通过Prefab创建AView对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="prefab">Prefab对象</param>
        /// <param name="parentView">作为父对象的AView</param>
        /// <param name="parentTransform">父Transform容器</param>
        /// <param name="data">携带的参数</param>
        /// <returns></returns>
        public static T Create <T>(GameObject prefab, AView parentView, Transform parentTransform, object data = null) where T : AView
        {
            AView view = AViewMgr.CreateViewFromPrefab(prefab, parentTransform, prefab.name, typeof(T));

            parentView.AddChild(view);
            if (data != null)
            {
                view.SetData(data);
            }
            return(view as T);
        }
Ejemplo n.º 4
0
        void OnCreateView(AView view, object data, bool isBlur, bool isCloseOthers)
        {
            if (isCloseOthers)
            {
                CloseAll();
            }

            _nowWindows.Add(view);
            view.onDestroyHandler += OnViewDestroy;
            view.SetData(data);

            if (isBlur)
            {
                _needBlurViewSet.Add(view);
                UpdateBlur();
            }
        }