首次提交
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
// using UnityEditor;
|
||||
// using UnityEditor.Callbacks;
|
||||
// using UnityEditor.iOS.Xcode;
|
||||
// using System.IO;
|
||||
// using UnityEditor.Build;
|
||||
// using UnityEngine;
|
||||
|
||||
// public class PostProcessBuild : IPostprocessBuildWithReport
|
||||
// {
|
||||
// public int callbackOrder => 1;
|
||||
|
||||
// public void OnPostprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
|
||||
// {
|
||||
// // 检查是否为 iOS 平台构建
|
||||
// if (report.summary.platform == BuildTarget.iOS)
|
||||
// {
|
||||
|
||||
// string projectPath = report.summary.outputPath;
|
||||
// string customControllerPath = "Assets/Editor/UnityAppController.mm"; // 自定义文件的路径
|
||||
// string destinationPath = Path.Combine(projectPath, "Classes/UnityAppController.mm");
|
||||
|
||||
// if (File.Exists(customControllerPath))
|
||||
// {
|
||||
// // 复制文件到 Xcode 项目中
|
||||
// File.Copy(customControllerPath, destinationPath, overwrite: true);
|
||||
// Debug.Log("Custom UnityAppController.mm has been copied to Xcode project.");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Debug.LogError("Custom UnityAppController.mm file not found at " + customControllerPath);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// // 这是一个 PostProcessBuild 脚本,在 Unity 构建完成后自动执行
|
||||
// [PostProcessBuild]
|
||||
// public static void OnPostprocessBuild(BuildTarget buildTarget, string pathToBuiltProject)
|
||||
// {
|
||||
// // 仅对 iOS 构建进行处理
|
||||
// if (buildTarget == BuildTarget.iOS)
|
||||
// {
|
||||
// AddImagesToXcodeProject(pathToBuiltProject);
|
||||
// }
|
||||
// }
|
||||
|
||||
// // 将 PNG 文件添加到 Xcode 项目中的 Images.xcassets
|
||||
// private static void AddImagesToXcodeProject(string xcodeProjectPath)
|
||||
// {
|
||||
// string sourceImageFolder = "Assets/Plugins/iOS/"; // 你要打包的 PNG 文件所在文件夹
|
||||
// string destinationAssetsFolder = Path.Combine(xcodeProjectPath, "Images.xcassets");
|
||||
|
||||
// if (!Directory.Exists(sourceImageFolder))
|
||||
// {
|
||||
// Debug.LogError("Image folder does not exist: " + sourceImageFolder);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // 确保 Images.xcassets 文件夹存在
|
||||
// if (!Directory.Exists(destinationAssetsFolder))
|
||||
// {
|
||||
// Directory.CreateDirectory(destinationAssetsFolder);
|
||||
// }
|
||||
|
||||
// // 遍历 Plugins/iOS 文件夹中的所有 PNG 文件
|
||||
// string[] pngFiles = Directory.GetFiles(sourceImageFolder, "*.png");
|
||||
|
||||
// foreach (var file in pngFiles)
|
||||
// {
|
||||
// // 获取文件名
|
||||
// string fileName = Path.GetFileName(file);
|
||||
|
||||
// // 确保文件被添加到 xcassets 中
|
||||
// string destinationFilePath = Path.Combine(destinationAssetsFolder, fileName);
|
||||
|
||||
// // 将文件复制到 xcassets 目录
|
||||
// if (!File.Exists(destinationFilePath))
|
||||
// {
|
||||
// File.Copy(file, destinationFilePath);
|
||||
// Debug.Log("Added " + fileName + " to " + destinationAssetsFolder);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Debug.LogWarning(fileName + " already exists in the destination.");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6c63f69f4234bbc4dba0591f050d264f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d94ea3741ad8d344a76cca0aa62f67e
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0863bf92b4fcc45b0b9267325249bf0f, type: 3}
|
||||
m_Name: NotificationSettings
|
||||
m_EditorClassIdentifier:
|
||||
toolbarInt: 0
|
||||
iOSNotificationEditorSettingsValues:
|
||||
keys:
|
||||
- UnityNotificationRequestAuthorizationOnAppLaunch
|
||||
- UnityNotificationDefaultAuthorizationOptions
|
||||
- UnityAddRemoteNotificationCapability
|
||||
- UnityNotificationRequestAuthorizationForRemoteNotificationsOnAppLaunch
|
||||
- UnityRemoteNotificationForegroundPresentationOptions
|
||||
- UnityUseAPSReleaseEnvironment
|
||||
- UnityUseLocationNotificationTrigger
|
||||
values:
|
||||
- True
|
||||
- 7
|
||||
- False
|
||||
- False
|
||||
- -1
|
||||
- False
|
||||
- False
|
||||
AndroidNotificationEditorSettingsValues:
|
||||
keys:
|
||||
- UnityNotificationAndroidRescheduleOnDeviceRestart
|
||||
- UnityNotificationAndroidUseCustomActivity
|
||||
- UnityNotificationAndroidCustomActivityString
|
||||
values:
|
||||
- False
|
||||
- False
|
||||
- com.unity3d.player.UnityPlayerActivity
|
||||
TrackedResourceAssets: []
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4cee8bca36f2ab74b8feb832747fa6f4
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user