예제 #1
0
        //-------∽-★-∽------∽-★-∽--------∽-★-∽窗口预制相关∽-★-∽--------∽-★-∽------∽-★-∽--------//


        //创建窗口
        protected IPop CreatePop(string popId_)
        {
            string url = CC_POP_ID.GetPrefebPath(popId_);

            if (string.IsNullOrEmpty(url))
            {
                Log.Warn("窗口未注册: " + popId_);
                return(null);
            }

            IPop pop = ClassUtil.New(popId_) as IPop;

            pop.popID = popId_;
            return(pop);
        }
예제 #2
0
        /// <summary>
        /// 获取单例, 有一定消耗, 尽量在低频调用时使用
        /// </summary>
        /// <param name="type_"></param>
        /// <returns></returns>
        static public object Get(Type type_)
        {
            if (__tp2inst.ContainsKey(type_))
            {
                return(__tp2inst[type_]);
            }

            object obj = ClassUtil.New(type_);

            if (obj != null)
            {
                __tp2inst[type_] = obj;
            }
            return(obj);
        }