//-------------------------------------- // Connection //-------------------------------------- public void Connect() { if (!_IsInitedCalled) { Init(); } if (_ConnectionSate == UM_ConnectionState.CONNECTED || _ConnectionSate == UM_ConnectionState.CONNECTING) { return; } switch (Application.platform) { case RuntimePlatform.IPhonePlayer: GameCenterManager.Init(); break; case RuntimePlatform.Android: if (UltimateMobileSettings.Instance.PlatformEngine == UM_PlatformDependencies.Amazon) { SA_AmazonGameCircleManager.Instance.Connect(); } else { GooglePlayConnection.Instance.Connect(); } break; } SetConnectionState(UM_ConnectionState.CONNECTING); }
//private string TEST_ACHIEVEMENT_1_ID = "com.bocean.game.casinoslots2.mega_jackpot_win"; //private string TEST_ACHIEVEMENT_2_ID = "com.bocean.game.casinoslots2.lucky_jackpot_win"; //private string TEST_ACHIEVEMENT_3_ID = "com.bocean.game.casinoslots2.jackpot_win"; //private string TEST_ACHIEVEMENT_4_ID = "com.bocean.game.casinoslots2.lucky_jewel_win"; //private string TEST_ACHIEVEMENT_5_ID = "com.bocean.game.casinoslots2.lucky_seven_win"; //private string TEST_ACHIEVEMENT_6_ID = "com.bocean.game.casinoslots2.4_of_a_kind"; //private string TEST_ACHIEVEMENT_7_ID = "com.bocean.game.casinoslots2.full_house"; //private string TEST_ACHIEVEMENT_8_ID = "com.bocean.game.casinoslots2.two_pairs"; //private string TEST_ACHIEVEMENT_9_ID = "com.bocean.game.casinoslots2.3_of_a_kind"; //private string TEST_ACHIEVEMENT_10_ID = "com.bocean.game.casinoslots2.pair_win"; void Start() { if (!IsInitialized) { //Achievement registration. If you skip this step GameCenterManager.achievements array will contain only achievements with reported progress //GameCenterManager.RegisterAchievement (TEST_ACHIEVEMENT_1_ID); //GameCenterManager.RegisterAchievement (TEST_ACHIEVEMENT_2_ID); //Listen for the Game Center events //GameCenterManager.OnAchievementsProgress += HandleOnAchievementsProgress; //GameCenterManager.OnAchievementsReset += HandleOnAchievementsReset; //.OnAchievementsLoaded += OnAchievementsLoaded; GameCenterManager.OnScoreSubmitted += OnScoreSubmitted; GameCenterManager.OnLeadrboardInfoLoaded += OnLeadrboardInfoLoaded; GameCenterManager.OnAuthFinished += OnAuthFinished; //Initializing Game Center class. This action will trigger authentication flow GameCenterManager.Init(); IsInitialized = true; } }
void Awake() { GameCenterManager.OnAuthFinished += HandleOnAuthFinished; //Initializing Game Center class. This action will trigger authentication flow GameCenterManager.Init(); }
//-------------------------------------- // Connection //-------------------------------------- public void Connect() { if (!_IsInitedCalled) { Init(); } if (_ConnectionSate == UM_ConnectionState.CONNECTED || _ConnectionSate == UM_ConnectionState.CONNECTING) { return; } switch (Application.platform) { case RuntimePlatform.IPhonePlayer: GameCenterManager.Init(); break; case RuntimePlatform.Android: GooglePlayConnection.Instance.Connect(); break; } _ConnectionSate = UM_ConnectionState.CONNECTING; }
//-------------------------------------- // INITIALIZE //-------------------------------------- void Awake() { GameCenterManager.Init(); GameCenter_RTM.ActionMatchStarted += HandleActionMatchStarted; GameCenter_RTM.ActionPlayerStateChanged += HandleActionPlayerStateChanged; GameCenter_RTM.ActionDataReceived += HandleActionDataReceived; }
//-------------------------------------- // PUBLIC METHODS //-------------------------------------- void OnGUI() { UpdateToStartPos(); GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "GameCenter Game Saves", style); StartY += YLableStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Init")) { GameCenterManager.OnAuthFinished += HandleOnAuthFinished; GameCenterManager.Init(); } StartY += YButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Save Game")) { Save(test_name); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Save Game 2")) { Save(test_name_2); } StartX = XStartPos; StartY += YButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Fetch Saved Games")) { Fetch(); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Load Saved Game")) { Load(); } StartX = XStartPos; StartY += YButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Delete Saved Game")) { Delete(test_name); } StartX += XButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Delete Saved Game 2")) { Delete(test_name_2); } StartX = XStartPos; StartY += YButtonStep; if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Resolve Conflicts")) { ResolveConflicts(); } }
public static GameCenterManager GetInstance() { if (gameCenterManager == null) { gameCenterManager = new GameCenterManager(); gameCenterManager.Init(); } return(gameCenterManager); }
void Awake() { GameCenterManager.OnAuthFinished += OnAuthFinished; GameCenterManager.OnScoresListLoaded += OnScoresListLoaded; //Initializing Game Center class. This action will trigger authentication flow GameCenterManager.Init(); }
//-------------------------------------- // INITIALIZE //-------------------------------------- void Awake() { GameCenterManager.Init(); GameCenter_RTM.ActionMatchStarted += HandleActionMatchStarted; GameCenter_RTM.ActionPlayerStateChanged += HandleActionPlayerStateChanged; GameCenter_RTM.ActionDataReceived += HandleActionDataReceived; GameCenterInvitations.ActionPlayerRequestedMatchWithRecipients += HandleActionPlayerRequestedMatchWithRecipients; GameCenterInvitations.ActionPlayerAcceptedInvitation += HandleActionPlayerAcceptedInvitation; }
void Awake() { if (!IsInitialized) { //Initializing Game Center class. This action will trigger authentication flow GameCenterManager.Init(); GameCenterManager.OnAuthFinished += OnAuthFinished; IsInitialized = true; } int ROLE_WIZARD = 0x4; // 100 in binary GameCenter_RTM.Instance.SetPlayerAttributes(ROLE_WIZARD); //Required int minPlayers = 2; int maxPlayers = 2; //Optionally you can provide and invitation message string invitationMessage = "Come play with me, bro."; //Optinally you can predefine invited friends list to the match //Teh code bellow assumes that player has atleast one friend, and you already loaded the friend list //so we can send an invite to the first player in the firendlist string[] invitations = new string[] { GameCenterManager.FriendsList[0] }; GameCenter_RTM.Instance.FindMatchWithNativeUI(minPlayers, maxPlayers, invitationMessage, invitations); GK_Player player = GameCenterManager.Player; player.OnPlayerPhotoLoaded += HandleOnPlayerPhotoLoaded; player.LoadPhoto(GK_PhotoSize.GKPhotoSizeNormal); GameCenter_RTM.ActionMatchStarted += HandleActionMatchStarted; GameCenterInvitations.ActionPlayerRequestedMatchWithRecipients += HandleActionPlayerRequestedMatchWithRecipients; GameCenterInvitations.ActionPlayerAcceptedInvitation += HandleActionPlayerAcceptedInvitation; GameCenter_RTM.ActionNearbyPlayerStateUpdated += HandleActionNearbyPlayerStateUpdated; GameCenter_RTM.Instance.StartBrowsingForNearbyPlayers(); }
void Start() { GameCenterManager.OnAuthFinished += OnAuthFinished; GameCenterManager.OnScoreSubmitted += OnScoreSubmitted; GameCenterManager.OnAchievementsProgress += HandleOnAchievementsProgress; GameCenterManager.OnAchievementsReset += HandleOnAchievementsReset; GameCenterManager.OnAchievementsLoaded += OnAchievementsLoaded; //Achievement registration. If you skip this step GameCenterManager.achievements array will contain only achievements with reported progress GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_1_ID); GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_2_ID); GameCenterManager.OnGameCenterViewDismissed += GameCenterManager_OnGameCenterViewDismissed; //Initializing Game Center class. This action will trigger authentication flow GameCenterManager.Init(); }
void Awake() { if (!gcIsInitialized) { //Achievement registration. If you skip this step GameCenterManager.achievements array will contain only achievements with reported progress //GameCenterManager.RegisterAchievement ("wjfirstswap"); //GameCenterManager.RegisterAchievement (TEST_ACHIEVEMENT_2_ID); //Listen for the Game Center events // GameCenterManager.OnAchievementsProgress += HandleOnAchievementsProgress; // GameCenterManager.OnAchievementsReset += HandleOnAchievementsReset; // GameCenterManager.OnPlayerScoreLoaded += HandleOnPlayerScoreLoaded; // GameCenterManager.OnPlayerScoreLoaded += OnPlayerScoreLoaded; GameCenterManager.OnAuthFinished += OnAuthFinished; // GameCenterManager.OnAchievementsLoaded += OnAchievementsLoaded; //Initializing Game Center class. This action will trigger authentication flow GameCenterManager.Init(); gcIsInitialized = true; } }
//-------------------------------------- // INITIALIZE //-------------------------------------- void Awake() { instance = this; GameCenterManager.OnAuthFinished += OnAuthFinished; GameCenterManager.Init(); b = gameObject.AddComponent <ConnectionButton> (); b.enabled = false; d = gameObject.AddComponent <DisconnectButton> (); d.enabled = false; m = gameObject.GetComponent <ClickManagerExample> (); m.enabled = false; GameCenter_RTM.ActionPlayerStateChanged += HandleActionPlayerStateChanged;; GameCenter_RTM.ActionMatchStarted += HandleActionMatchStarted; }
//-------------------------------------- // INITIALIZE //-------------------------------------- void InitGameCneter() { //Achievement registration. If you will skipt this step GameCenterManager.achievements array will contain only achievements with reported progress GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_1_ID); GameCenterManager.RegisterAchievement(TEST_ACHIEVEMENT_2_ID); //Listen for the Game Center events GameCenterManager.OnAchievementsLoaded += HandleOnAchievementsLoaded; GameCenterManager.OnAchievementsProgress += HandleOnAchievementsProgress; GameCenterManager.OnAchievementsReset += HandleOnAchievementsReset; GameCenterManager.OnPlayerScoreLoaded += HandleOnPlayerScoreLoaded; GameCenterManager.OnAuthFinished += HandleOnAuthFinished; DontDestroyOnLoad(gameObject); GameCenterManager.Init(); Debug.Log("InitGameCenter"); }