Skip to content

Commit 858e979

Browse files
committed
remove unity docs
1 parent 1e1ff8c commit 858e979

File tree

1 file changed

+1
-55
lines changed

1 file changed

+1
-55
lines changed

README.md

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ This library gives you access to the powerful Parse Server backend from your .NE
2626
- [Using the Code](#using-the-code)
2727
- [Common Definitions](#common-definitions)
2828
- [Client-Side Use](#client-side-use)
29-
- [Use In Unity Client](#use-in-unity-client)
30-
- [Unity3D on iOS](#unity3d-on-ios)
31-
- [Unity3D on Android](#unity3d-on-android)
3229
- [Server-Side Use](#server-side-use)
3330
- [Basic Demonstration](#basic-demonstration)
3431
- [Local Builds](#local-builds)
@@ -80,8 +77,7 @@ ParseClient client = new ParseClient(new ServerConnectionData
8077

8178
`ServerConnectionData` is available in the `Parse.Infrastructure` namespace.
8279

83-
The two non-cloning `ParseClient` constructors contain optional parameters for an `IServiceHub` implementation instance and an array of `IServiceHubMutator`s. These should only be used when the behaviour of the SDK needs to be changed such as [when it is used with the Unity game engine](#use-in-unity-client).
84-
80+
The two non-cloning `ParseClient` constructors contain optional parameters for an `IServiceHub` implementation instance and an array of `IServiceHubMutator`s. These should only be used when the behavior of the SDK needs to be changed.
8581

8682
To find full usage instructions for the latest stable release, please visit the [Parse docs website][parse-docs-link]. Please note that the latest stable release is quite old and does not reflect the work being done at the moment.
8783

@@ -104,56 +100,6 @@ In your program's entry point, instantiate a `ParseClient` with all the paramete
104100
new ParseClient(/* Parameters */).Publicize();
105101
```
106102

107-
### Use In Unity Client
108-
109-
In Unity, the same logic applies to use the SDK as in [any other client](#client-side-use), except that a special `IServiceHub` impelementation instance, a `MetadataMutator`, and an `AbsoluteCacheLocationMutator` need to be passed in to one of the non-cloning `ParseClient` constructors in order to specify the environment and platform metadata, as well as the absolute cache location manually. This step is needed because the logic that creates these values automatically will fail and create incorrect values. The functionality to do this automatically may eventually be provided as a Unity package in the future, but for now, the following code can be used.
110-
111-
```csharp
112-
using System;
113-
using UnityEngine;
114-
using Parse.Infrastructure;
115-
```
116-
117-
```csharp
118-
new ParseClient(/* Parameters */,
119-
new LateInitializedMutableServiceHub { },
120-
new MetadataMutator
121-
{
122-
EnvironmentData = new EnvironmentData { OSVersion = SystemInfo.operatingSystem, Platform = $"Unity {Application.unityVersion} on {SystemInfo.operatingSystemFamily}", TimeZone = TimeZoneInfo.Local.StandardName },
123-
HostManifestData = new HostManifestData { Name = Application.productName, Identifier = Application.productName, ShortVersion = Application.version, Version = Application.version }
124-
},
125-
new AbsoluteCacheLocationMutator
126-
{
127-
CustomAbsoluteCacheFilePath = $"{Application.persistentDataPath.Replace('/', Path.DirectorySeparatorChar)}{Path.DirectorySeparatorChar}Parse.cache"
128-
}
129-
).Publicize();
130-
```
131-
132-
Other `IServiceHubMutator` implementations are available that do different things, such as the `RelativeCacheLocationMutator`, which allows a custom cache location relative to the default base folder (`System.Environment.SpecialFolder.LocalApplicationData`) to be specified.
133-
134-
If you are having trouble getting the SDK to work on other platforms, try to use the above code to control what values for various metadata information items the SDK will use, to see if that fixes the issue.
135-
136-
#### Unity3D on iOS
137-
138-
When using the Parse SDK on iOS/iPadOS target platforms you may encounter issues during runtime where the creation of ParseObjects using subclassing or other Parse methods fail. This occurs due to the fact that Unity strips code from the project and it will most likely do so for some parts of the Parse.dll assembly file.
139-
140-
To prevent Unity to remove necessary code from the assembly it is necessary to include a link.xml file in your project which tells Unity to not touch anything from the Parse.dll.
141-
142-
```xml
143-
<linker>
144-
<assembly fullname="Parse" preserve="all"/>
145-
</linker>
146-
```
147-
Save the above xml code to a file called 'link.xml' and place it in the Assets folder of your project.
148-
149-
#### Unity3D on Android
150-
151-
When using the Parse SDK on Android target platform you may encounter an issue related to network communication and resolution of host addresses when using the Parse SDK. This occurs in situations where you might use the Parse SDK but did not configure your Android app to require internet access. Whenever a project does not explicitly state it requires internet access Unity will try to remove classes and system assemblies during the build process, causing Parse-calls to fail with different exceptions.
152-
This may not be the case if your project uses any Unity specific web/networking code, as this will be detected by the engine and the code stripping will not be done.
153-
154-
To set your project, navigate to `Project Settings -> Player -> Other Settings -> Internet Access` and switch it to Require.
155-
Depending on the version of Unity you are using this setting may be found in a slightly different location or with slightly different naming, use the above path as a guidance.
156-
157103
### Server-Side Use
158104

159105
The SDK can be set up in a way such that every new `ParseClient` instance can authenticate a different user concurrently. This is enabled by an `IServiceHubMutator` implementation which adds itself as an `IServiceHubCloner` implementation to the service hub which, making it so that consecutive calls to the cloning `ParseClient` constructor (the one without parameters) will clone the publicized `ParseClient` instance, exposed by `ParseClient.Instance`, replacing the `IParseCurrentUserController` implementation instance with a fresh one with no caching every time. This allows you to configure the original instance, and have the clones retain the general behaviour, while also allowing the differnt users to be signed into the their respective clones and execute requests concurrently, without causing race conditions. To use this feature of the SDK, the first `ParseClient` instance must be constructued and publicized as follows once, before any other `ParseClient` instantiations. Any classes that need to be registered must be done so with the original instance.

0 commit comments

Comments
 (0)