Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class ShareSceneMenu : MonoBehaviour
- {
- public Transform BGsprite;
- public UIButton PostToFacebookButton;
- void Awake()
- {
- Messenger<FacebookInterfaceBehaviour.BoolFunction>.Broadcast(MessengerMessageType.GetFacebookLoginStatus, FBLoginCallback);
- }
- void FBLoginCallback(bool bLoggedIn)
- {
- Debug.Log("Logged In:" + bLoggedIn);
- if (!bLoggedIn)
- {
- StartCoroutine(HideFBStuff());
- }
- }
- IEnumerator HideFBStuff()
- {
- yield return 1;
- PostToFacebookButton.Hide(true);
- }
- // Update is called once per frame
- void Update ()
- {
- }
- /*
- public void CountUpBestTrick ()
- {
- if (Mathf.CeilToInt (currentBestTrick) == Mathf.CeilToInt (finalBestTrick))
- //target reached
- return;
- currentBestTrick = Mathf.Lerp (currentBestTrick, finalBestTrick, 0.2f);
- bestTrickNumbers.Text = Mathf.CeilToInt (currentBestTrick).ToString ();
- }
- */
- public void ReplayGame()
- {
- // This is actually continue (exit game) for development/testing purposes.
- Game game = (Game)FindObjectOfType (typeof(Game));
- //game.ExitGame ();
- game.ReplayLevel();
- Destroy (this.gameObject);
- }
- public void PostToFacebook()
- {
- Debug.Log("Post To Facebook");
- int TotalScore = (int) (Shell.instance.game.GetFinalScore() + Shell.instance.game.GetBonusScore());
- Messenger<string>.Broadcast(MessengerMessageType.PostOnMyFacebookWall, "I just scored "+ TotalScore.ToString() + " playing the Metal Mulisha World Domination FMX Game! Can you beat that!?");
- }
- public void SendEmail()
- {
- Debug.Log("Send Email");
- }
- // VIEW SCORES
- public void ViewScores()
- {
- Transform t = Shell.instance.assetLoader.LoadViewHighScoresScreen();
- Destroy(this.gameObject);
- }
- /*
- //RESTART
- public void Restart ()
- {
- Game game = (Game)FindObjectOfType (typeof(Game));
- game.Reset ();
- Destroy (this.gameObject);
- }
- //END GAME
- public void Continue ()
- {
- Game game = (Game)FindObjectOfType (typeof(Game));
- game.ExitGame ();
- Destroy (this.gameObject);
- }
- // SHARE
- public void Share()
- {
- Debug.Log("Share");
- }
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement