-
Notifications
You must be signed in to change notification settings - Fork 182
Unity client sdk #1105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Unity client sdk #1105
Conversation
Moved Unity SDK template files from 'templates/unity/Runtime' and 'templates/unity/Editor' to 'templates/unity/Assets/Runtime' and 'templates/unity/Assets/Editor' for better alignment with Unity project conventions. Updated getFiles() in Unity.php to reflect new paths and added support for copying plugin DLLs and project settings. Improved file upload logic in Client.cs.twig to handle streams and byte arrays more robustly, and removed Unity-specific logging from Exception.cs.twig. Minor fixes in Realtime.cs.twig and Role.cs.twig for namespace and async handling.
Introduces Unity2021 test support by adding a Unity2021Test.php, Unity test source files, and updating the GitHub Actions workflow to include Unity2021 in the test matrix and set the UNITY_LICENSE environment variable. This enables automated testing for the Unity SDK within the CI pipeline.
I am also attaching instructions on how to obtain a Unity license painlessly. |
The basic functionality tested in the test is guaranteed to work, but I'm not sure about the rest. I will continue to refine it. Also, a question: What to implement next for the client SDK? |
The test failed because the secret is not configured in appwrite/sdk-generator. The successful test is here: |
// Cookie support
client.SetCookie() / client.GetCookie()
// Real-time subscriptions
realtime.Subscribe(channels, callback)
// Connection testing
await client.Ping() The successful test is here: |
Beta test
I'm done with cosmetics, now I'm going to implement the SDK into projects and fix anything that's wrong. I'll also create a temporary repository to allow the community to use the generated Unity SDK. The successful test is here: |
Wrapped UniTask-related code in #if UNI_TASK preprocessor directives and updated asmdef to define UNI_TASK when com.cysharp.unitask is present.
Add conditional UniTask support for Unity templates
Introduces a [Flags] enum for selecting which services to initialize in the Unity inspector, adds related fields to the configuration ScriptableObject, and provides tooltips and warnings about API key security.
Introduces a mechanism to initialize selected services dynamically based on configuration using reflection. Adds a dictionary to store service instances, updates initialization logic, and provides methods to retrieve or try to retrieve initialized services. Also refactors the initialization and reinitialization methods to support optional realtime setup and improves error handling and logging.
User friendly update
What does this PR do?
This PR adds comprehensive Unity SDK support to the SDK generator by:
Unity Language Implementation: Introduces a new
Unity
language class (src/SDK/Language/Unity.php
) that extends the baseLanguage
class, providing Unity-specific type mappings, keywords, and code generation logic for C# in Unity environment.Unity Template System: Adds a complete set of Unity-specific templates under
templates/unity/Assets/
including:Automated Testing Integration: Introduces Unity2021 test support with:
Unity2021Test.php
test class that integrates with the existing test frameworkTests.cs
,Tests.asmdef
) for comprehensive SDK testingunityci/editor:ubuntu-2021.3.45f1-base-3.1.0
CI/CD Integration: Updates the GitHub Actions workflow to:
UNITY_LICENSE
environment variable for Unity Editor automationUnity Project Structure: Implements proper Unity package structure with:
Assets/Runtime/
andAssets/Editor/
Test Plan
The testing strategy includes:
Unit Testing: The
Unity2021Test.php
runs comprehensive tests covering:Docker-based CI Testing: Tests run in a controlled Unity environment using:
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
Yes