Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.30 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class ShareSceneMenu : MonoBehaviour
  5. {
  6.     public Transform BGsprite;
  7.     public UIButton PostToFacebookButton;
  8.  
  9.     void Awake()
  10.     {
  11.         Messenger<FacebookInterfaceBehaviour.BoolFunction>.Broadcast(MessengerMessageType.GetFacebookLoginStatus, FBLoginCallback);
  12.     }
  13.  
  14.     void FBLoginCallback(bool bLoggedIn)
  15.     {
  16.         Debug.Log("Logged In:" + bLoggedIn);
  17.         if (!bLoggedIn)
  18.         {
  19.             StartCoroutine(HideFBStuff());
  20.         }
  21.     }
  22.    
  23.     IEnumerator HideFBStuff()
  24.     {
  25.         yield return 1;
  26.         PostToFacebookButton.Hide(true);
  27.     }
  28.  
  29.     // Update is called once per frame
  30.     void Update ()
  31.     {
  32.        
  33.     }
  34.  
  35.  
  36.     /*
  37.     public void CountUpBestTrick ()
  38.     {
  39.         if (Mathf.CeilToInt (currentBestTrick) == Mathf.CeilToInt (finalBestTrick))
  40.             //target reached
  41.             return;
  42.        
  43.         currentBestTrick = Mathf.Lerp (currentBestTrick, finalBestTrick, 0.2f);
  44.         bestTrickNumbers.Text = Mathf.CeilToInt (currentBestTrick).ToString ();
  45.     }
  46.     */
  47.  
  48.     public void ReplayGame()
  49.     {
  50.         // This is actually continue (exit game) for development/testing purposes.
  51.         Game game = (Game)FindObjectOfType (typeof(Game));
  52.         //game.ExitGame ();
  53.         game.ReplayLevel();
  54.         Destroy (this.gameObject);
  55.     }
  56.  
  57.     public void PostToFacebook()
  58.     {
  59.         Debug.Log("Post To Facebook");
  60.         int TotalScore = (int) (Shell.instance.game.GetFinalScore() + Shell.instance.game.GetBonusScore());
  61.         Messenger<string>.Broadcast(MessengerMessageType.PostOnMyFacebookWall, "I just scored "+ TotalScore.ToString() + " playing the Metal Mulisha World Domination FMX Game! Can you beat that!?");
  62.     }
  63.  
  64.     public void SendEmail()
  65.     {
  66.        
  67.        
  68.         Debug.Log("Send Email");
  69.     }
  70.  
  71.     // VIEW SCORES
  72.     public void ViewScores()
  73.     {
  74.         Transform t = Shell.instance.assetLoader.LoadViewHighScoresScreen();
  75.         Destroy(this.gameObject);
  76.     }
  77.    
  78.     /*
  79.     //RESTART
  80.     public void Restart ()
  81.     {
  82.         Game game = (Game)FindObjectOfType (typeof(Game));
  83.         game.Reset ();
  84.         Destroy (this.gameObject);
  85.     }
  86.  
  87.     //END GAME
  88.     public void Continue ()
  89.     {
  90.         Game game = (Game)FindObjectOfType (typeof(Game));
  91.         game.ExitGame ();
  92.         Destroy (this.gameObject);
  93.     }
  94.    
  95.     // SHARE
  96.     public void Share()
  97.     {
  98.         Debug.Log("Share");
  99.     }
  100.     */
  101.    
  102.  
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement