updateUnity method

  1. @override
Future updateUnity(
  1. UnityEnvironment unityEnvironment
)
override

Implementation

@override
Future updateUnity(UnityEnvironment unityEnvironment) async {
  final updateUnity = UpdateUnity(
    workspace: unityEnvironment.iosUnityFullPath,
    unityEnginePath: unityEnvironment.unityEnginePath,
    platform: UnityPlatform.ios,
  );
  final result = await updateUnity.update();
  if (!result) {
    logger.log('导出iOS Unity最新的包失败!', status: LogStatus.error);
    exit(2);
  }
  logger.log('导出iOS Unity最新的包成功!', status: LogStatus.success);

  final fix = FixIosUnityCache(
    root: unityEnvironment.unityWorkspace,
    iosUnityPath: unityEnvironment.iosUnityFullPath,
  );
  final fixResult = await fix.fix();
  if (!fixResult) {
    logger.log('修复iOS失败!', status: LogStatus.error);
    exit(2);
  }
  logger.log('修复iOS成功!', status: LogStatus.success);
}