Add two Game Center Sample: GameCenterSample, MTGKTapper

This commit is contained in:
bopang 2013-06-18 18:09:02 -04:00
Родитель ef432c2d69
Коммит 736abe46fe
77 изменённых файлов: 2551 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,33 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameCenterSample", "GameCenterSample\GameCenterSample.csproj", "{E765F61B-08B0-479F-8F36-864B680EE3D2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|iPhoneSimulator = Release|iPhoneSimulator
Debug|iPhone = Debug|iPhone
Release|iPhone = Release|iPhone
Ad-Hoc|iPhone = Ad-Hoc|iPhone
AppStore|iPhone = AppStore|iPhone
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E765F61B-08B0-479F-8F36-864B680EE3D2}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
{E765F61B-08B0-479F-8F36-864B680EE3D2}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
{E765F61B-08B0-479F-8F36-864B680EE3D2}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
{E765F61B-08B0-479F-8F36-864B680EE3D2}.AppStore|iPhone.Build.0 = AppStore|iPhone
{E765F61B-08B0-479F-8F36-864B680EE3D2}.Debug|iPhone.ActiveCfg = Debug|iPhone
{E765F61B-08B0-479F-8F36-864B680EE3D2}.Debug|iPhone.Build.0 = Debug|iPhone
{E765F61B-08B0-479F-8F36-864B680EE3D2}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{E765F61B-08B0-479F-8F36-864B680EE3D2}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{E765F61B-08B0-479F-8F36-864B680EE3D2}.Release|iPhone.ActiveCfg = Release|iPhone
{E765F61B-08B0-479F-8F36-864B680EE3D2}.Release|iPhone.Build.0 = Release|iPhone
{E765F61B-08B0-479F-8F36-864B680EE3D2}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{E765F61B-08B0-479F-8F36-864B680EE3D2}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = GameCenterSample\GameCenterSample.csproj
outputpath = ..\GameCenterSample\build\bin
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.GameKit;
namespace GameCenterSample
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
// class-level declarations
UIWindow window;
MainViewController viewController;
bool gameCenterAuthenticationComplete = false;
string currentPlayerID;
//
// 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)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
viewController = new MainViewController ();
window.RootViewController = viewController;
window.MakeKeyAndVisible ();
if (!isGameCenterAPIAvailable ())
gameCenterAuthenticationComplete = false;
else {
GKLocalPlayer.LocalPlayer.AuthenticateHandler = (ui, error) =>
{
if(ui != null)
{
viewController.PresentViewController(ui,true,null);
}
else if(error != null)
{
new UIAlertView ("Error", error.ToString(), null, "OK", null).Show();
}
else if(GKLocalPlayer.LocalPlayer.Authenticated)
{
this.gameCenterAuthenticationComplete = true;
//Switching Users
if(currentPlayerID != null || currentPlayerID != GKLocalPlayer.LocalPlayer.PlayerID)
{
currentPlayerID = GKLocalPlayer.LocalPlayer.PlayerID;
viewController.player = new PlayerModel();
viewController.player.loadStoredScores();
viewController.player.loadSotredAchievements();
}
}
else
{
this.gameCenterAuthenticationComplete = false;
}
};
}
return true;
}
public override void DidEnterBackground (UIApplication application)
{
this.gameCenterAuthenticationComplete = false;
}
private bool isGameCenterAPIAvailable()
{
return UIDevice.CurrentDevice.CheckSystemVersion (4, 1);
}
}
}

Просмотреть файл

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>

Просмотреть файл

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E765F61B-08B0-479F-8F36-864B680EE3D2}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>GameCenterSample</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>GameKit</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchDebug>true</MtouchDebug>
<MtouchLink>None</MtouchLink>
<ConsolePause>false</ConsolePause>
<MtouchI18n />
<MtouchArch>ARMv7</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<Optimize>true</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchLink>None</MtouchLink>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<ConsolePause>false</ConsolePause>
<IpaPackageName />
<MtouchI18n />
<MtouchArch>ARMv7</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Ad-Hoc</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Distribution</CodesignKey>
<BuildIpa>true</BuildIpa>
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\AppStore</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignProvision>Automatic:AppStore</CodesignProvision>
<CodesignKey>iPhone Distribution</CodesignKey>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="PlayerModel.cs" />
<Compile Include="MainViewController.cs" />
<Compile Include="MainViewController.designer.cs">
<DependentUpon>MainViewController.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="MainViewController.xib" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<BundleResource Include="Resources\Icon.png" />
<BundleResource Include="Resources\Icon%402x.png" />
<BundleResource Include="Resources\Icon-Small.png" />
<BundleResource Include="Resources\Icon-Small%402x.png" />
<BundleResource Include="Resources\Default.png" />
<BundleResource Include="Resources\Default%402x.png" />
<BundleResource Include="Resources\Default-568h%402x.png" />
</ItemGroup>
<ItemGroup>
<ITunesArtwork Include="Resources\iTunesArtwork" />
<ITunesArtwork Include="Resources\iTunesArtwork%402x" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>GameCenterSample</string>
<key>CFBundleIdentifier</key>
<string>com.appledts.GameCenterSamples</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>CFBundleIconFiles</key>
<array>
<string>Icon</string>
<string>Icon@2x</string>
<string>Icon-Small</string>
<string>Icon-Small@2x</string>
</array>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace GameCenterSample
{
public class Application
{
// This is the main entry point of the application.
static void Main (string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, "AppDelegate");
}
}
}

Просмотреть файл

