• 1


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using UnityEngine;

    namespace Game.UI
    {
        public class UIItemWidget : MonoBehaviour
        {
            ResourceSet mResources;
            bool mHasDestroy = false;
            public bool hasDestroy { get { return mHasDestroy; } }

            public virtual ResourceSet resources
            {
                get
                {
                    if (mResources == null)
                    {
                        mResources = new ResourceSet();
                    }
                    return mResources;
                }
            }

            //public bool hasDestroy { get { return resources.hasDestroy; } }

            //protected virtual void Awake()
            //{
            //}
            protected virtual void OnDestroy()
            {
                if(mResources!=null)
                    mResources.Destroy();
                mHasDestroy = true;
                //Debug.Log(ToString() + ".OnDestroy()");
            }
            public virtual void Destroy()
            {
                if (mResources != null)
                    mResources.Destroy();
                mHasDestroy = true;
            }
            public void ClearInstanceAndResource()
            {
                if (mResources != null)
                    mResources.ClearAllInstanceAndResource();
            }

            //protected void _RegResource( string _path , BaseLoadInfo resObj)
            //{
            //    resources._RegResource(_path ,resObj);
            //}

            //protected void _RegInstance(UnityEngine.Object instObj)
            //{
            //    resources._RegInstance(instObj);
            //}

            public void DeleteResource(ResourceSet.ResourceInfo resObj)
            {
                resources.DeleteResource(resObj);
            }

            public bool DeleteInstance(UnityEngine.Object instObj, bool immedia = false)
            {
                return resources.DeleteInstance(instObj,immedia);
            }

            /// <summary>
            /// 添加一个界面图集
            /// </summary>
            /// <param name="atlas">图集名</param>
            /// <param name="img">图素名</param>
            /// <param name="obj">控件对象</param>

            public ResourceSet.ResourceInfo AddResourceEx(string res)
            {
                return resources.AddResourceEx(res);
            }
            public UnityEngine.Object AddResource(string res)
            {
                return resources.AddResource(res);
            }
            public void AddResourceAsync(string res, ResourceSet.OnLoadResEnd onLoadEnd)
            {
                resources.AddResourceAsync(res, onLoadEnd);
            }
            public UnityEngine.Object AddInstance(string widgetName)
            {
                return resources.AddInstance(widgetName);
            }
            public BaseLoadInfo AddInstanceAsync(string widgetName, ResourceSet.OnObjectLoadEnd onLoadEnd)
            {
                return resources.AddInstanceAsync(widgetName, onLoadEnd);
            }
            public GameObject CreateGameObject(string name, Transform parent)
            {
                return resources.AddGameInstanceAsSubObject(name, parent);
            }
            public GameObject AddGameInstance(string name, Transform parent)
            {
                return resources.AddGameInstanceAsSubObject(name, parent);
            }
            public BaseLoadInfo AddGameInstanceAsync(string name, Transform parent, ResourceSet.OnGameObjectLoadEnd onLoadEnd)
            {
                return resources.AddGameInstanceAsSubObjectAsync(name, parent, onLoadEnd);
            }

            public void DestroyTrans(Transform tran,bool immedia=false)
            {
                if (null == tran)
                {
                    return;
                }
                for (int i = tran.childCount - 1; i >= 0; i--)
                {
                    DeleteInstance(tran.GetChild(i).gameObject,immedia);
                }
            }
        }
    }

  • 相关阅读:
    HL极大算子弱(1,1)范数趋于无穷, 当维数趋于无穷
    Stein's Maximal principle
    课程: 广义相对论和波方程
    关于球乘子和BochnerRiesz乘子的相关文献
    The Hardy Uncertainty Principle
    Mar. 22 10:0011:30, 1569, "Global wellposedness for the nonlinear Schrodinger equation with derivative in energy space" by Yifei Wu
    Several questions regarding construction of functions
    通知: 强化班<调和分析与PDE>3月26日的课程 改到3月21 晚上6:009:00 地点不变
    ADO.NET Entity Framework 入门示例向导
    JavaScript 定义类方法
  • 原文地址:https://www.cnblogs.com/rexzhao/p/7278953.html
Copyright © 2020-2023  润新知