Skip to content

Commit e566875

Browse files
authored
Merge pull request #326 from mrdavidrees/patch-1
Update README.md
2 parents e80c1fb + 06cf88d commit e566875

File tree

1 file changed

+37
-32
lines changed

1 file changed

+37
-32
lines changed

README.md

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -119,45 +119,45 @@ project(":unityLibrary").projectDir = file("./unityLibrary")
119119
```
120120
3. open ```<Your Flutter Project>/android/app/build.gradle```file and add:
121121
```gradle
122-
dependencies {
123-
implementation project(':unityLibrary')
124-
}
122+
dependencies {
123+
implementation project(':unityLibrary')
124+
}
125125
```
126126
4. To build a release package, you need to add signconfig in `UnityExport/build.gradle`. The code below use the `debug` signConfig for all buildTypes, which can be changed as you well if you need specify signConfig.
127127
```
128-
buildTypes {
129-
release {
130-
signingConfig signingConfigs.debug
131-
}
132-
debug {
133-
signingConfig signingConfigs.debug
134-
}
135-
profile{
136-
signingConfig signingConfigs.debug
137-
}
138-
innerTest {
139-
//...
140-
matchingFallbacks = ['debug', 'release']
141-
}
128+
buildTypes {
129+
release {
130+
signingConfig signingConfigs.debug
131+
}
132+
debug {
133+
signingConfig signingConfigs.debug
134+
}
135+
profile{
136+
signingConfig signingConfigs.debug
137+
}
138+
innerTest {
139+
//...
140+
matchingFallbacks = ['debug', 'release']
142141
}
142+
}
143143
```
144144
4. If you use `minifyEnabled true` and need to use UnityMessage in Flutter, please add proguard content below:
145145
```
146146
-keep class com.xraph.plugins.** {*;}
147147
```
148148
5. If you want unity in it's own activity as an alternative, just add this to your app `AndroidManifest.xml` file
149149
```xml
150-
<activity
151-
android:name="com.xraph.plugin.flutter_unity_widget.OverrideUnityActivity"
152-
android:theme="@style/UnityThemeSelector"
153-
android:screenOrientation="fullSensor"
154-
android:launchMode="singleTask"
155-
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density"
156-
android:hardwareAccelerated="false"
157-
android:process=":Unity"
158-
>
159-
<meta-data android:name="com.xraph.plugin.flutter_unity_widget.OverrideUnityActivity" android:value="true" />
160-
</activity>
150+
<activity
151+
android:name="com.xraph.plugin.flutter_unity_widget.OverrideUnityActivity"
152+
android:theme="@style/UnityThemeSelector"
153+
android:screenOrientation="fullSensor"
154+
android:launchMode="singleTask"
155+
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density"
156+
android:hardwareAccelerated="false"
157+
android:process=":Unity"
158+
>
159+
<meta-data android:name="com.xraph.plugin.flutter_unity_widget.OverrideUnityActivity" android:value="true" />
160+
</activity>
161161
```
162162

163163
**iOS Platform Only**
@@ -166,17 +166,22 @@ project(":unityLibrary").projectDir = file("./unityLibrary")
166166
<img src="files/workspace.png" width="400" />
167167
2. Select the Unity-iPhone/Data folder and change the Target Membership for Data folder to UnityFramework (Optional)
168168
<img src="files/change_target_membership_data_folder.png" width="400" />
169-
3. Add to Runner/Runner/AppDelegate.swift before the GeneratedPluginRegistrant call:
169+
3. Import flutter unity widget at the top of Runner/Runner/AppDelegate.swift
170+
171+
```swift
172+
import flutter_unity_widget
173+
```
174+
4. Add to Runner/Runner/AppDelegate.swift before the GeneratedPluginRegistrant call:
170175

171176
```swift
172-
InitUnityIntegrationWithOptions(argc: CommandLine.argc, argv: CommandLine.unsafeArgv, launchOptions)
177+
InitUnityIntegrationWithOptions(argc: CommandLine.argc, argv: CommandLine.unsafeArgv, launchOptions)
173178
```
174179
For example
175180

176181
```swift
177182
import UIKit
178183
import Flutter
179-
import fluuter_unity_widget
184+
import flutter_unity_widget
180185

181186
@UIApplicationMain
182187
@objc class AppDelegate: FlutterAppDelegate {
@@ -186,7 +191,7 @@ import fluuter_unity_widget
186191
) -> Bool {
187192

188193
// Initialize Unity
189-
InitUnityIntegrationWithOptions(argc: CommandLine.argc, argv: CommandLine.unsafeArgv, launchOptions)
194+
InitUnityIntegrationWithOptions(argc: CommandLine.argc, argv: CommandLine.unsafeArgv, launchOptions)
190195

191196
GeneratedPluginRegistrant.register(with: self)
192197
return super.application(application, didFinishLaunchingWithOptions: launchOptions)

0 commit comments

Comments
 (0)