using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Linq; using UnityEngine.Events; public class GameLoaderX : MonoBehaviour { public static GameLoaderX Instance; private void Awake() { Instance = this; } #region 预加载碰撞点及展示点 public Transform tranMainScene; private void Start() { Invoke("LoadSpots", 0.5f); } void LoadSpots() { LoadGame("Spots", "Spots", OnBundleLoaded); LoadGame("TipPoints", "TipPoints", OnBundleLoaded); } void OnBundleLoaded() { BundleLoader.CurrentBundleObject.transform.parent = tranMainScene; } #endregion public void LoadGame(string gameName, string bundleName=null, UnityAction BundleLoaded = null) { if(bundleName == null) { bundleName = gameName; } BundleLoader.Instance.LoadBundle( CommonData.DataServer + "/Bundles/" + bundleName + ".assetbundle", gameName, BundleLoaded); } }