@@ -41,6 +41,13 @@ public static class XcodePostBuild
41
41
/// </summary>
42
42
private const string TouchedMarker = "https://github.com/juicycleff/flutter-unity-view-widget" ;
43
43
44
+ // String used to detect where to inject function definitions in UnityAppController.h
45
+ #if UNITY_6000_0_OR_NEWER
46
+ private const string hDetection = "#import <UnityFramework/RenderPluginDelegate.h>" ;
47
+ #else
48
+ private const string hDetection = "include \" RenderPluginDelegate.h\" " ;
49
+ #endif
50
+
44
51
//trigger this manually from build.cs as [PostProcessBuild] or IPostprocessBuildWithReport don't always seem to trigger.
45
52
public static void PostBuild ( BuildTarget target , string pathToBuiltProject )
46
53
{
@@ -124,7 +131,7 @@ private static bool MarkUnityAppControllerH(string path)
124
131
var mark = false ;
125
132
EditCodeFile ( path , line =>
126
133
{
127
- inScope |= line . Contains ( "include \" RenderPluginDelegate.h \" " ) ;
134
+ inScope |= line . Contains ( hDetection ) ;
128
135
if ( inScope )
129
136
{
130
137
if ( line . Trim ( ) == "" )
@@ -197,7 +204,7 @@ private static void EditUnityAppControllerH(string path)
197
204
// Modify inline GetAppController
198
205
EditCodeFile ( path , line =>
199
206
{
200
- inScope |= line . Contains ( "include \" RenderPluginDelegate.h \" " ) ;
207
+ inScope |= line . Contains ( hDetection ) ;
201
208
202
209
if ( inScope && ! markerDetected )
203
210
{
@@ -230,7 +237,7 @@ private static void EditUnityAppControllerH(string path)
230
237
// Modify inline GetAppController
231
238
EditCodeFile ( path , line =>
232
239
{
233
- inScope |= line . Contains ( "include \" RenderPluginDelegate.h \" " ) ;
240
+ inScope |= line . Contains ( hDetection ) ;
234
241
235
242
if ( inScope && ! markerDetected )
236
243
{
0 commit comments