Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sdk-public
unity_sdk_demo
Commits
7606c86a
Commit
7606c86a
authored
Oct 15, 2025
by
fengchao
Browse files
fix(code):修改iOS脚本文件
parent
b14817ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Assets/Plugins/Editor/IOSPostBuildProcessor.cs
View file @
7606c86a
...
@@ -156,16 +156,13 @@ public static class IOSPostBuildProcessor
...
@@ -156,16 +156,13 @@ public static class IOSPostBuildProcessor
}
}
}
}
/// <summary>
/// 修复 PBX 工程文件中对 UnityAppController 的错误引用
/// </summary>
private
static
void
FixFileReference
(
PBXProject
proj
,
string
targetGuid
,
string
pathToBuiltProject
)
private
static
void
FixFileReference
(
PBXProject
proj
,
string
targetGuid
,
string
pathToBuiltProject
)
{
{
string
newPathH
=
"Classes/UnityAppController.h"
;
string
newPathH
=
"Classes/UnityAppController.h"
;
string
newPathMM
=
"Classes/UnityAppController.mm"
;
string
newPathMM
=
"Classes/UnityAppController.mm"
;
// 删除旧的 .h 文件引用
// 删除旧的 .h 文件引用
var
oldPathH
=
"Libraries/Plugins/
Ios
/UnityAppController.h"
;
var
oldPathH
=
"Libraries/Plugins/
iOS
/UnityAppController.h"
;
var
oldGUID_H
=
proj
.
FindFileGuidByProjectPath
(
oldPathH
);
var
oldGUID_H
=
proj
.
FindFileGuidByProjectPath
(
oldPathH
);
if
(!
string
.
IsNullOrEmpty
(
oldGUID_H
)){
if
(!
string
.
IsNullOrEmpty
(
oldGUID_H
)){
proj
.
RemoveFileFromBuild
(
targetGuid
,
oldGUID_H
);
proj
.
RemoveFileFromBuild
(
targetGuid
,
oldGUID_H
);
...
@@ -174,7 +171,7 @@ public static class IOSPostBuildProcessor
...
@@ -174,7 +171,7 @@ public static class IOSPostBuildProcessor
}
}
// 删除旧的 .mm 文件引用
// 删除旧的 .mm 文件引用
var
oldPathMM
=
"Libraries/Plugins/
Ios
/UnityAppController.mm"
;
var
oldPathMM
=
"Libraries/Plugins/
iOS
/UnityAppController.mm"
;
var
oldGUID_MM
=
proj
.
FindFileGuidByProjectPath
(
oldPathMM
);
var
oldGUID_MM
=
proj
.
FindFileGuidByProjectPath
(
oldPathMM
);
if
(!
string
.
IsNullOrEmpty
(
oldGUID_MM
)){
if
(!
string
.
IsNullOrEmpty
(
oldGUID_MM
)){
proj
.
RemoveFileFromBuild
(
targetGuid
,
oldGUID_MM
);
proj
.
RemoveFileFromBuild
(
targetGuid
,
oldGUID_MM
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment