Подробно объясним как исправить ту или иную ошибку самым простым способом
Error cs0535 unity
Скачал игровую платформу - ссылка
Match Me Kernel (Personal) Match-3 Solution
При загруске в Юнити выдаёт 2 похожие ошибки
Assets/GooglePlayGames/ISocialPlatform/PlayGamesPlatform.cs(41,18):
Скачал игровую платформу — ссылка
Match Me Kernel (Personal) Match-3 Solution
При загруске в Юнити выдаёт 2 похожие ошибки
Assets/GooglePlayGames/ISocialPlatform/PlayGamesPlatform.cs(41,18): error CS0535: GooglePlayGames.PlayGamesPlatform' does not implement interface memberUnityEngine.SocialPlatforms.ISocialPlatform.Authenticate(UnityEngine.SocialPlatforms.ILocalUser, System.Action)’
К сожалению я не так силён в юнити да и в С#.
помогите понять что означает эта ошибка.
П.С. у меня версия Юнити 5.5.0f3
задан 25 окт 2017 в 15:01
Abs3aktAbs3akt
8457 серебряных знаков22 бронзовых знака
1
Это значит, что класс PlayGamesPlatform имплементирует какой-то интерфейс, в котором описан метод Authenticate. А раз он описан в интерфейсе, то он должен быть обязательно реализован и в том классе. Однако её (реализации) там (в том классе) почему-то нет.
I am currently using Unity 2019.
Since updating play-games-plugin-for-unity to 10.0.5 I get these 4 errors:
Assets/GooglePlayGames/Platforms/Native/NativeClient.cs(37,33): error CS0535: ‘NativeClient’ does not implement interface member ‘IPlayGamesClient.GetAnotherServerAuthCode(bool, Action)’
Assets/GooglePlayGames/Platforms/Native/NativeSavedGameClient.cs(102,48): error CS0535: ‘NativeSavedGameClient.NativeConflictResolver’ does not implement interface member ‘IConflictResolver.ResolveConflict(ISavedGameMetadata, SavedGameMetadataUpdate, byte[])’
Assets/GooglePlayGames/Platforms/Native/NativeTurnBasedMultiplayerClient.cs(29,53): error CS0535: ‘NativeTurnBasedMultiplayerClient’ does not implement interface member ‘ITurnBasedMultiplayerClient.GetMatch(string, Action<bool, TurnBasedMatch>)’
Assets/GooglePlayGames/Platforms/Native/NativeTurnBasedMultiplayerClient.cs(29,53): error CS0535: ‘NativeTurnBasedMultiplayerClient’ does not implement interface member ‘ITurnBasedMultiplayerClient.Dismiss(TurnBasedMatch)’
Hi, I have been facing this error with Hololens 2,
Unity 2019.4.28f1, Visual Studio 2019, Photon PUN 2 (2.33.1)
ARFoundation 3.1.3, ASA SDK core/windows 2.7.1, Window Mixed Reality 4.2.1
and XR settings : LegacyWSA
I have been following the tutorial and after I imported ASA SDK 2.7.1
(I put the Azure account key, domain, ID to Spatial Anchor Config)
and imported 3 packages as follows in order
MRTK.HoloLens2.Unity.Tutorials.Assets.GettingStarted.2.4.0.unitypackage
MRTK.HoloLens2.Unity.Tutorials.Assets.AzureSpatialAnchors.2.4.0.unitypackage
MRTK.HoloLens2.Unity.Tutorials.Assets.MultiUserCapabilities.2.4.0.unitypackage
I met namespace missing error and I understood It was natural to pop up as I have not imported Photon asset.
so I did import the Photon asset with those error.
The problem is that the tutorial said I will see Pun Wizard window after importing Photon but I will not.
There is no Resource folder created and I’m getting the error CS0535…
eg:
AssetsMRTK.Tutorials.MultiUserCapabilitiesScriptsOwnershipHandler.cs(10,55): error CS0535: ‘OwnershipHandler’ does not implement interface member ‘IPunOwnershipCallbacks.OnOwnershipTransferFailed(PhotonView, Player)’
and when I downloaded and imported Photon asset earlier than 3 packages,
I can see Photon Server Settings in Resource folder but the error still appears.
Has anyone else experienced this or had an idea on how I can resolve this?
CS0535 – ‘class’ does not implement interface member ‘member’
Reason for the Error
You’ll get this error in your C# code when the class that is derived from the interface does not implement one or more of the interface members.
For example, let’s try to compile the below C# code snippet.
using System;
namespace DeveloperPublishConsoleCore
{
public interface IEmployee
{
void GetDetails();
}
public class Employee : IEmployee
{
}
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("DeveloperPublish Hello World!");
}
}
}
In the above example, the Employee class derives from the interface IEmployee but doesnot implement the method GetDetails(). This results in the C# error code CS0535.
Error CS0535 ‘Employee’ does not implement interface member ‘IEmployee.GetDetails()’ DeveloperPublishConsoleCore C:UserssenthsourcereposDeveloperPublishConsoleCoreDeveloperPublishConsoleCoreProgram.cs 10 Active
Solution
In C#, it is mandatory for the class to implement all the members of the interface from which it derives. You can fix the above code by implementing the method GetDetails() in the Employee class.
using System;
namespace DeveloperPublishConsoleCore
{
public interface IEmployee
{
void GetDetails();
}
public class Employee : IEmployee
{
public void GetDetails()
{
// Write your Logic here
}
}
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("DeveloperPublish Hello World!");
}
}
}
Assets/GooglePlayGames/ISocialPlatform/PlayGamesLocalUser.cs(12,18): error CS0535: `GooglePlayGames.PlayGamesLocalUser’ does not implement interface member `UnityEngine.SocialPlatforms.ILocalUser.Authentica te(System.Action<bool,string>)’
#if (UNITY_ANDROID || (UNITY_IPHONE && !NO_GPGS))namespace GooglePlayGames
{usingSystem;usingGooglePlayGames.BasicApi;usingUnityEngine.SocialPlatforms;/// <summary>/// Represents the Google Play Games local user./// </summary>publicclass PlayGamesLocalUser : PlayGamesUserProfile, ILocalUser
{internal PlayGamesPlatform mPlatform;privatestring emailAddress;private PlayerStats mStats;internal PlayGamesLocalUser(PlayGamesPlatform plaf):base("localUser", string.Empty, string.Empty){
mPlatform = plaf;
emailAddress =null;
mStats =null;}/// <summary>/// Authenticates the local user. Equivalent to calling/// <see cref="PlayGamesPlatform.Authenticate" />./// </summary>publicvoid Authenticate(Action<bool> callback){
mPlatform.Authenticate(callback);}/// <summary>/// Authenticates the local user. Equivalent to calling/// <see cref="PlayGamesPlatform.Authenticate" />./// </summary>publicvoid Authenticate(Action<bool> callback, bool silent){
mPlatform.Authenticate(callback, silent);}/// <summary>/// Loads all friends of the authenticated user./// </summary>publicvoid LoadFriends(Action<bool> callback){
mPlatform.LoadFriends(this, callback);}/// <summary>/// Synchronous version of friends, returns null until loaded./// </summary>public IUserProfile[] friends
{get{return mPlatform.GetFriends();}}/// <summary>/// Gets an id token for the user./// NOTE: This property can only be accessed using the main Unity thread./// </summary>/// <param name="idTokenCallback"> A callback to be invoked after token is retrieved. Will be passed null value/// on failure. </param>[Obsolete("Use PlayGamesPlatform.GetServerAuthCode()")]publicvoid GetIdToken(Action<string> idTokenCallback){if(authenticated)
mPlatform.GetIdToken(idTokenCallback);else
idTokenCallback(null);}/// <summary>/// Returns whether or not the local user is authenticated to Google Play Games./// </summary>/// <returns>/// <c>true</c> if authenticated; otherwise, <c>false</c>./// </returns>publicbool authenticated
{get{return mPlatform.IsAuthenticated();}}/// <summary>/// Not implemented. As safety placeholder, returns true./// </summary>publicbool underage
{get{returntrue;}}/// <summary>/// Gets the display name of the user./// </summary>/// <returns>/// The display name of the user./// </returns>publicnewstring userName
{get{string retval =string.Empty;if(authenticated){
retval = mPlatform.GetUserDisplayName();if(!base.userName.Equals(retval)){
ResetIdentity(retval, mPlatform.GetUserId(), mPlatform.GetUserImageUrl());}}return retval;}}/// <summary>/// Gets the user's Google id./// </summary>/// <remarks> This id is persistent and uniquely identifies the user/// across all games that use Google Play Game Services. It is/// the preferred method of uniquely identifying a player instead/// of email address./// </remarks>/// <returns>/// The user's Google id./// </returns>publicnewstring id
{get{string retval =string.Empty;if(authenticated){
retval = mPlatform.GetUserId();if(!base.id.Equals(retval)){
ResetIdentity(mPlatform.GetUserDisplayName(), retval, mPlatform.GetUserImageUrl());}}return retval;}}/// <summary>/// Gets an access token for the user./// NOTE: This property can only be accessed using the main Unity thread./// </summary>/// <returns>/// An id token for the user./// </returns>[Obsolete("Use PlayGamesPlatform.GetServerAuthCode()")]publicstring accessToken
{get{return authenticated ? mPlatform.GetAccessToken():string.Empty;}}/// <summary>/// Returns true (since this is the local user)./// </summary>publicnewbool isFriend
{get{returntrue;}}/// <summary>/// Gets the local user's state. This is always <c>UserState.Online</c> for/// the local user./// </summary>publicnew UserState state
{get{return UserState.Online;}}publicnewstring AvatarURL
{get{string retval =string.Empty;if(authenticated){
retval = mPlatform.GetUserImageUrl();if(!base.id.Equals(retval)){
ResetIdentity(mPlatform.GetUserDisplayName(),
mPlatform.GetUserId(), retval);}}return retval;}}/// <summary>Gets the email of the signed in player.</summary>/// <remarks>If your game requires a persistent, unique id for the/// player, the use of PlayerId is recommendend since it does not/// require extra permission consent from the user./// This is only available if the Requires Google Plus option/// is added to the setup (which enables additional/// permissions for the application)./// NOTE: This property can only be accessed using the main Unity thread./// </remarks>/// <value>The email.</value>publicstring Email
{get{// treat null as unitialized, empty as no email. This can// happen when the web client is not initialized.if(authenticated &&string.IsNullOrEmpty(emailAddress)){
emailAddress = mPlatform.GetUserEmail();
emailAddress = emailAddress ??string.Empty;}return authenticated ? emailAddress :string.Empty;}}/// <summary>/// Gets the player's stats./// </summary>/// <param name="callback">Callback when they are available.</param>publicvoid GetStats(Action<CommonStatusCodes, PlayerStats> callback){if(mStats ==null||!mStats.Valid){
mPlatform.GetPlayerStats((rc, stats)=>{
mStats = stats;
callback(rc, stats);});}else{// 0 = success
callback(CommonStatusCodes.Success, mStats);}}}}#endif
Добавлено через 2 минуты Вторая ошибка
Assets/GooglePlayGames/ISocialPlatform/PlayGamesPlatform.cs(26,18): error CS0535: `GooglePlayGames.PlayGamesPlatform’ does not implement interface member `UnityEngine.SocialPlatforms.ISocialPlatform.Authe nticate(UnityEngine.SocialPlatforms.ILocalUser, System.Action<bool,string>)’
Код от второй
C#
1
publicclass PlayGamesPlatform : ISocialPlatform
Ошибка в этой строчке, весь код не могу скинут (15к символов максимум)
__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь