ably / ably-dotnet

.NET, MAUI, Xamarin, Mono and Unity client library SDK for Ably realtime messaging service
https://ably.com/download
Apache License 2.0
45 stars 22 forks source link

Add unity specific agent header #1208

Closed sacOO7 closed 1 year ago

sacOO7 commented 1 year ago
sync-by-unito[bot] commented 1 year ago

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3338

sacOO7 commented 1 year ago

Instead of detecting the unity platform at compile time ( using conditional compilation). It can be detected at runtime https://docs.unity3d.com/ScriptReference/RuntimePlatform.html, this will necessitate the use of scanning unity classes using reflection and !PACKAGE conditional compilation flag same as https://github.com/ably/ably-dotnet/blob/d7c9c85ddb745b7cee3c3d6c187f02607131e274/src/IO.Ably.NETStandard20/Properties/AssemblyInfo.cs#L14-L19

sacOO7 commented 1 year ago

No need to use reflection if UnityEngine.dll can be imported and used directly as per https://vraulet.medium.com/developing-unity-code-outside-of-the-unity-editor-7e0e5334dd3e