question

cmingo2222 avatar image
cmingo2222 asked

Using Entity Api

Hi I am trying to get started with using the new entity add on but am not able to access the PlayFab.EntityModels namespace. This means I am also not able to access the entity api. I have enabled the entity api in the editor extensions and have the latest PF SDK. Please let me know if I am missing a step somewhere along the line.

apissdks
3 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.

cmingo2222 avatar image cmingo2222 commented ·

Hi @pfnathan,

Sorry I am using the unity SDK. I have implemented other playfab functionality and cloud script with no problem but am running into trouble getting started with entities beyond getting the EntityKey response with login.

,

Hi @pfnathan,

Sorry I am using the unity SDK. I have implemented other playfab functionality and cloud script with no problem but am running into trouble getting started with entities.

0 Likes 0 ·
pfnathan avatar image pfnathan ♦ commented ·

Thanks for the info. one more info we need to know is that what api call you made to obtain entity key. please let us know.

0 Likes 0 ·
pfnathan avatar image pfnathan ♦ commented ·

Note: this reply is from @cmingo2222

To obtain the entity key I set the LoginTitlePlayerAccountEntity Request property to true when I call LoginWithPlayfab or LoginWithIOSDeviceId. I call this in a script when the game is loaded. When I try to create a Clan Controller script that includes using PlayFab.EntityModels, the EntityModels namespace is not recognized.

0 Likes 0 ·

1 Answer

·
1807605288 avatar image
1807605288 answered

Please reply with the version of the PlayFab SDK you are using.
Please reply with the version of the Unity Engine you are using.
Please reply with the version of the Visual Studio you are using.

The specific combination of the Unity 2017 versions and Visual Studio 2017 together have a bug where toggling #define switches (such as enabling the Entity API in our EdEx panel) does not always carry over to Visual Studio properly.

One possible fix:

  • Close Unity and Visual Studio
  • Navigate to your Unity Project directory. Delete any files matching the following signature:
    • *.sln (1 file), *.csproj (Likely 1-5 files)
  • Reopen your project in Unity, and reopen visual studio by double clicking any code source file from unity
  • This should force-refresh the Visual Studio files, and enable the correct highlighting in VS
6 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.

pfnathan avatar image pfnathan ♦ commented ·

Can you let us know which SDK you are referring to?.

0 Likes 0 ·
cmingo2222 avatar image cmingo2222 commented ·

Hi Paul,

Thank you for your suggestion! I followed your instructions and everything is working great and I can access all of the Entity API.

For the record:

Playfab SDK Version: 2.39.180316

Unity Version: 2017.3.0f3

VS Version: 1.22.1

0 Likes 0 ·
matt-6 avatar image matt-6 commented ·

Hi, I'm also unable to use PlayFab.EntityModels and this fix doesn't seem to have worked for me. I've enabled via the tickbox in the unity extensions panel, is there something else I need to do? There's only one file under the Entity folder - ScreenTimeTracker.

SDK - 2.48.180809

Unity - 2018.2.4f1

VS 2017 (15.5.4)

0 Likes 0 ·
matt-6 avatar image matt-6 matt-6 commented ·

By SDK, I mean playfab sdk - installed using the unity extension

0 Likes 0 ·
Andy avatar image Andy ♦♦ matt-6 commented ·

Can you go into a little more detail on the problem you're encountering? Since the original post, we've restructured the Entity API as described in this blog post: https://blog.playfab.com/blog/entity-api-group-restructure The namespace referenced in the original question (PlayFab.EntityModels) no longer exists.

0 Likes 0 ·
matt-6 avatar image matt-6 Andy ♦♦ commented ·

Ah ha, that may explain things!

0 Likes 0 ·

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.