@ -0,0 +1,121 @@
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.GameKit;
namespace GameCenterSample
{
public partial class MainViewController : UIViewController
{
public PlayerModel player;
int achievementsPercentageComplete = 0;
public MainViewController () : base ("MainViewController", null)
{
}
public override void DidReceiveMemoryWarning ()
{
// Releases the view if it doesn't have a superview.
base.DidReceiveMemoryWarning ();
// Release any cached data, images, etc that aren't in use.
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
this.scoreTextField.EditingDidEndOnExit += (object sender, EventArgs e) => {
this.scoreTextField.EndEditing(true);
};
//Add event handler for our buttons
this.showLeaderBoardButton.TouchUpInside += leaderBoardButtonTouchUpInsideHander;
this.submitScoreButton.TouchUpInside += submitScoreHandleTouchUpInside;
this.showAchievementsButton.TouchUpInside += showAchievementsHandleTouchUpInside;
this.submitAchievementButton.TouchUpInside += submitAchievementHandleTouchUpInside;
this.resetAchievementsButton.TouchUpInside += resetAchievementsButtonHandleTouchUpInside;
}
public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
{
// Return true for supported orientations
return (toInterfaceOrientation != UIInterfaceOrientation.PortraitUpsideDown);
}
void resetAchievementsButtonHandleTouchUpInside (object sender, EventArgs e)
{
player.resetAchievements ();
}
void submitAchievementHandleTouchUpInside (object sender, EventArgs e)
{
//Create the achievement we want to submit.
NSString identifier = new NSString ("com.appledts.GameCenterSampleApps.achievement");
GKAchievement achievement = new GKAchievement ("com.appledts.GameCenterSampleApps.achievement");
achievementsPercentageComplete += 25;
achievement.PercentComplete = achievementsPercentageComplete;
player.submitAchievement (achievement);
}
void submitScoreHandleTouchUpInside (object sender, EventArgs e)
{
GKScore submitScore = new GKScore ("leaderboard");
submitScore.Init ();
submitScore.Value = Convert.ToInt64(this.scoreTextField.Text);
submitScore.ShouldSetDefaultLeaderboard = true;
submitScore.Context = 100;
player.submitScore (submitScore);
}
void leaderBoardButtonTouchUpInsideHander (object sender, EventArgs e)
{
showLeaderboard ();
}
void showLeaderboard()
{
GKLeaderboardViewController leaderboardViewController = new GKLeaderboardViewController ();
leaderboardViewController.Category = "Leaderboard";
leaderboardViewController.DidFinish += (object sender, EventArgs e) => {
leaderboardViewController.DismissViewController(true, null);
};
this.PresentViewController (leaderboardViewController, true, null);
}
void showAchievementsHandleTouchUpInside (object sender, EventArgs e)
{
showAchievements ();
}
void showAchievements()
{
GKAchievementViewController achievementViewController = new GKAchievementViewController ();
achievementViewController.DidFinish += (object sender, EventArgs e) => {
achievementViewController.DismissViewController(true, null);
};
this.PresentViewController(achievementViewController, true, null);
}
}
}

66
GameCenterSample/GameCenterSample/MainViewController.designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,66 @@
// WARNING
//
// This file has been generated automatically by Xamarin Studio to store outlets and
// actions made in the UI designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using MonoTouch.Foundation;
using System.CodeDom.Compiler;
namespace GameCenterSample
{
[Register ("MainViewController")]
partial class MainViewController
{
[Outlet]
MonoTouch.UIKit.UIButton resetAchievementsButton { get; set; }
[Outlet]
MonoTouch.UIKit.UITextField scoreTextField { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton showAchievementsButton { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton showLeaderBoardButton { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton submitAchievementButton { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton submitScoreButton { get; set; }
void ReleaseDesignerOutlets ()
{
if (scoreTextField != null) {
scoreTextField.Dispose ();
scoreTextField = null;
}
if (showAchievementsButton != null) {
showAchievementsButton.Dispose ();
showAchievementsButton = null;
}
if (showLeaderBoardButton != null) {
showLeaderBoardButton.Dispose ();
showLeaderBoardButton = null;
}
if (submitScoreButton != null) {
submitScoreButton.Dispose ();
submitScoreButton = null;
}
if (submitAchievementButton != null) {
submitAchievementButton.Dispose ();
submitAchievementButton = null;
}
if (resetAchievementsButton != null) {
resetAchievementsButton.Dispose ();
resetAchievementsButton = null;
}
}
}
}

Просмотреть файл

@ -0,0 +1,451 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1552</int>
<string key="IBDocument.SystemVersion">12C60</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.34</string>
<string key="IBDocument.HIToolboxVersion">625.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">2083</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUIButton</string>
<string>IBUILabel</string>
<string>IBUITextField</string>
<string>IBUIView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="843779117">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="774585933">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIButton" id="438927000">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{73, 327}, {175, 36}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="656121564"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Show Achievements</string>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="1011344206">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor" id="85711167">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="183671126">
<int key="type">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont" id="690453499">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="107249936">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{73, 271}, {175, 36}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="438927000"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Show LeaderBoard</string>
<reference key="IBUIHighlightedTitleColor" ref="1011344206"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="85711167"/>
<reference key="IBUIFontDescription" ref="183671126"/>
<reference key="IBUIFont" ref="690453499"/>
</object>
<object class="IBUILabel" id="492426963">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{73, 19}, {50, 21}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="83479240"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Score:</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<double key="pointSize">17</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">17</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUITextField" id="83479240">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{144, 16}, {97, 30}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="772713933"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentVerticalAlignment">0</int>
<string key="IBUIText"/>
<int key="IBUIBorderStyle">3</int>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
<float key="IBUIMinimumFontSize">17</float>
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<double key="pointSize">14</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">14</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="772713933">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{73, 114}, {175, 36}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="513504767"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Submit Score</string>
<reference key="IBUIHighlightedTitleColor" ref="1011344206"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="85711167"/>
<reference key="IBUIFontDescription" ref="183671126"/>
<reference key="IBUIFont" ref="690453499"/>
</object>
<object class="IBUIButton" id="513504767">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{73, 165}, {175, 44}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="107249936"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Submit Achievement</string>
<reference key="IBUIHighlightedTitleColor" ref="1011344206"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="85711167"/>
<reference key="IBUIFontDescription" ref="183671126"/>
<reference key="IBUIFont" ref="690453499"/>
</object>
<object class="IBUIButton" id="656121564">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{73, 396}, {175, 44}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Reset Achievements</string>
<reference key="IBUIHighlightedTitleColor" ref="1011344206"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC43NTM1MjQxMTY4IDAuMTY5ODMzNzk0OCAwAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="85711167"/>
<reference key="IBUIFontDescription" ref="183671126"/>
<reference key="IBUIFont" ref="690453499"/>
</object>
</array>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="492426963"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="774585933"/>
</object>
<int key="connectionID">7</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">showLeaderBoardButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="107249936"/>
</object>
<int key="connectionID">17</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">showAchievementsButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="438927000"/>
</object>
<int key="connectionID">18</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">submitScoreButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="772713933"/>
</object>
<int key="connectionID">23</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">scoreTextField</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="83479240"/>
</object>
<int key="connectionID">25</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">submitAchievementButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="513504767"/>
</object>
<int key="connectionID">28</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">resetAchievementsButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="656121564"/>
</object>
<int key="connectionID">29</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="843779117"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="774585933"/>
<array class="NSMutableArray" key="children">
<reference ref="107249936"/>
<reference ref="83479240"/>
<reference ref="492426963"/>
<reference ref="772713933"/>
<reference ref="513504767"/>
<reference ref="656121564"/>
<reference ref="438927000"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">14</int>
<reference key="object" ref="438927000"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="107249936"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="492426963"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="83479240"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="772713933"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
<reference key="object" ref="513504767"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="656121564"/>
<reference key="parent" ref="774585933"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">GameKitViewController</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="14.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="15.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="19.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="20.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="21.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="26.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="27.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">29</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">GameKitViewController</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="resetAchievementsButton">UIButton</string>
<string key="scoreTextField">UITextField</string>
<string key="showAchievementsButton">UIButton</string>
<string key="showLeaderBoardButton">UIButton</string>
<string key="submitAchievementButton">UIButton</string>
<string key="submitScoreButton">UIButton</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="resetAchievementsButton">
<string key="name">resetAchievementsButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="scoreTextField">
<string key="name">scoreTextField</string>
<string key="candidateClassName">UITextField</string>
</object>
<object class="IBToOneOutletInfo" key="showAchievementsButton">
<string key="name">showAchievementsButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="showLeaderBoardButton">
<string key="name">showLeaderBoardButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="submitAchievementButton">
<string key="name">submitAchievementButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="submitScoreButton">
<string key="name">submitScoreButton</string>
<string key="candidateClassName">UIButton</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/GameKitViewController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">2083</string>
</data>
</archive>

Просмотреть файл

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<SampleMetadata>
<ID>cce6b3a7-389b-4fbd-9bca-bc43b1237d3a</ID>
<IsFullApplication>false</IsFullApplication>
<Level>Beginning</Level>
<Tags>Game Center</Tags>
<LicenseRequirement>Starter</LicenseRequirement>
</SampleMetadata>

Просмотреть файл

@ -0,0 +1,211 @@
using System;
using System.IO;
using System.Collections.Generic;
using MonoTouch.Foundation;
using MonoTouch.GameKit;
using MonoTouch.UIKit;
namespace GameCenterSample
{
public class PlayerModel
{
string storedScoresFilename;
string storedAchievementsFilename;
NSMutableArray storedScores;
NSMutableDictionary storedAchievements;
public PlayerModel ()
{
string id = GKLocalPlayer.LocalPlayer.PlayerID;
storedScoresFilename = id.Substring(id.IndexOf(":")+1)+"storedScores.plist";
storedAchievementsFilename = id.Substring(id.IndexOf(":")+1)+"storedAchievements.plist";
}
/* ************************************************************************
*
* Scores
*
* *************************************************************************
*/
// Store score for submission at a later time
public void storeScore (GKScore score)
{
storedScores.Add (score);
this.writeStoredScore ();
}
// Attempt to resubmit the scoress
public void resubmitSotredScores()
{
if (GKLocalPlayer.LocalPlayer.Authenticated && storedScores.Count != 0)
{
int index =(int) storedScores.Count - 1;
while (index >=0)
{
GKScore score = new GKScore (storedScores.ValueAt ((uint)index));
score.ShouldSetDefaultLeaderboard = true;
if (score == null)
return;
score.ReportScore (new GKNotificationHandler( (error) =>
{
if(error == null)
{
new UIAlertView ("Score Submitted", "Score submitted successfully ", null, "OK", null).Show();
}
else
{
this.storeScore(score);
new UIAlertView ("Score Stored", "Score Stored ", null, "OK", null).Show();
}
}));
storedScores.RemoveObject(index);
index --;
}
}
}
//Save stored scores to file
public void writeStoredScore()
{
NSError err;
NSData archivedScore = NSKeyedArchiver.ArchivedDataWithRootObject (storedScores);
archivedScore.Save (this.storedScoresFilename, NSDataWritingOptions.FileProtectionNone, out err);
if (err != null)
Console.WriteLine ("Error when saving stored scores.");
}
// Load stored scores from disk
public void loadStoredScores()
{
NSArray unarchivedObj = (NSArray) NSKeyedUnarchiver.UnarchiveFile (this.storedScoresFilename);
if (unarchivedObj != null)
{
storedScores = (NSMutableArray) unarchivedObj;
this.resubmitSotredScores ();
} else
{
storedScores = new NSMutableArray ();
}
}
// Attemp to submit a score. On an error store it for a later time
public void submitScore(GKScore score)
{
if (GKLocalPlayer.LocalPlayer.Authenticated)
{
if (score == null)
return;
score.ReportScore (new GKNotificationHandler( (error) =>
{
//if(error == null|| (error.Code ==null && error.Domain == null))
if(error == null)
{
this.resubmitSotredScores();
new UIAlertView ("Score Submitted", "Score submitted successfully ", null, "OK", null).Show();
}
else
{
this.storeScore(score);
new UIAlertView ("Score Stored", "Score Stored ", null, "OK", null).Show();
}
}));
}
}
/* ************************************************************************
*
* Achivements
*
* *************************************************************************
*/
// Create an entry for an achievement that hasn't been submitted to the server
void storeAchievement(GKAchievement achievement)
{
GKAchievement currentStorage = (GKAchievement) storedAchievements.ValueForKey (new NSString(achievement.Identifier));
if (currentStorage == null) {
storedAchievements.Add(new NSString(achievement.Identifier),achievement);
}
else if (currentStorage.PercentComplete < achievement.PercentComplete) {
storedAchievements.SetValueForKey (achievement, new NSString (achievement.Identifier));
this.writeStoredAchievements ();
}
}
// store achievements to disk to submit at a later time.
void writeStoredAchievements()
{
NSError err;
NSData archivedScore = NSKeyedArchiver.ArchivedDataWithRootObject (storedAchievements);
archivedScore.Save (this.storedAchievementsFilename, NSDataWritingOptions.FileProtectionNone, out err);
if (err != null)
Console.WriteLine ("Error when saving stored achievements.");
}
// Submit an achievement to the server and store if submission fails
public void submitAchievement(GKAchievement achievement)
{
if (achievement != null) {
//submit the achievement
achievement.ReportAchievement (new GKNotificationHandler ((error) => {
if (error == null) {
if (storedAchievements.ContainsKey (new NSString(achievement.Identifier)))
storedAchievements.Remove (new NSString(achievement.Identifier));
new UIAlertView ("Achievement Submitted", "Achievement submitted successfully ", null, "OK", null).Show ();
} else {
this.storeAchievement (achievement);
new UIAlertView ("Achievement Stored", "Achievement Stored ", null, "OK", null).Show ();
}
}));
}
}
// Load stored achievements and attempt to submit them
public void loadSotredAchievements()
{
if (storedAchievements == null)
{
NSMutableDictionary unarchivedObj = (NSMutableDictionary) NSKeyedUnarchiver.UnarchiveFile (this.storedAchievementsFilename);
if (unarchivedObj != null)
{
this.resubmitStoredAchievements ();
} else
{
storedAchievements = new NSMutableDictionary ();
}
}
}
// Try to submit all stored achievements to update any achievements that were not successful.
public void resubmitStoredAchievements()
{
if (storedAchievements != null) {
foreach (NSString key in storedAchievements.Keys) {
GKAchievement achievement = (GKAchievement) storedAchievements.ObjectForKey (key);
this.submitAchievement (achievement);
}
}
}
// Reset all the achievements for local player
public void resetAchievements()
{
GKAchievement.ResetAchivements (new GKNotificationHandler (delegate(NSError error) {
if(error == null)
new UIAlertView ("Achievement reset", "Achievement reset successfully", null, "OK", null).Show ();
else
new UIAlertView ("Reset failed", "Reset failed because: " + error, null, "OK", null).Show ();
}));
}
}
}

Просмотреть файл

@ -0,0 +1,18 @@
GameCenterSample
================
A sample demonstrating how to enable Game Center support in monotouch. It shows how to authenticate with GameKit as well as how to report score and achievement.
This sample based on Apple's Game Center example:
https://developer.apple.com/library/ios/samplecode/GKAchievements/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011367
https://developer.apple.com/library/ios/samplecode/GKLeaderboards/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011368
https://developer.apple.com/library/ios/samplecode/GKAuthentication/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010933
Authors
-------
Bo Pang

Двоичные данные
GameCenterSample/GameCenterSample/Resources/Default-568h@2x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 12 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 24 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 9.4 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 25 KiB

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 9.8 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/Default.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.2 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/Default@2x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 12 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/Icon-Small.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/Icon-Small@2x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.2 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/Icon.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.1 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/Icon@2x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 14 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/iTunesArtwork Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 106 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/iTunesArtwork.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 106 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/iTunesArtwork@2x Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 273 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/iTunesArtwork@2x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 273 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/icon-100.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 11 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/icon-114.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 14 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/icon-144.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 18 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/icon-29.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/icon-50.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.2 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/icon-57.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.1 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/icon-58.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.2 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Resources/icon-72.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 6.6 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Screenshots/GameKitSample1.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 118 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Screenshots/GameKitSample2.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 186 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Screenshots/GameKitSample3.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 432 KiB

Двоичные данные
GameCenterSample/GameCenterSample/Screenshots/GameKitSample4.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 434 KiB

50
MTGKTapper/.irb-history Normal file
Просмотреть файл

@ -0,0 +1,50 @@
y
for i in 1..360
for j in 1..480
print i,' ',j
puts
end
endy
for i in 1..360
for j in 1..480
print i,' ',j
puts
end
end
run
lakdf
aq
'sdasdf
asd
f
as
dfa
sdf
as
q
1
123
1
quit
;
'
?
>
*
q
asdf
qwe
df
as
df
xzc
v
sd
quit
clear
auit
auit
auit
auit
auit
asdf

32
MTGKTapper/MTGKTapper.sln Normal file
Просмотреть файл

@ -0,0 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTGKTapper", "MTGKTapper\MTGKTapper.csproj", "{FFFD9C88-1625-4A58-81A7-7783AF80E475}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|iPhoneSimulator = Release|iPhoneSimulator
Debug|iPhone = Debug|iPhone
Release|iPhone = Release|iPhone
Ad-Hoc|iPhone = Ad-Hoc|iPhone
AppStore|iPhone = AppStore|iPhone
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FFFD9C88-1625-4A58-81A7-7783AF80E475}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
{FFFD9C88-1625-4A58-81A7-7783AF80E475}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
{FFFD9C88-1625-4A58-81A7-7783AF80E475}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
{FFFD9C88-1625-4A58-81A7-7783AF80E475}.AppStore|iPhone.Build.0 = AppStore|iPhone
{FFFD9C88-1625-4A58-81A7-7783AF80E475}.Debug|iPhone.ActiveCfg = Debug|iPhone
{FFFD9C88-1625-4A58-81A7-7783AF80E475}.Debug|iPhone.Build.0 = Debug|iPhone
{FFFD9C88-1625-4A58-81A7-7783AF80E475}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{FFFD9C88-1625-4A58-81A7-7783AF80E475}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{FFFD9C88-1625-4A58-81A7-7783AF80E475}.Release|iPhone.ActiveCfg = Release|iPhone
{FFFD9C88-1625-4A58-81A7-7783AF80E475}.Release|iPhone.Build.0 = Release|iPhone
{FFFD9C88-1625-4A58-81A7-7783AF80E475}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{FFFD9C88-1625-4A58-81A7-7783AF80E475}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = MTGKTapper\MTGKTapper.csproj
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace MTGKTapper
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
// class-level declarations
UIWindow window;
MTGKTapperViewController viewController;
//
// 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)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
viewController = new MTGKTapperViewController ();
window.RootViewController = viewController;
window.MakeKeyAndVisible ();
return true;
}
}
}

Просмотреть файл

@ -0,0 +1,122 @@
using System;
using MonoTouch.Foundation;
using MonoTouch.GameKit;
using MonoTouch.UIKit;
namespace MTGKTapper
{
public class GameCenterManager
{
NSMutableDictionary earnedAchievementCache;
public GameCenterManager ()
{
}
public static bool isGameCenterAvailable()
{
return UIDevice.CurrentDevice.CheckSystemVersion (4, 1);
}
public GKLeaderboard reloadLeaderboard(string category)
{
GKLeaderboard leaderboard = new GKLeaderboard ();
leaderboard.Category = category;
leaderboard.TimeScope = GKLeaderboardTimeScope.AllTime;
leaderboard.Range = new NSRange (1, 1);
return leaderboard;
}
public void reportScore(long score, string category, MTGKTapperViewController controller)
{
GKScore scoreReporter = new GKScore (category);
scoreReporter.Value = score;
scoreReporter.ReportScore (new GKNotificationHandler ((error) => {
if(error == null){
new UIAlertView ("Score reported", "Score Reported successfully", null, "OK", null).Show ();
}
else{
new UIAlertView ("Score Reported Failed", "Score Reported Failed", null, "OK", null).Show ();
}
NSThread.SleepFor(1);
controller.updateHighScore();
}));
}
public void submitAchievement(string identifier, double percentComplete, string achievementName)
{
if(earnedAchievementCache == null)
{
GKAchievement.LoadAchievements (new GKCompletionHandler (delegate(GKAchievement[] achievements, NSError error) {
NSMutableDictionary tempCache = new NSMutableDictionary();
if(achievements !=null)
{
foreach(var achievement in achievements)
{
tempCache.Add(new NSString(achievement.Identifier), achievement);
}
}
earnedAchievementCache = tempCache;
submitAchievement(identifier,percentComplete,achievementName);
}));
}
else
{
GKAchievement achievement =(GKAchievement) earnedAchievementCache.ValueForKey (new NSString(identifier));
if (achievement != null)
{
if (achievement.PercentComplete >= 100.0 || achievement.PercentComplete >= percentComplete)
{
achievement = null;
}
else
achievement.PercentComplete = percentComplete;
}
else
{
achievement = new GKAchievement(identifier);
achievement.PercentComplete = percentComplete;
earnedAchievementCache.Add(new NSString(achievement.Identifier),achievement);
}
if(achievement != null)
{
achievement.ReportAchievement (new GKNotificationHandler (delegate(NSError error) {
if(error == null && achievement != null)
{
if(percentComplete == 100)
{
new UIAlertView ("Achievement Earned", "Great job! You earned an achievement: " + achievementName, null, "OK", null).Show ();
}
else if(percentComplete >0)
{
new UIAlertView ("Achievement Progress", "Great job! You're "+percentComplete+" % of the way to " + achievementName, null, "OK", null).Show ();
}
}
else
{
new UIAlertView ("Achievement submittion failed", "Submittion failed because: " + error, null, "OK", null).Show ();
}
}));
}
}
}
public void resetAchievement()
{
earnedAchievementCache = null;
GKAchievement.ResetAchivements (new GKNotificationHandler (delegate(NSError error) {
if(error == null)
new UIAlertView ("Achievement reset", "Achievement reset successfully", null, "OK", null).Show ();
else
new UIAlertView ("Reset failed", "Reset failed because: " + error, null, "OK", null).Show ();
}));
}
}
}

Просмотреть файл

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.appledts.GKTapper</string>
<key>CFBundleIconFiles</key>
<array>
<string>Icon</string>
<string>Icon@2x</string>
<string>Icon-Small</string>
<string>Icon-Small@2x</string>
</array>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{FFFD9C88-1625-4A58-81A7-7783AF80E475}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>MTGKTapper</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>MTGKTapper</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchLink>None</MtouchLink>
<ConsolePause>false</ConsolePause>
<MtouchDebug>true</MtouchDebug>
<MtouchI18n />
<MtouchArch>ARMv7</MtouchArch>
<MtouchExtraArgs>-gcc_flags "-framework CFNetwork -framework CoreGraphics -force_load /Users/bopang/repos/QualityAssurance/Automation/Calabash/calabash.framework/calabash -lstdc++"</MtouchExtraArgs>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchLink>None</MtouchLink>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchDebug>true</MtouchDebug>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchExtraArgs>-gcc_flags "-framework CFNetwork -framework CoreGraphics -force_load $(ProjectDir)/../..aQualityAssurance/Automation/Calabash/calabash.framework/calabash -lstdc++"</MtouchExtraArgs>
<IpaPackageName />
<MtouchI18n />
<MtouchArch>ARMv7</MtouchArch>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Ad-Hoc</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Distribution</CodesignKey>
<BuildIpa>true</BuildIpa>
<ConsolePause>false</ConsolePause>
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\AppStore</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Distribution</CodesignKey>
<ConsolePause>false</ConsolePause>
<CodesignProvision>Automatic:AppStore</CodesignProvision>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="MTGKTapperViewController.cs" />
<Compile Include="MTGKTapperViewController.designer.cs">
<DependentUpon>MTGKTapperViewController.cs</DependentUpon>
</Compile>
<Compile Include="GameCenterManager.cs" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="MTGKTapperViewController.xib" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<BundleResource Include="Resources\Icon.png" />
<BundleResource Include="Resources\Icon%402x.png" />
<BundleResource Include="Resources\Icon-Small.png" />
<BundleResource Include="Resources\Icon-Small%402x.png" />
<BundleResource Include="Resources\Default.png" />
<BundleResource Include="Resources\Default%402x.png" />
<BundleResource Include="Resources\Default-568h%402x.png" />
</ItemGroup>
<ItemGroup>
<ITunesArtwork Include="Resources\iTunesArtwork" />
<ITunesArtwork Include="Resources\iTunesArtwork%402x" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,237 @@
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.GameKit;
namespace MTGKTapper
{
public partial class MTGKTapperViewController : UIViewController
{
public const string EasyLeaderboardID = "com.appledts.EasyTapList";
public const string HardLeaderboardID = "com.appledts.HardTapList";
public const string AwesomeLeaderboardID = "com.appledts.AwesomeTapList";
public const string AchievementGotOneTap = "com.appletest.one_tap";
public const string AchievementHidden20Taps = "com.appledts.twenty_taps";
public const string AchievementBigOneHundred = "com.appledts.one_hundred_taps";
public const string AchievementNameGotOneTap = "Just One Tap";
public const string AchievementNameHidden20Taps = "Twenty Taps In";
public const string AchievementNameBigOneHundred = "The Big One Hundred";
GameCenterManager gameCenterManager;
GKLeaderboard currentLeaderBoard;
string currentCategory = EasyLeaderboardID;
long currentScore = 0;
public MTGKTapperViewController () : base ("MTGKTapperViewController", null)
{
}
public override void DidReceiveMemoryWarning ()
{
// Releases the view if it doesn't have a superview.
base.DidReceiveMemoryWarning ();
// Release any cached data, images, etc that aren't in use.
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// Perform any additional setup after loading the view, typically from a nib.
initGameCenter ();
string[] categories = {"Easy","Hard","Awesome"};
UIActionSheet selectCategory = new UIActionSheet("Choose Leaderboard",null,"Cancel",null,categories);
selectCategory.Dismissed += (sender, e) => {
switch (e.ButtonIndex)
{
case 0:
currentCategory = EasyLeaderboardID;
this.selectLeaderBoardButton.SetTitle("Leaderboard: Easy",UIControlState.Normal);
currentScore = 0;
currentScoreTextField.Text = "0";
break;
case 1:
currentCategory = HardLeaderboardID;
this.selectLeaderBoardButton.SetTitle("Leaderboard: Hard",UIControlState.Normal);
currentScore = 0;
currentScoreTextField.Text = "0";
break;
case 2:
currentCategory = AwesomeLeaderboardID;
this.selectLeaderBoardButton.SetTitle("Leaderboard: Awesome",UIControlState.Normal);
currentScore = 0;
currentScoreTextField.Text = "0";
break;
default:
break;
}
currentLeaderBoard = gameCenterManager.reloadLeaderboard(currentCategory);
updateHighScore();
};
this.selectLeaderBoardButton.TouchUpInside += (sender, e) => {
selectCategory.ShowInView(this.View);
};
this.showLeaderboardButton.TouchUpInside += (sender, e) => {
GKLeaderboardViewController leaderboardController = new GKLeaderboardViewController();
leaderboardController.Category = currentCategory;
leaderboardController.TimeScope = GKLeaderboardTimeScope.AllTime;
leaderboardController.DidFinish += (senderLeaderboard, eLeaderboard) => {
leaderboardController.DismissViewController(true, null);
};
PresentViewController(leaderboardController, true,null);
};
this.showAchievementButton.TouchUpInside += (sender, e) => {
GKAchievementViewController achievementController = new GKAchievementViewController();
achievementController.DidFinish += (senderAchievement, eAchievement) => {
achievementController.DismissViewController(true, null);
};
PresentViewController(achievementController, true, null);
};
this.incrementScoreButton.TouchUpInside += (sender, e) => {
currentScore++;
currentScoreTextField.Text = currentScore.ToString();
checkAchievements();
};
this.submitScoreButton.TouchUpInside += (sender, e) => {
if(currentScore >0)
gameCenterManager.reportScore(currentScore,currentCategory,this);
};
this.resetButton.TouchUpInside += (sender, e) => {
gameCenterManager.resetAchievement();
};
}
public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
{
// Return true for supported orientations
return (toInterfaceOrientation != UIInterfaceOrientation.PortraitUpsideDown);
}
void initGameCenter()
{
if (GameCenterManager.isGameCenterAvailable ()) {
this.gameCenterManager = new GameCenterManager ();
setAuthenticateHandler ();
} else {
new UIAlertView ("Game Center Support Required", "The current device does not support Game Center, which this sample requires.", null, "OK", null).Show ();
}
}
void setAuthenticateHandler()
{
if (UIDevice.CurrentDevice.CheckSystemVersion (6, 0)) {
GKLocalPlayer.LocalPlayer.AuthenticateHandler = (ui, error) =>
{
if (ui != null) {
this.PresentViewController (ui, true, null);
}
else if (GKLocalPlayer.LocalPlayer.Authenticated) {
currentLeaderBoard = gameCenterManager.reloadLeaderboard (currentCategory);
updateHighScore ();
} else {
var alert = new UIAlertView ("Game Center Account Required", "Need login the game center!", null, "Retry", null);
alert.Clicked += (sender, e) => {
//GKLocalPlayer.LocalPlayer.Authenticated();
};
alert.Show ();
}
};
}
else
{
GKLocalPlayer.LocalPlayer.Authenticate(new GKNotificationHandler(delegate(NSError error) {
if (GKLocalPlayer.LocalPlayer.Authenticated) {
currentLeaderBoard = gameCenterManager.reloadLeaderboard (currentCategory);
updateHighScore ();
}
else
{
var alert = new UIAlertView ("Game Center Account Required", "Need login the game center!", null, "Retry", null);
alert.Clicked += (sender, e) => {
setAuthenticateHandler();
};
alert.Show ();
}
}));
}
}
public void updateHighScore()
{
currentLeaderBoard.LoadScores (new GKScoresLoadedHandler (delegate(GKScore[] scoreArray, NSError error) {
if(error == null){
long personalBest;
if(currentLeaderBoard.LocalPlayerScore != null)
personalBest = currentLeaderBoard.LocalPlayerScore.Value;
else
personalBest = 0;
playerBestScoreTextField.Text = personalBest.ToString ();
if (currentLeaderBoard.Scores.Length > 0) {
globalHighestScoreTextField.Text = currentLeaderBoard.Scores [0].Value.ToString ();
}
}
else{
playerBestScoreTextField.Text = "Unavailable";
globalHighestScoreTextField.Text = "Unavailable";
}
}));
}
void checkAchievements()
{
string identifier = null;
string achievementName = null;
double percentComplete = 0;
switch (currentScore) {
case 1:
identifier = AchievementGotOneTap;
percentComplete = 100.0;
achievementName = AchievementNameGotOneTap;
break;
case 10:
identifier = AchievementHidden20Taps;
percentComplete = 50.0;
achievementName = AchievementNameHidden20Taps;
break;
case 20:
identifier = AchievementHidden20Taps;
percentComplete = 100.0;
achievementName = AchievementNameHidden20Taps;
break;
case 50:
identifier = AchievementBigOneHundred;
percentComplete = 50.0;
achievementName = AchievementNameHidden20Taps;
break;
case 75:
identifier = AchievementBigOneHundred;
percentComplete = 75.0;
achievementName = AchievementNameBigOneHundred;
break;
case 100:
identifier = AchievementBigOneHundred;
percentComplete = 100.0;
achievementName = AchievementNameBigOneHundred;
break;
}
if (identifier != null) {
gameCenterManager.submitAchievement (identifier, percentComplete, achievementName);
}
}
}
}

90
MTGKTapper/MTGKTapper/MTGKTapperViewController.designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,90 @@
// WARNING
//
// This file has been generated automatically by Xamarin Studio to store outlets and
// actions made in the UI designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using MonoTouch.Foundation;
using System.CodeDom.Compiler;
namespace MTGKTapper
{
[Register ("MTGKTapperViewController")]
partial class MTGKTapperViewController
{
[Outlet]
MonoTouch.UIKit.UILabel currentScoreTextField { get; set; }
[Outlet]
MonoTouch.UIKit.UILabel globalHighestScoreTextField { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton incrementScoreButton { get; set; }
[Outlet]
MonoTouch.UIKit.UILabel playerBestScoreTextField { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton resetButton { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton selectLeaderBoardButton { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton showAchievementButton { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton showLeaderboardButton { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton submitScoreButton { get; set; }
void ReleaseDesignerOutlets ()
{
if (currentScoreTextField != null) {
currentScoreTextField.Dispose ();
currentScoreTextField = null;
}
if (playerBestScoreTextField != null) {
playerBestScoreTextField.Dispose ();
playerBestScoreTextField = null;
}
if (globalHighestScoreTextField != null) {
globalHighestScoreTextField.Dispose ();
globalHighestScoreTextField = null;
}
if (incrementScoreButton != null) {
incrementScoreButton.Dispose ();
incrementScoreButton = null;
}
if (submitScoreButton != null) {
submitScoreButton.Dispose ();
submitScoreButton = null;
}
if (selectLeaderBoardButton != null) {
selectLeaderBoardButton.Dispose ();
selectLeaderBoardButton = null;
}
if (showLeaderboardButton != null) {
showLeaderboardButton.Dispose ();
showLeaderboardButton = null;
}
if (showAchievementButton != null) {
showAchievementButton.Dispose ();
showAchievementButton = null;
}
if (resetButton != null) {
resetButton.Dispose ();
resetButton = null;
}
}
}
}

Просмотреть файл

@ -0,0 +1,641 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1552</int>
<string key="IBDocument.SystemVersion">12C60</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.34</string>
<string key="IBDocument.HIToolboxVersion">625.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">2083</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBProxyObject</string>
<string>IBUIButton</string>
<string>IBUILabel</string>
<string>IBUIPickerView</string>
<string>IBUIView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="843779117">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="774585933">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUILabel" id="71772250">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{21, 20}, {116, 21}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="160489463"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Current Score: </string>
<object class="NSColor" key="IBUITextColor" id="189495697">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="370928082">
<int key="type">1</int>
<double key="pointSize">17</double>
</object>
<object class="NSFont" key="IBUIFont" id="387302400">
<string key="NSName">Helvetica</string>
<double key="NSSize">17</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUIButton" id="568381073">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{24, 65}, {120, 36}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="118324922"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Increment Score</string>
<object class="NSColor" key="IBUIHighlightedTitleColor" id="321494425">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4yODY5NzU3MjU2IDAuNzUwMDI1NDg5NyAxAA</bytes>
</object>
<object class="NSColor" key="IBUINormalTitleShadowColor" id="736711977">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="794535576">
<int key="type">2</int>
<double key="pointSize">13</double>
</object>
<object class="NSFont" key="IBUIFont" id="605971884">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">13</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUIButton" id="118324922">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{177, 65}, {120, 36}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="5069775"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Submit Score</string>
<reference key="IBUIHighlightedTitleColor" ref="321494425"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4yODY5NzU3MjU2IDAuNzUwMDI1NDg5NyAxAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="736711977"/>
<reference key="IBUIFontDescription" ref="794535576"/>
<reference key="IBUIFont" ref="605971884"/>
</object>
<object class="IBUIButton" id="5069775">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{44, 141}, {233, 36}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="532444230"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Leaderboard : Easy</string>
<reference key="IBUIHighlightedTitleColor" ref="321494425"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="736711977"/>
<object class="IBUIFontDescription" key="IBUIFontDescription" id="699756922">
<int key="type">2</int>
<double key="pointSize">15</double>
</object>
<object class="NSFont" key="IBUIFont" id="593998293">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
</object>
<object class="IBUILabel" id="532444230">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{21, 199}, {85, 21}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="482866263"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Your Best: </string>
<reference key="IBUITextColor" ref="189495697"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<reference key="IBUIFontDescription" ref="370928082"/>
<reference key="IBUIFont" ref="387302400"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUILabel" id="742982343">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{21, 239}, {63, 21}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="474528869"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Highest:</string>
<reference key="IBUITextColor" ref="189495697"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<reference key="IBUIFontDescription" ref="370928082"/>
<reference key="IBUIFont" ref="387302400"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUIButton" id="382501999">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{77, 289}, {160, 36}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="431355766"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Show Leaderboard</string>
<reference key="IBUIHighlightedTitleColor" ref="321494425"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="736711977"/>
<reference key="IBUIFontDescription" ref="699756922"/>
<reference key="IBUIFont" ref="593998293"/>
</object>
<object class="IBUILabel" id="482866263">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{107, 194}, {190, 26}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="742982343"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">0</string>
<reference key="IBUITextColor" ref="189495697"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<int key="IBUITextAlignment">2</int>
<reference key="IBUIFontDescription" ref="370928082"/>
<reference key="IBUIFont" ref="387302400"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUILabel" id="474528869">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{114, 239}, {183, 21}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="382501999"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">100</string>
<reference key="IBUITextColor" ref="189495697"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<int key="IBUITextAlignment">2</int>
<reference key="IBUIFontDescription" ref="370928082"/>
<reference key="IBUIFont" ref="387302400"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
<object class="IBUIButton" id="431355766">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{77, 337}, {160, 36}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="975744763"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Show Achievements</string>
<reference key="IBUIHighlightedTitleColor" ref="321494425"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="736711977"/>
<reference key="IBUIFontDescription" ref="699756922"/>
<reference key="IBUIFont" ref="593998293"/>
</object>
<object class="IBUIButton" id="975744763">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{77, 395}, {160, 36}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<int key="IBUIButtonType">1</int>
<string key="IBUINormalTitle">Reset Achievements</string>
<reference key="IBUIHighlightedTitleColor" ref="321494425"/>
<object class="NSColor" key="IBUINormalTitleColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC43NTM1MjQxMTY4IDAuMTY5ODMzNzk0OCAwAA</bytes>
</object>
<reference key="IBUINormalTitleShadowColor" ref="736711977"/>
<reference key="IBUIFontDescription" ref="699756922"/>
<reference key="IBUIFont" ref="593998293"/>
</object>
<object class="IBUILabel" id="160489463">
<reference key="NSNextResponder" ref="774585933"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{145, 20}, {147, 21}}</string>
<reference key="NSSuperview" ref="774585933"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="568381073"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">0</string>
<reference key="IBUITextColor" ref="189495697"/>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<int key="IBUITextAlignment">2</int>
<reference key="IBUIFontDescription" ref="370928082"/>
<reference key="IBUIFont" ref="387302400"/>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
</array>
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="71772250"/>
<reference key="IBUIBackgroundColor" ref="321494425"/>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<array key="IBUIGestureRecognizers" id="0"/>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIPickerView" id="502427136">
<nil key="NSNextResponder"/>
<int key="NSvFlags">290</int>
<string key="NSFrameSize">{320, 216}</string>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBUIShowsSelectionIndicator">YES</bool>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="774585933"/>
</object>
<int key="connectionID">7</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">currentScoreTextField</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="160489463"/>
</object>
<int key="connectionID">30</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">incrementScoreButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="568381073"/>
</object>
<int key="connectionID">31</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">submitScoreButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="118324922"/>
</object>
<int key="connectionID">32</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">selectLeaderBoardButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="5069775"/>
</object>
<int key="connectionID">33</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">playerBestScoreTextField</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="482866263"/>
</object>
<int key="connectionID">34</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">globalHighestScoreTextField</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="474528869"/>
</object>
<int key="connectionID">35</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">showLeaderboardButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="382501999"/>
</object>
<int key="connectionID">36</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">showAchievementButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="431355766"/>
</object>
<int key="connectionID">37</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">resetButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="975744763"/>
</object>
<int key="connectionID">38</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<reference key="object" ref="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="843779117"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="774585933"/>
<array class="NSMutableArray" key="children">
<reference ref="568381073"/>
<reference ref="118324922"/>
<reference ref="532444230"/>
<reference ref="742982343"/>
<reference ref="482866263"/>
<reference ref="474528869"/>
<reference ref="382501999"/>
<reference ref="71772250"/>
<reference ref="5069775"/>
<reference ref="160489463"/>
<reference ref="431355766"/>
<reference ref="975744763"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">13</int>
<reference key="object" ref="71772250"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">14</int>
<reference key="object" ref="568381073"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="118324922"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="502427136"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="5069775"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="532444230"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="742982343"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="382501999"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">24</int>
<reference key="object" ref="482866263"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
<reference key="object" ref="474528869"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="431355766"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">28</int>
<reference key="object" ref="975744763"/>
<reference key="parent" ref="774585933"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">29</int>
<reference key="object" ref="160489463"/>
<reference key="parent" ref="774585933"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">MTGKTapperViewController</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="13.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="14.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<real value="0.0" key="14.IBUIButtonInspectorSelectedEdgeInsetMetadataKey"/>
<real value="0.0" key="14.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
<string key="15.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="19.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="20.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="21.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="22.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="24.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="26.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="27.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="28.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="29.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">38</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">MTGKTapperViewController</string>
<string key="superclassName">UIViewController</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="currentScoreTextField">UILabel</string>
<string key="globalHighestScoreTextField">UILabel</string>
<string key="incrementScoreButton">UIButton</string>
<string key="playerBestScoreTextField">UILabel</string>
<string key="resetButton">UIButton</string>
<string key="selectLeaderBoardButton">UIButton</string>
<string key="showAchievementButton">UIButton</string>
<string key="showLeaderboardButton">UIButton</string>
<string key="submitScoreButton">UIButton</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="currentScoreTextField">
<string key="name">currentScoreTextField</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="globalHighestScoreTextField">
<string key="name">globalHighestScoreTextField</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="incrementScoreButton">
<string key="name">incrementScoreButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="playerBestScoreTextField">
<string key="name">playerBestScoreTextField</string>
<string key="candidateClassName">UILabel</string>
</object>
<object class="IBToOneOutletInfo" key="resetButton">
<string key="name">resetButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="selectLeaderBoardButton">
<string key="name">selectLeaderBoardButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="showAchievementButton">
<string key="name">showAchievementButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="showLeaderboardButton">
<string key="name">showLeaderboardButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="submitScoreButton">
<string key="name">submitScoreButton</string>
<string key="candidateClassName">UIButton</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/MTGKTapperViewController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<string key="IBCocoaTouchPluginVersion">2083</string>
</data>
</archive>

Просмотреть файл

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace MTGKTapper
{
public class Application
{
// This is the main entry point of the application.
static void Main (string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, "AppDelegate");
}
}
}

Просмотреть файл

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<SampleMetadata>
<ID>f00bf4cd-2ac3-4a46-b450-36dc7b238b6c</ID>
<IsFullApplication>false</IsFullApplication>
<Level>Beginning</Level>
<Tags>Game Center</Tags>
<LicenseRequirement>Starter</LicenseRequirement>
</SampleMetadata>

Просмотреть файл

@ -0,0 +1,15 @@
GameCenterSample
================
A sample demonstrating how to enable Game Center support in Monotouch.
This sample based on Apple's Game Center example:
https://developer.apple.com/library/ios/samplecode/GKTapper/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010283
Authors
-------
Bo Pang

Двоичные данные
MTGKTapper/MTGKTapper/Resources/Default-568h@2x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 12 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/Default-Landscape@2x~ipad.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 24 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/Default-Landscape~ipad.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 9.4 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/Default-Portrait@2x~ipad.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 25 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/Default-Portrait~ipad.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 9.8 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/Default.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.2 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/Default@2x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 12 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/Icon-Small.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/Icon-Small@2x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.2 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/Icon.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.1 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/Icon@2x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 14 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/iTunesArtwork Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 106 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/iTunesArtwork.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 106 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/iTunesArtwork@2x Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 273 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/iTunesArtwork@2x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 273 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/icon-100.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 11 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/icon-114.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 14 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/icon-144.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 18 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/icon-29.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/icon-50.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.2 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/icon-57.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.1 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/icon-58.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 5.2 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Resources/icon-72.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 6.6 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Screenshots/MTGKTapper1.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 123 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Screenshots/MTGKTapper2.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 124 KiB

Двоичные данные
MTGKTapper/MTGKTapper/Screenshots/MTGKTapper3.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 193 KiB