Example #1
0
    public bool Add(string _strPrefabName, GameObject _goPrefab)
    {
        if (IsLoadedPrefab(_strPrefabName.ToLower()) == true)
        {
            return(false);
        }

        TPrefabPair addData = new TPrefabPair();

        addData.strPrefabName = _strPrefabName;
        addData.goPrefab      = _goPrefab;
        m_prefLoadedPrefabList.Add(addData);
        return(true);
    }
Example #2
0
    public void PrefabLoadInstance(string _strPrefabName, BaseLoader.onComplete _callBack)
    {
        GameObject goRet = null;

        if (getPrefab(_strPrefabName, ref goRet))
        {
            _callBack(goRet);
            return;
        }
        string assetBundlePath = SystemSetting.GetAssetBundlesBasePath() + _strPrefabName.ToLower() + ".unity3d";

        AssetBundleLoader.Instance.StartLoadRequest(assetBundlePath, _callBack, (_go) => {
            TPrefabPair addData   = new TPrefabPair();
            addData.strPrefabName = _strPrefabName;
            addData.goPrefab      = _go;
            m_prefLoadedPrefabList.Add(addData);
        });
    }