public static AssetBundleManagar initForGameObject(GameObject dontDestroyOnLoadGameObject) { if (instance == null) { instance = dontDestroyOnLoadGameObject.AddComponent <AssetBundleManagar>(); } return(instance); }
public static AssetBundleManagar getInstance() { if (instance == null) { GameObject gameObject = new GameObject("AssetBundleManagar"); DontDestroyOnLoad(gameObject); instance = gameObject.AddComponent <AssetBundleManagar>(); } return(instance); }
override public void LoadAssetBundle() { if (assetBundlePath != null && !assetBundlePath.Equals("")) { AssetBundleManagar.getInstance().Load(assetBundlePath, OnLoadAssetBundle); } else { Debug.LogErrorFormat("LoadAssetBundle() 参数错误!{0}", this.ToString()); } }