question

Richard Bates avatar image
Richard Bates asked

Unity Editor Extension location detection code is faulty

I tried moving the Unity Editor Extensions to a folder named 3rdPartyAssets to fit with our project structure (which is possible according to https://github.com/PlayFab/UnityEditorExtensions), which led to an exception:

NullReferenceException at PlayFabEditorExtensions/Editor/PlayFabEditor.cs:151

The problem appears to be that PlayFabEditorHelper.GetUiStyle() has

eachPath.Substring(eachPath.LastIndexOf("Assets"));

which incorrectly matched our 3rdPartyAssets path.

I edited that, and installed & relocated the SDK, but then the code to detect the relocation of EditorExtensions failed, because a copy of the unity package was stored in the default location, and PlayFabEditorHelper interprets the presence of files in the default location as evidence that EditorExtensions hasn't been moved.

Finally, the EdExPath in the PlayFabEditorPrefsSO scriptable object contained the absolute path of the folder, which obviously was incorrect on our other users' machines,causing new default files to be generated. I modified this to be a relative path.

unity3d
10 |1200

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

Rick Chen avatar image
Rick Chen answered

The PlayFabEditorExtensions SDK should be imported to Assets Folder by default. It is currently not support to move the PlayFabEditorExtensions Folder under other folders whose name contains string “Assets”. A solution could be to change the Folder name from “3rdPartyAssets” to one that does not contain “Assets”, for example, “3rdPartySDK”.

2 comments
10 |1200

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

Richard Bates avatar image Richard Bates commented ·

The remainder of my post still stands.

I tried your suggestion in an empty project. After relocating PlayFabEditorExtensions to a folder called '3rdParty', I installed the SDK, and a folder 'PlayFabEditorExtensions' is still created in the root of Assets.

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Richard Bates commented ·

The PlayFabEditorExtensions folder generated in the root of Assets is not important and can be removed, it will not affect the use of PlayFab SDK. If there is any other concerns, please let me know.

0 Likes 0 ·
Claire Rochelmeyer avatar image
Claire Rochelmeyer answered

Hey Richard,

We experienced this issue as well over a year ago now, and they still haven't improved their product -_-

I created a feature request about this, which also contained a temporary solution (if you haven't already implemented one yourself).

https://community.playfab.com/idea/50516/unity-playfabedex-asset-recreation-and-general-imp.html

I find it extremely frustrating that PlayFab's representatives here provide half-baked answers that never actually fix the problem, and immediately mark them as "Best Answer" without waiting for a reply.

Cheers

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.