0
我正在嘗試將Game Center應用到我的遊戲中,但我遇到了問題。單點觸摸遊戲中心問題
這裏是我的Main.cs代碼:
namespace iosgame
{
public class Application
{
[Register ("AppDelegate")]
public partial class AppDelegate : IOSApplication {
MainViewController mainViewController;
public AppDelegate(): base(new Game(new StaticsDatabase(),new StoreDatabase(),new InappPurchase(),new Social(),new MissionsDatabase()), getConfig()) {
}
internal static IOSApplicationConfiguration getConfig() {
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
config.orientationLandscape = true;
config.orientationPortrait = false;
config.useAccelerometer = false;
config.useMonotouchOpenTK = true;
config.useObjectAL = true;
return config;
}
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
base.FinishedLaunching(app,options);
UIViewController controller = ((IOSApplication)Gdx.app).getUIViewController();
mainViewController = new MainViewController();
controller.View.Add(mainViewController.View);
return true;
}
private bool isGameCenterAPIAvailable()
{
return UIDevice.CurrentDevice.CheckSystemVersion (4, 1);
}
}
static void Main (string[] args)
{
UIApplication.Main (args, null, "AppDelegate");
}
}
}
我試圖用這個https://github.com/xamarin/monotouch-samples/blob/master/GameCenterSample/GameCenterSample/MainViewController.cs例子,但我不能看任何認證窗口在我的game.I可以看到「歡迎回來,名稱」的通知,但是我從gamecenter應用程序退出後重新打開我的遊戲,但我看不到任何身份驗證窗口。
我該如何解決?
在此先感謝
感謝您的回覆。我已經在我的應用程序代碼中執行了此操作。但我遇到了另一個問題。我可以看到「歡迎回來,播放器1」有時敬酒,但我無法在登出時看到登錄窗口來自Game Center應用程序。我對示例應用程序沒有任何問題。 可能登錄視圖正在呈現,但它在我自己的uiview控制器下面。遊戲中心的auth窗口如何知道它將使用哪個uiview來顯示此登錄視圖? – droidmachine
有什麼想法嗎? – droidmachine
您是否看到上例中的控制檯上印有任何內容?控制檯中有任何其他錯誤? – jonathanpeppers