Skip to content
This repository was archived by the owner on Oct 17, 2020. It is now read-only.

Commit e4ad703

Browse files
https://api.playfab.com/releaseNotes/#190410
2 parents a36bdc0 + 2acdeff commit e4ad703

File tree

6 files changed

+30
-8
lines changed

6 files changed

+30
-8
lines changed
342 Bytes
Binary file not shown.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ We will be adding to this platform as PlayFab's features grow.
2020
## Setup:
2121

2222
1. Download [this Asset Package](https://api.playfab.com/sdks/download/unity-edex "PlayFabEditorExtensions.unitypackage") and import into a new or existing project.
23+
* EditorExtensions is meant to be moved as a whole folder: /PlayFabEditorExtensions/Editor/... if you wish to move the extension to not the root Asset folder, you MUST move the PlayFabEditorExtensions folder not just /Editor/
2324
2. Open the Editor Extensions via the Unity menu: **Window > PlayFab > Editor Extensions**
2425
3. Log in using an existing PlayFab developer account (or create a new account) to continue.
2526
4. Editor Extensions will automatically detect if you have a PlayFab SDK installed.
2627
* If your SDK is a supported version(2.0+), you may use this plugin stay up-to-date with the latest SDK
2728
* If you are using a Push Plugin released by PlayFab, please delete it, and convert to FCM. See our [Blog Post](https://blog.playfab.com/blog/push-sep-17) for more details.
2829
* If no SDK was detected, this plugin can download and install the latest SDK version from gitHub.
2930
5. After a supported SDK is installed, you will need to select a studio and title id.
31+
* you may move the PlayFabSdk to a non Asset root folder, but you will have to let the editor extensions know where you have moved the sdk.
3032
6. After a studio and title ID are selected, you can call APIs and use the Editor Extensions to configure the SDK settings from within the IDE.
3133

3234
![EditorExtensions_SKDs](https://github.com/PlayFab/UnityEditorExtensions/raw/master/_repoAssets/img/EdEx_SDKs.png "View the current SDK and upgrade to the latest SDK.")

Source/Assets/PlayFabEditorExtensions/Editor/Scripts/Panels/PlayFabEditorSDKTools.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,23 @@ public static Type GetPlayFabSettings()
236236
playFabSettingsType = typeof(object); // Sentinel value to indicate that PlayFabSettings doesn't exist
237237
var allAssemblies = AppDomain.CurrentDomain.GetAssemblies();
238238
foreach (var assembly in allAssemblies)
239-
foreach (var eachType in assembly.GetTypes())
240-
if (eachType.Name == PlayFabEditorHelper.PLAYFAB_SETTINGS_TYPENAME)
241-
playFabSettingsType = eachType;
239+
{
240+
Type[] assemblyTypes;
241+
try
242+
{
243+
assemblyTypes = assembly.GetTypes();
244+
}
245+
catch (ReflectionTypeLoadException e)
246+
{
247+
assemblyTypes = e.Types;
248+
}
249+
250+
foreach (var eachType in assemblyTypes)
251+
if (eachType != null)
252+
if (eachType.Name == PlayFabEditorHelper.PLAYFAB_SETTINGS_TYPENAME)
253+
playFabSettingsType = eachType;
254+
}
255+
242256
//if (playFabSettingsType == typeof(object))
243257
// Debug.LogWarning("Should not have gotten here: " + allAssemblies.Length);
244258
//else
@@ -300,7 +314,7 @@ private static UnityEngine.Object FindSdkAsset()
300314
if (fileList.Length == 0)
301315
return null;
302316

303-
var relPath = fileList[0].Substring(fileList[0].LastIndexOf("Assets/"));
317+
var relPath = fileList[0].Substring(fileList[0].LastIndexOf("Assets"));
304318
return AssetDatabase.LoadAssetAtPath(relPath, typeof(UnityEngine.Object));
305319
}
306320

Source/Assets/PlayFabEditorExtensions/Editor/Scripts/Utils/PlayFabEditorHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ static PlayFabEditorHelper()
113113

114114
private static GUISkin GetUiStyle()
115115
{
116-
var searchRoot = string.IsNullOrEmpty(EDEX_ROOT) ? Application.dataPath : EDEX_ROOT;
117-
var pfGuiPaths = Directory.GetFiles(searchRoot, "PlayFabStyles.guiskin", SearchOption.AllDirectories);
116+
var searchRootAssetFolder = Application.dataPath;
117+
var pfGuiPaths = Directory.GetFiles(searchRootAssetFolder, "PlayFabStyles.guiskin", SearchOption.AllDirectories);
118118
foreach (var eachPath in pfGuiPaths)
119119
{
120-
var loadPath = eachPath.Substring(eachPath.LastIndexOf("Assets/"));
120+
var loadPath = eachPath.Substring(eachPath.LastIndexOf("Assets"));
121121
return (GUISkin)AssetDatabase.LoadAssetAtPath(loadPath, typeof(GUISkin));
122122
}
123123
return null;

Source/Assets/PlayFabEditorExtensions/Editor/Scripts/Utils/PlayFabEditorPrefsSO.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ public static PlayFabEditorPrefsSO Instance
2929
_instance = CreateInstance<PlayFabEditorPrefsSO>();
3030
if (!Directory.Exists(Path.Combine(Application.dataPath, "PlayFabEditorExtensions/Editor/Resources")))
3131
Directory.CreateDirectory(Path.Combine(Application.dataPath, "PlayFabEditorExtensions/Editor/Resources"));
32+
33+
// TODO: we know the location of this file will be under PlayFabEditorExtensions/Editor/
34+
// just need to pull that files path, and append /Resrouces/ and boom you have the below path.
35+
// consider moving this above the if directory exists so we can do the same logic beforehand.
36+
Directory.GetFiles(Application.dataPath, "PlayFabEditor.cs");
37+
3238
AssetDatabase.CreateAsset(_instance, "Assets/PlayFabEditorExtensions/Editor/Resources/PlayFabEditorPrefsSO.asset");
3339
AssetDatabase.SaveAssets();
3440
Debug.LogWarning("Created missing PlayFabEditorPrefsSO file");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
namespace PlayFab.PfEditor { public static partial class PlayFabEditorHelper { public static string EDEX_VERSION = "2.63.190312"; } }
1+
namespace PlayFab.PfEditor { public static partial class PlayFabEditorHelper { public static string EDEX_VERSION = "2.64.190410"; } }

0 commit comments

Comments
 (0)