-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from teogor/docs/usage-guide-and-compatibility
Update Documentation: Plugin Usage Guide and Unity Compatibility
- Loading branch information
Showing
4 changed files
with
239 additions
and
124 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
# Usage Guide for Plugin (Unity Integration Plugin) | ||
|
||
## Overview | ||
|
||
The Unity Integration Plugin simplifies the process of integrating Unity projects into your Gradle-based project. It provides two essential tasks: `BuildIl2CppTask` and `UnityAssetSyncTask`. This guide explains how to use these tasks effectively. | ||
|
||
## Prerequisites | ||
|
||
Before using the Unity Integration Plugin, ensure the following: | ||
|
||
- You have a Gradle-based Android project. | ||
- Unity projects to be integrated have been properly exported. | ||
|
||
## Installation | ||
|
||
To get started, add the Unity Integration Plugin to your `build.gradle` file: | ||
|
||
=== "Groovy" | ||
|
||
```groovy title="build.gradle" | ||
apply plugin: 'dev.teogor.drifter.plugin' | ||
``` | ||
|
||
=== "Kotlin" | ||
|
||
```kotlin title="build.gradle.kts" | ||
plugins { | ||
id("dev.teogor.drifter.plugin") | ||
} | ||
``` | ||
|
||
## Using `BuildIl2CppTask` | ||
|
||
### Purpose | ||
|
||
The `BuildIl2CppTask` automates the compilation and building of Il2Cpp for Unity integration. It enhances the efficiency of your development workflow by handling complex build processes. | ||
|
||
### Configuration | ||
|
||
To use `BuildIl2CppTask`, follow these steps: | ||
|
||
1. Configure Unity options in your `build.gradle` file: | ||
|
||
=== "Groovy" | ||
|
||
```groovy title="build.gradle" | ||
unityOptions { | ||
exportFolder = 'path/to/unity/export/folder' | ||
libraryName = 'YourUnityLibrary' | ||
// Add more configuration options as needed | ||
} | ||
``` | ||
|
||
=== "Kotlin" | ||
|
||
```kotlin title="build.gradle.kts" | ||
val unityOptions = mapOf( | ||
"exportFolder" to "path/to/unity/export/folder", | ||
"libraryName" to "YourUnityLibrary" | ||
// Add more configuration options as needed | ||
) | ||
``` | ||
|
||
2. Create the task and set Unity options: | ||
|
||
=== "Groovy" | ||
|
||
```groovy title="build.gradle" | ||
createBuildIl2CppTask(unityOptions) | ||
``` | ||
|
||
=== "Kotlin" | ||
|
||
```kotlin title="build.gradle.kts" | ||
createBuildIl2CppTask(unityOptions) | ||
``` | ||
|
||
3. Execute the task: | ||
|
||
```shell | ||
./gradlew buildIl2Cpp | ||
``` | ||
|
||
Here's a Kotlin code snippet for your `build.gradle` file that demonstrates the configuration and usage: | ||
|
||
=== "Kotlin" | ||
|
||
```kotlin title="build.gradle.kts" | ||
// Configure Unity options | ||
val unityOptions = mapOf( | ||
"exportFolder" to "path/to/unity/export/folder", | ||
"libraryName" to "YourUnityLibrary" | ||
// Add more configuration options as needed | ||
) | ||
|
||
// Create and set up the BuildIl2CppTask | ||
createBuildIl2CppTask(unityOptions) | ||
|
||
// Execute the BuildIl2CppTask | ||
tasks.named("buildIl2Cpp").configure { | ||
// Add any additional configuration or dependencies here if needed | ||
// For example: | ||
// dependsOn("someOtherTask") | ||
} | ||
``` | ||
|
||
### Using `UnityAssetSyncTask` | ||
|
||
### Purpose | ||
|
||
The `UnityAssetSyncTask` streamlines the synchronization of Unity exported assets with your project. It prepares the project for Unity integration by copying essential folders. | ||
|
||
### Configuration | ||
|
||
To use `UnityAssetSyncTask`, follow these steps: | ||
|
||
1. Configure Unity options in your `build.gradle` file (if not already done). | ||
|
||
2. Create the task and set Unity options: | ||
|
||
=== "Groovy" | ||
|
||
```groovy title="build.gradle" | ||
createUnityAssetSyncTask(unityOptions) | ||
``` | ||
|
||
=== "Kotlin" | ||
|
||
```kotlin title="build.gradle.kts" | ||
createUnityAssetSyncTask(unityOptions) | ||
``` | ||
|
||
3. Execute the task: | ||
|
||
```shell | ||
./gradlew syncUnityAssets | ||
``` | ||
|
||
Here's a Kotlin code snippet for your `build.gradle` file that demonstrates the configuration and usage: | ||
|
||
=== "Kotlin" | ||
|
||
```kotlin title="build.gradle.kts" | ||
// Create and set up the UnityAssetSyncTask | ||
createUnityAssetSyncTask(unityOptions) | ||
|
||
// Execute the UnityAssetSyncTask | ||
tasks.named("syncUnityAssets").configure { | ||
// Add any additional configuration or dependencies here if needed | ||
// For example: | ||
// dependsOn("anotherTask") | ||
} | ||
``` | ||
|
||
## Conclusion | ||
|
||
With the Unity Integration Plugin, you can seamlessly integrate Unity projects into your Gradle-based project, enhancing the development process and ensuring consistency. If you encounter any issues or have feature requests, please don't hesitate to contribute or reach out for support. | ||
|
||
## Quick References | ||
|
||
1. [Installation](#installation) | ||
2. [Using `BuildIl2CppTask`](#using-buildil2cpptask) | ||
3. [Using `UnityAssetSyncTask`](#using-unityassetsynctask) | ||
4. [Conclusion](#conclusion) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Unity Module Compatibility | ||
|
||
Drifter is a comprehensive library designed to enhance and streamline your Unity development | ||
workflow. This document outlines the specific Unity versions that the Drifter library supports. | ||
|
||
## Supported Unity Versions | ||
|
||
| Version | Release Date | Release Notes | Hub Installation | Downloads | | ||
|-----------------|--------------|---------------------------------------------------------------------|------------------------------------|---------------------------------------------------------------------------| | ||
| **2022.3.42f1** | 13 Aug 2024 | [Read](https://unity.com/releases/editor/whats-new/2022.3.42#notes) | [Install](unityhub://2022.3.42f1/) | [See all](https://unity.com/releases/editor/whats-new/2022.3.42#installs) | | ||
| **2022.3.7f1** | 8 Aug 2023 | [Read](https://unity.com/releases/editor/whats-new/2022.3.7#notes) | [Install](unityhub://2022.3.7f1/) | [See all](https://unity.com/releases/editor/whats-new/2022.3.7#installs) | | ||
|
||
## How to Use | ||
|
||
To ensure compatibility and take full advantage of the features provided by Drifter, make sure you | ||
are using one of the supported Unity versions listed above. | ||
|
||
### Installation Steps | ||
|
||
1. Import the Drifter library into your project. | ||
2. Import the relevant Unity module from Drifter that suits your project requirements. | ||
Here’s the refined section with the installation steps incorporating the code snippets: | ||
|
||
### Installation Steps | ||
|
||
1. Import the Drifter library into your project. | ||
|
||
For more details, view the [implementation guide](releases/implementation.md). | ||
|
||
2. Import the relevant Unity module from Drifter that suits your project requirements. | ||
|
||
For example, to implement the Drifter Unity module for `v2022.3.7f1`, add the following | ||
dependency: | ||
|
||
```kotlin | ||
dependencies { | ||
implementation("dev.teogor.drifter:drifter-unity-2022-3-7f1:$version") | ||
} | ||
``` | ||
|
||
3. Set up your `Application` class to initialize Drifter with the appropriate Unity version. | ||
|
||
Update your `Application` class as follows: | ||
|
||
```kotlin | ||
class DemoApplication : Application() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
// Initialize Drifter with the Unity factory for version 2022.3.7f1 | ||
RegistryStartup.provides(withUnity202237f1Factory()) | ||
} | ||
} | ||
``` | ||
|
||
Alternatively, you can use `LocalUnityEngine` to provide the Unity factory: | ||
|
||
```kotlin | ||
LocalUnityEngine provide Unity202237f1Factory() | ||
``` | ||
|
||
## Need Help? | ||
|
||
If you encounter any issues or have questions regarding compatibility, feel free to open an issue on | ||
the [GitHub Issues page](https://github.com/teogor/drifter/issues). | ||
|
||
## Quick References | ||
|
||
1. [Supported Unity Versions](#supported-unity-versions) | ||
2. [How to Use](#how-to-use) | ||
3. [Installation Steps](#installation-steps) | ||
4. [Need Help?](#need-help) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters