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

Abs3akt's user avatar

Abs3aktAbs3akt

8457 серебряных знаков22 бронзовых знака

1

Это значит, что класс PlayGamesPlatform имплементирует какой-то интерфейс, в котором описан метод Authenticate. А раз он описан в интерфейсе, то он должен быть обязательно реализован и в том классе. Однако её (реализации) там (в том классе) почему-то нет.

ответ дан 25 окт 2017 в 15:07

Алексей Шиманский's user avatar

Алексей ШиманскийАлексей Шиманский

71.3k11 золотых знаков85 серебряных знаков167 бронзовых знаков

Это довольно известная проблема Unity 5.5.

Как решение можно отредактировать ваш код в соответствии с этим комитом. Но лучше всего будет актуализировать версию Unity до 2017.1+

ответ дан 25 окт 2017 в 15:28

Mikhail Efremov's user avatar

2

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?

C# Compiler Error

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

C# Error CS0535 – 'class' does not implement interface member 'member'

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!");
        }
    }
}

0 / 0 / 0

Регистрация: 02.01.2017

Сообщений: 12

1

03.01.2017, 00:02. Показов 1584. Ответов 1


Не могу понять, что не так.
Первая

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>)’

Код от первой

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
#if (UNITY_ANDROID || (UNITY_IPHONE && !NO_GPGS))
 
namespace GooglePlayGames
{
    using System;
    using GooglePlayGames.BasicApi;
    using UnityEngine.SocialPlatforms;
 
    /// <summary>
    /// Represents the Google Play Games local user.
    /// </summary>
    public class PlayGamesLocalUser : PlayGamesUserProfile, ILocalUser
    {
        internal PlayGamesPlatform mPlatform;
 
        private string 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>
        public void Authenticate(Action<bool> callback)
        {
            mPlatform.Authenticate(callback);
        }
 
        /// <summary>
        /// Authenticates the local user. Equivalent to calling
        /// <see cref="PlayGamesPlatform.Authenticate" />.
        /// </summary>
        public void Authenticate(Action<bool> callback, bool silent)
        {
            mPlatform.Authenticate(callback, silent);
        }
 
        /// <summary>
        /// Loads all friends of the authenticated user.
        /// </summary>
        public void 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()")]
        public void 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>
        public bool authenticated
        {
            get
            {
                return mPlatform.IsAuthenticated();
            }
        }
 
        /// <summary>
        /// Not implemented. As safety placeholder, returns true.
        /// </summary>
        public bool underage
        {
            get
            {
                return true;
            }
        }
 
        /// <summary>
        /// Gets the display name of the user.
        /// </summary>
        /// <returns>
        /// The display name of the user.
        /// </returns>
        public new string 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>
        public new string 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()")]
        public string accessToken
        {
            get
            {
                return authenticated ? mPlatform.GetAccessToken() : string.Empty;
            }
        }
 
        /// <summary>
        /// Returns true (since this is the local user).
        /// </summary>
        public new bool isFriend
        {
            get
            {
                return true;
            }
        }
 
        /// <summary>
        /// Gets the local user's state. This is always <c>UserState.Online</c> for
        /// the local user.
        /// </summary>
        public new UserState state
        {
            get
            {
                return UserState.Online;
            }
        }
 
 
        public new string 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>
        public string 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>
        public void 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
public class PlayGamesPlatform : ISocialPlatform

Ошибка в этой строчке, весь код не могу скинут (15к символов максимум)

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error cs0246 the type or namespace name player could not be found
  • Error cs0246 the type or namespace name particleemitter could not be found
  • Error cs0236 a field initializer cannot reference the non static field method or property
  • Error csrf token mismatch
  • Error cs9010 primary constructor body is not allowed

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии