Пример #1
0
        public static KResourceLoaderDebugger Create(string type, string url, KAbstractResourceLoader loader)
        {
            if (IsApplicationQuit)
            {
                return(null);
            }

            const string bigType = "ResourceLoaderDebuger";

            Func <string> getName = () => string.Format("{0}-{1}-{2}", type, url, loader.Desc);

            var newHelpGameObject = new GameObject(getName());

            KDebuggerObjectTool.SetParent(bigType, type, newHelpGameObject);
            var newHelp = newHelpGameObject.AddComponent <KResourceLoaderDebugger>();

            newHelp.TheLoader = loader;

            loader.SetDescEvent += (newDesc) =>
            {
                if (loader.RefCount > 0)
                {
                    newHelpGameObject.name = getName();
                }
            };


            loader.DisposeEvent += () =>
            {
                if (!IsApplicationQuit)
                {
                    KDebuggerObjectTool.RemoveFromParent(bigType, type, newHelpGameObject);
                }
            };


            return(newHelp);
        }
Пример #2
0
 private void Update()
 {
     KAbstractResourceLoader.CheckGcCollect();
 }