Exemplo n.º 1
0
        /// <summary>
        /// 由BaseView调用,执行回收操作
        /// </summary>
        /// <param name="view"></param>
        internal void RecycleViewFromBaseView(BaseView view)
        {
            var cacheData = GetCacheData(view.GetType());

            cacheData.CachedViews.Add(view);
            cacheData.ActiveViews.Remove(view);
            view.transform.SetParent(_sleepingViews);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 由BaseView调用,执行关闭操作<br/>
        /// </summary>
        /// <param name="view"></param>
        internal void CloseViewFromBaseView(BaseView view)
        {
            var cacheData = GetCacheData(view.GetType());

            if (view.IsActive)
            {
                cacheData.ActiveViews.Remove(view);
            }
            else
            {
                cacheData.CachedViews.Remove(view);
            }
            AssetBundleManager.Instance.UnloadAsset(view.gameObject);
            Destroy(view.gameObject);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 由BaseView调用,执行关闭操作
        /// </summary>
        /// <param name="view"></param>
        internal void CloseView(BaseView view)
        {
            var cacheData = GetCacheData(view.GetType());

            cacheData.ActiveViews.Remove(view);
        }