![](/img/trans.png)
[英]c# error The type or namespace name 'SampleMain' does not exist in the namespace
[英]Unity 4.6 C#: The type or namespace name `IOS' does not exist in the namespace `GooglePlayGames'
我有一個為iOS和android開發的游戲,下面的代碼突然開始出現錯誤“ Assets / GooglePlayGames / Platforms / PlayGamesClientFactory.cs(31,40):錯誤CS0234:類型或名稱空間名稱IOS' does not exist in the namespace
GooglePlayGames中。是否缺少程序集引用?”
這是代碼:
using System;
using UnityEngine;
using UnityEngine.SocialPlatforms;
using GooglePlayGames.BasicApi;
namespace GooglePlayGames {
internal class PlayGamesClientFactory {
internal static IPlayGamesClient GetPlatformPlayGamesClient() {
if (Application.isEditor) {
return new GooglePlayGames.BasicApi.DummyClient();
}
#if UNITY_ANDROID
return new GooglePlayGames.Android.AndroidClient();
#elif UNITY_IPHONE
return new GooglePlayGames.IOS.IOSClient();
#else
return new GooglePlayGames.BasicApi.DummyClient();
#endif
}
}
}
錯誤就在網上:
return new GooglePlayGames.IOS.IOSClient();
平台相關的定義“ UNITY_IPHONE”的使用被標記為“已棄用”。 Unity文檔提到UNITY_IOS是針對iOS平台的新的依賴於PLatform的定義。 http://docs.unity3d.com/Manual/PlatformDependentCompilation.html
GooglePlayGames.IOS.IOSClient();行; 應該是正確的。 (未在我的代碼中進行測試,但相應的github檔案顯示了該位置的類。)
包括using GooglePlayGames.IOS;
在文件的頂部。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.