void OnInitComplete() { FBAppEvents.LaunchEvent(); if (FB.IsLoggedIn) { Debug.Log("Already logged in &&&&&&&&&&&&&&&&&&&&&&&&&&&&"); //OnLoginComplete (); } }
private void InitCallback() { Debug.Log("InitCallback"); FBAppEvents.LaunchEvent(); if (FB.IsLoggedIn) { Debug.Log("Already logged in"); OnLoginComplete(); } }
private void InitCallback() { Debug.Log("InitCallback"); // App Launch events should be logged on app launch & app resume // See more: https://developers.facebook.com/docs/app-events/unity#quickstart FBAppEvents.LaunchEvent(); if (FB.IsLoggedIn) { Debug.Log("Already logged in"); OnLoginComplete(); } }
public void LooseRound() { GamePlayControls.self.CloseDiamonds(); GamePlayControls.self.OpenPowerup(); Game.GameActive = false; CanvasGroup roundEndGroup = GamePlayControls.self.RoundEndGroup; roundEndGroup.gameObject.SetActive(true); roundEndGroup.interactable = true; LeanTween.alphaCanvas(roundEndGroup, 1, 0.5f); CurrentPowerup = CutoutType.Null; RemainingPowerup = 0; GamePlayControls.self.PowerupGroup.SetActive(false); Game.Score = Mathf.Max(Game.Score, Score); FBAppEvents.GameComplete(Score); }
void OnApplicationPause(bool pauseStatus) { if (Application.isEditor) { return; } if (!pauseStatus) { if (FB.IsInitialized) { FBAppEvents.LaunchEvent(); } else { FB.Init(InitCallback); } } }
public static void EndGame() { Debug.Log("EndGame Instance.highScore = " + Instance.highScore + "\nInstance.score = " + Instance.score); // Log custom App Event for game completion FBAppEvents.GameComplete(Instance.score); // Ensure we have read score from FB before we allow overriding the High Score if (FB.IsLoggedIn && Instance.highScore.HasValue && Instance.highScore < Instance.score) { Debug.Log("Player has new high score :" + Instance.score); Instance.highScore = Instance.score; //Set a flag so MainMenu can handle posting the score once its scene has loaded highScorePending = true; } //Return to main menu Application.LoadLevel("MainMenu"); }
private void OnBombBuy(BombPackage bPackage) { int price = BombPackageCost[bPackage]; if (price <= GameStateManager.CoinBalance) { // execute transaction GameStateManager.CoinBalance -= price; GameStateManager.NumBombs += (int)bPackage; // update UI GameStateManager.CallUIRedraw(); PopupScript.SetPopup("Purchase Complete", 1f); // log App Event for spending credits FBAppEvents.SpentCoins(price, bPackage.ToString()); } else { PopupScript.SetPopup("Not enough coins", 1f); } }
// OnApplicationPause(false) is called when app is resumed from the background void OnApplicationPause(bool pauseStatus) { // Do not do anything in the Unity Editor if (Application.isEditor) { return; } // Check the pauseStatus for an app resume if (!pauseStatus) { if (FB.IsInitialized) { // App Launch events should be logged on app launch & app resume // See more: https://developers.facebook.com/docs/app-events/unity#quickstart FBAppEvents.LaunchEvent(); } else { FB.Init(InitCallback); } } }