Assets\Photon\PhotonUnityNetworking\Demos\DemoAsteroids\Scripts\Lobby\LobbyMainPanel.cs(6,7): error CS0246: The type or namespace name 'PlayFab' could not be found (are you missing a using directive or an assembly reference?)
I have researched why the namespace PlayFab isn't working in this certain script and I have seen solutions like the external script editor (I am using Visual Studio Community 2022 [17.0.1]) or upgrading Unity version (I am using 2020.1.5f1). I have been using the namespace PlayFab on the other scripts and it is working fine, I have also tried to move the script into the Assembly-CSharp, the namespace PlayFab works but I get some other errors if I move it.
The script that I am having problems with the namespace PlayFab is LobbyMainPanel.cs, this script is only suppose to be in the PhotonUnityNetworking.Demo
The code that I was trying to add in the script is
private void UpdateLeaderboardUsername() { var request = new UpdateUserTitleDisplayNameRequest() { DisplayName = PlayerUsername.text }; PlayFabClientAPI.UpdateUserTitleDisplayName(request, (result) => { Debug.Log("PlayFab - Score submitted!"); }, (error) => { Debug.Log("PlayFab - Error occured while submitting the score: " + error.ErrorMessage); }); }
When I press Alt and Enter on the PlayFabClientAPI
I am suppose to be able to add a namespace PlayFab but it wasn't there at all so I copied and pasted using PlayFab; using PlayFab.ClientModels;
at the start but I receive errors IDE0005: Using directive is unnecessary and the type or namespace 'PlayFab' could not be found. I have also installed the PlayFab SDK version 2.116.211012. Now when I press on Alt + Enter on PlayFabClientAPI
or UpdateUserTitleDisplayNameRequest I can add reference to 'PlayFab' which fixes the error on visual studio so I have no errors however when I am on Unity I still get the same errors which is confusing and I don't know how to fix this.
,
Assets\Photon\PhotonUnityNetworking\Demos\DemoAsteroids\Scripts\Lobby\LobbyMainPanel.cs(6,7): error CS0246: The type or namespace name 'PlayFab' could not be found (are you missing a using directive or an assembly reference?)
I have researched why the namespace PlayFab isn't working in this certain script and I have seen solutions like the external script editor (I am using Visual Studio Community 2022 [17.0.1]) or upgrading Unity version (I am using 2020.1.5f1). I have been using the namespace PlayFab on the other scripts and it is working fine, I have also tried to move the script into the Assembly-CSharp, the namespace PlayFab works but I get some other errors if I move it.
The script that I am having problems with the namespace PlayFab is LobbyMainPanel.cs, this script is only suppose to be in the PhotonUnityNetworking.Demo
The code that I was trying to add in the script is
<code>private void UpdateLeaderboardUsername() { var request = new UpdateUserTitleDisplayNameRequest() { DisplayName = PlayerUsername.text }; PlayFabClientAPI.UpdateUserTitleDisplayName(request, (result) => { Debug.Log("PlayFab - Score submitted!"); }, (error) => { Debug.Log("PlayFab - Error occured while submitting the score: " + error.ErrorMessage); }); }
When I press Alt and Enter on the am suppose to be able to add a namespace PlayFab but it wasn't there at all so I copied and pasted using PlayFab; using PlayFab.ClientModels;
at the start but I receive errors IDE0005: Using directive is unnecessary and the type or namespace 'PlayFab' could not be found. I have also installed the PlayFab SDK version 2.116.211012.
Now when I click on the PlayFabClientAPI or UpdateUserTitleDisplayNameRequest I add referene to 'PlayFab' when on the visual studio there are no errors found but when I save it and go back to Unity I still get the same error even though visual studio says there are no errors found