question

monterey avatar image
monterey asked

Unity SDK vs C# SDK

Hello, my question boils down to, what are the effective differences between the Unity SDK vs C# SDK.

I'm a backend developer helping to build an App that requires PSN integration. I have followed the steps related to installing the playstation network with playfab and registering playfab with PSN.

I've already started writing code to utilize the C# SDK but am getting to the point where I need to integrate this into our Unity application. I'm wondering if I even need to use the UnitySDK. I've read here [https://ps4.siedev.net/forums/thread/277174/ (PS DevNet acct required)] that in order to connect to the Playfab network it was required to switch out use of WWW with HttpWebRequest. If that's the case, then unless there are other reasons why I HAVE to use the Unity SDK, I'd simply rather use the pure C# SDK. As I'm not a Unity Developer, there's nothing about configuring things from the Unity UI that is attractive to me.

unity3dsdks
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JayZuo avatar image
JayZuo answered

A obvious difference between Unity SDK and C# SDK is that they are using different asynchronous pattern.

For Unity SDK, it uses a callback pattern. In each API call, you can always find a resultCallback and a errorCallback. Within these callbacks you can handle any logic you want.

And for C# SDK, it takes advantage of Task-based Asynchronous Pattern (TAP), you will use async and await keywords to perform asynchronous request. However, TAP is supported in the .NET Framework 4.5 and higher. And for many Unity projects, they are still using .Net 3.5 as scripting runtime version (this is the default option when creating a new Unity project). Thus, you can't use C# SDK here and that's why we also need a Unity SDK.

So for your question, it will depends on the Unity application you need to integrate into. If the project used legacy scripting runtime (.NET 3.5 Equivalent), you will have to use Unity SDK. But if the project can use stable scripting runtime (.NET 4.x Equivalent), then you should be able to just use the C# SDK.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.