Ejemplo n.º 1
0
        //-------∽-★-∽------∽-★-∽--------∽-★-∽gameobject管理∽-★-∽--------∽-★-∽------∽-★-∽--------//

        public GameObject CreateGo(string url_, CALLBACK_GO onComplete_)
        {
            url_ = url_.ToLower();

            GameObject prefab = m_assetCache.GetAsset(url_) as GameObject;

            if (prefab == null)
            {
                Log.Assert("gameobject未加载:" + url_);
                return(null);
            }

            GameObject go = GameObjUtil.CreateGameObj(prefab);

            GameObjUtil.DontDestroyOnLoad(go);  //所有加载出来的go都是默认不销毁

            AddGo(url_, go);

            if (onComplete_ != null)
            {
                onComplete_(go);
            }

            return(go);
        }