//同步加载的方法 public void LoadSystemBaseData() { if (_DataLoaded) { return; } SystemLoadingState.state = LoadingState.InitializingResource; string path = WriteablePath + ConstantTable.DataAssetBoundleFile; if (!IsFileExist(path)) { List <Object> objects = new List <Object> (); List <string> names = new List <string> (); for (int i = 0; i < dataContentNames.Length; ++i) { string name = dataContentNames [i]; name = name.Substring(0, name.LastIndexOf('.')); Object obj = Resources.Load(name); objects.Add(obj); } LoadDataObjects(objects.ToArray(), dataContentNames); _DataLoaded = true; return; } byte[] tempall = BinaryStream.GetFileBinaryData(path); AssetBundle assetBundle = AssetBundle.LoadFromMemory(tempall); if (assetBundle != null) { Object[] objs = assetBundle.LoadAllAssets(typeof(Object)); LoadDataObjects(objs); assetBundle.Unload(false); } _DataLoaded = true; }