public static void CreatePack() { if (NoPackAssetinstance == null) { FSaveHandle sd = FSaveHandle.Create(Application.dataPath + "/" + ResConfig.NOPACKPATH, FFilePath.FP_Abs, FOpenType.OT_Binary); if (sd.IsLoad) { NoPackAssetinstance = new NoPackAsset(); sd.FromObject(NoPackAssetinstance); } } }
public static void CreateNoPackAsset(List <NoPackAsset.PackData> pack) { #if UNITY_EDITOR NoPackAsset packAsset = new NoPackAsset(pack); string path = Application.dataPath + "/" + ResConfig.NOPACKPATH; string pathDir = FEPath.GetDirectoryName(path); //如果解压到的目录不存在,则报错 FEPath.CreateDirectory(pathDir); FSaveHandle sd = FSaveHandle.Create(path, FFilePath.FP_Abs, FOpenType.OT_Write | FOpenType.OT_Binary); sd.PushObject(packAsset); sd.Save(); #endif }