/// <summary>
	/// Facebookインスタンスを取得する.
	/// </summary>
	public static Facebook GetFacebook() {
		if (_instance == null) {
#if (USE_FACEBOOK_PLUGIN && UNITY_EDITOR)
			_instance = new Facebook();
#elif (USE_FACEBOOK_PLUGIN && UNITY_ANDROID)
			_instance = new FacebookAndroid();
#elif (USE_FACEBOOK_PLUGIN && UNITY_IPHONE)
			_instance = new FacebookIPhone();
#else
			_instance = new Facebook();
#endif
		}
		return _instance;
	}
Exemple #2
0
 public static void login()
 {
     FacebookAndroid.loginWithReadPermissions(new string[0]);
 }
    void OnGUI()
    {
        beginColumn();


        if (GUILayout.Button("Initialize Facebook"))
        {
            FacebookAndroid.init();
        }


        if (GUILayout.Button("Login"))
        {
            FacebookAndroid.loginWithReadPermissions(new string[] { "email", "user_birthday" });
        }


        if (GUILayout.Button("Reauthorize with Publish Permissions"))
        {
            FacebookAndroid.reauthorizeWithPublishPermissions(new string[] { "publish_actions", "manage_friendlists" }, FacebookSessionDefaultAudience.EVERYONE);
        }


        if (GUILayout.Button("Logout"))
        {
            FacebookAndroid.logout();
        }


        if (GUILayout.Button("Is Session Valid?"))
        {
            var isSessionValid = FacebookAndroid.isSessionValid();
            Debug.Log("Is session valid?: " + isSessionValid);
        }


        if (GUILayout.Button("Get Session Token"))
        {
            var token = FacebookAndroid.getAccessToken();
            Debug.Log("session token: " + token);
        }


        if (GUILayout.Button("Get Granted Permissions"))
        {
            var permissions = FacebookAndroid.getSessionPermissions();
            Debug.Log("granted permissions: " + permissions.Count);
            Prime31.Utils.logObject(permissions);
        }


        endColumn(true);


        if (GUILayout.Button("Post Image"))
        {
            var pathToImage = Application.persistentDataPath + "/" + screenshotFilename;
            var bytes       = System.IO.File.ReadAllBytes(pathToImage);

            Facebook.instance.postImage(bytes, "im an image posted from Android", completionHandler);
        }


        if (GUILayout.Button("Graph Request (me)"))
        {
            Facebook.instance.graphRequest("me", completionHandler);
        }


        if (GUILayout.Button("Post Message"))
        {
            Facebook.instance.postMessage("im posting this from Unity: " + Time.deltaTime, completionHandler);
        }


        if (GUILayout.Button("Post Message & Extras"))
        {
            Facebook.instance.postMessageWithLinkAndLinkToImage("link post from Unity: " + Time.deltaTime, "http://prime31.com", "prime[31]", "http://prime31.com/assets/images/prime31logo.png", "Prime31 Logo", completionHandler);
        }


        if (GUILayout.Button("Show Post Dialog"))
        {
            // parameters are optional. See Facebook's documentation for all the dialogs and paramters that they support
            var parameters = new Dictionary <string, string>
            {
                { "link", "http://prime31.com" },
                { "name", "link name goes here" },
                { "picture", "http://prime31.com/assets/images/prime31logo.png" },
                { "caption", "the caption for the image is here" }
            };
            FacebookAndroid.showDialog("stream.publish", parameters);
        }


        if (GUILayout.Button("Get Friends"))
        {
            Facebook.instance.getFriends(completionHandler);
        }


        endColumn();


        if (bottomLeftButton("Twitter Scene"))
        {
            Application.LoadLevel("TwitterTestScene");
        }
    }
Exemple #4
0
    void SetCallbacks()
    {
        Application.RegisterLogCallbackThreaded(HandleLog);

        /*GSApi.GSMessageReceived += (GS, args)=>
         * {
         *      if(args.Message["@class"] as string == ".ChallengeAcceptedMessage"){
         #if UNITY_ANDROID && !UNITY_EDITOR
         *              GCM.ShowToast("Challenge Accepted");
         #else
         *              if (Debug.isDebugBuild) Debug.Log("Challenge Accepted");
         #endif
         *      }
         *      else if(args.Message["@class"] as string == ".ChallengeDeclinedMessage"){
         #if UNITY_ANDROID && !UNITY_EDITOR
         *              GCM.ShowToast("Challenge Declined");
         #else
         *              if (Debug.isDebugBuild) Debug.Log("Challenge Accepted");
         #endif
         *      }
         *      else if(args.Message["@class"] as string == ".ChallengeChatMessage"){
         #if UNITY_ANDROID && !UNITY_EDITOR
         *              GCM.ShowToast("Challenge Chat Recieved");
         #else
         *              if (Debug.isDebugBuild) Debug.Log("Challenge Chat Recieved");
         *              GameGlobals.messageCount++;
         #endif
         *      }
         *
         * };*/
#if UNITY_ANDROID && !UNITY_EDITOR
        FacebookManager.sessionOpenedEvent += delegate()
        {
            if (Debug.isDebugBuild)
            {
                Debug.Log("facebook callback worked");
            }



            //we assume that this can will only be called if session is invalid or we are on a new device.

            Hashtable response = GSApi.facebookConnect(FacebookAccess.getAccessToken());

            if ((string)response["@class"] == ".AuthenticationResponse" && (string)response["authToken"] != null)
            {
                GameGlobals.online = true;
                Hashtable details = GSApi.accountDetails();


                if (details["userId"] != null)
                {
                    GameGlobals.userID = (string)details["userId"];
                }
                if (!GCM.IsRegistered())
                {
                    GCM.Register();
                }
                GSApi.registerForPush(GCM.GetRegistrationId());
            }
            else
            {
                GameGlobals.online = false;
            }
        };
#endif



#if UNITY_ANDROID && !UNITY_EDITOR
        GCM.SetErrorCallback((string errorId) => {
            if (Debug.isDebugBuild)
            {
                Debug.Log("Error!!! " + errorId);
            }
            GCM.ShowToast("Error!!!");
            _text = "Error: " + errorId;
        });

        GCM.SetMessageCallback((Dictionary <string, object> table) => {
            if (Debug.isDebugBuild)
            {
                Debug.Log("Message!!!");
            }
            GCM.ShowToast("Message!!!");
            _text = "Message: " + System.Environment.NewLine;
            foreach (var key in  table.Keys)
            {
                _text += key + "=" + table[key] + System.Environment.NewLine;
            }
        });



        GCM.SetRegisteredCallback((string registrationId) => {
            //if(FacebookAccess.isSessionValid() &&
        });
#endif
    }
Exemple #5
0
    void Start()
    {
        GameGlobals.messageCount = PlayerPrefs.GetInt("challengeMessages", 0);
        GameGlobals.Songs        = new Hashtable();
        GameGlobals.otherIDs     = new ArrayList();
        //string trackFolder = "Assets/Audio/Resources/Tracks/";
        if (Debug.isDebugBuild)
        {
            Debug.Log("loading track names");
        }
        string trackFolder = "Tracks/";

        GameGlobals.Songs.Add("Clu - Ruby", new AudioTrack(trackFolder + "01/Songs/Clu - Ruby", trackFolder + "01/AlbumArt/Clu", true, false, "TKHSCLURUB"));
        GameGlobals.Songs.Add("Clu + Ft. Lindstrøm - Rà-àkõ-st", new AudioTrack(trackFolder + "01/Songs/Clu + Ft. Lindstrøm - Rà-àkõ-st", trackFolder + "01/AlbumArt/Clu", true, false, "TKHSCLURAA"));
        GameGlobals.Songs.Add("Cosmic Boy - Survival", new AudioTrack(trackFolder + "02/Songs/Cosmic Boy - Survival", trackFolder + "02/AlbumArt/Cosmic Boy", true, false, "TKHSCOSSUR"));
        GameGlobals.Songs.Add("Knife City - Bad News", new AudioTrack(trackFolder + "03/Songs/Knife City - Bad News", trackFolder + "03/AlbumArt/Knife City", true, false, "TKHSKNIBAD"));
        GameGlobals.Songs.Add("Knife City - Just Trash", new AudioTrack(trackFolder + "03/Songs/Knife City - Just Trash", trackFolder + "03/AlbumArt/Knife City", true, false, "TKHSKNIJUS"));
        GameGlobals.Songs.Add("Polygon APE - IncrediBULL", new AudioTrack(trackFolder + "04/Songs/Polygon APE - IncrediBULL", trackFolder + "04/AlbumArt/Polygon APE", true, false, "TKHSPOLINC"));
        GameGlobals.Songs.Add("Polygon APE - Riff Raff", new AudioTrack(trackFolder + "04/Songs/Polygon APE - Riff Raff", trackFolder + "04/AlbumArt/Polygon APE", true, false, "TKHSPOLRIF"));
        GameGlobals.Songs.Add("RIOT AKKT - TIGER CHILD", new AudioTrack(trackFolder + "05/Songs/RIOT AKKT - TIGER CHILD", trackFolder + "05/AlbumArt/Riot Akkt", true, false, "TKHSRIOTIG"));
        GameGlobals.Songs.Add("Sabrepulse + Knife City - First Crush", new AudioTrack(trackFolder + "06/Songs/Sabrepulse + Knife City - First Crush", trackFolder + "06/AlbumArt/Sabrepulse", true, false, "TKHSSABFIR"));
        GameGlobals.Songs.Add("Sabrepulse - A Girl I Know", new AudioTrack(trackFolder + "06/Songs/Sabrepulse - A Girl I Know", trackFolder + "06/AlbumArt/Sabrepulse", true, false, "TKHSSABAGI"));

        if (Debug.isDebugBuild)
        {
            Debug.Log(" finished loading track names");
        }

        GameGlobals.TileSets = new Hashtable();

        string tilesFolder = "Tiles/01/";

        GameGlobals.TileSets.Add("LED", new TileSet("LED", tilesFolder, true, "AAAAAAAAAA"));
        tilesFolder = "Tiles/02/";
        GameGlobals.TileSets.Add("Fruit", new TileSet("Fruit", tilesFolder, true, "BBBBBBBBBB"));
        tilesFolder = "Tiles/03/";
        GameGlobals.TileSets.Add("Stripes", new TileSet("Stripes", tilesFolder, true, "CCCCCCCCCC"));



        /*
         * string[] folderNames = Directory.GetFiles("Assets/Audio/Resources/Tracks");
         *
         * foreach(string folder in folderNames){
         *      //if(folder != "Assets/Audio/Resources/Tracks/.DS_Store")//macs add this file to this directory
         *      {
         *              if(!folder.Contains(".meta") && !folder.Contains(".DS_Store")){
         *                      string[] albumArt = Directory.GetFiles(folder+"/AlbumArt/");
         *                      string[] songNames = Directory.GetFiles(folder+"/Songs/");
         *
         *                      foreach(string currentSong in songNames){
         *                              if(!currentSong.Contains(".meta") && !folder.Contains(".DS_Store")){
         *                                      if( !albumArt[0].Contains(".DS_Store") )
         *                                              GameGlobals.Songs.Add( new AudioTrack( folder+"/Songs/"+currentSong, folder+"/AlbumArt/"+albumArt[0] ) );
         *                                      else
         *                                              GameGlobals.Songs.Add( new AudioTrack( folder+"/Songs/"+currentSong, folder+"/AlbumArt/"+albumArt[1] ) );
         *                              }
         *                      }
         *              }
         *      }
         * }
         *
         *
         * foreach(AudioTrack current in GameGlobals.Songs){
         *      if (Debug.isDebugBuild) Debug.LogError(current.song + " - " + current.albumArt);
         * }
         */
        if (Debug.isDebugBuild)
        {
            Debug.Log("setting selected track");
        }
        GameGlobals.selectedTrack = ((AudioTrack)GameGlobals.Songs["Clu - Ruby"]);

        if (Debug.isDebugBuild)
        {
            Debug.Log("finished setting selected track");
        }


        GameGlobals.sound    = (PlayerPrefs.GetInt("Sound") == 0) ? true: false;
        GameGlobals.messages = (PlayerPrefs.GetInt("Messages") == 0) ? true : false;

        //everybody starts with 3 multipliers
        if (PlayerPrefs.GetInt("FirstTimePlaying") == 0)
        {
            PlayerPrefs.SetInt("FirstTimePlaying", 1);
            //PlayerPrefs.SetInt("InGameCurrency", 0);
            PlayerPrefs.SetInt("X2s", 3);
        }

        if (PlayerPrefs.GetString("TileSet") == "" || PlayerPrefs.GetString("TileSet") == null)
        {
            PlayerPrefs.SetString("TileSet", "LED");
        }

        GameGlobals.selectedTiles = ((TileSet)GameGlobals.TileSets[PlayerPrefs.GetString("TileSet")]);



        DontDestroyOnLoad(this);
        SetCallbacks();
#if !UNITY_EDITOR && !UNITY_WEB_PLAYER && !UNITY_STANDALONE_OSX && !UNITY_STANDALONE_WIN
        FacebookAccess.init(false);
#else
        GSApi.facebookConnect("CAAHZBQNnoPZBMBAFBJJXuqFhEbWkjfEKOwUNzZAGT2nZCvQkLZBB43fbk2M5F3YoDc1nRSaEDCA6zspcZAL9hFhRQjNSYEkLVtcy8Ha1ewceuXv1CAi41XoudeMCBrmgX8V0yZCGVqqmIhqkXfSqJeSbJSWZBieMuze7N0lEZBK2VDeuggBR4BD2qluDUbGdVOmeCpnar5i6K9sMUPY6GSwZBH");
        //GSApi.facebookConnect("CAAHZBQNnoPZBMBABWZBc7ZA9AnojVXSwDpJ3I5wtUTntrVnuU67EYKxWg9AKVF3UidCGb66K8sdDPZCiizffbaDPfeMlezKBKfRy1mEwhWYm6IKQmSxf89ZAO4EZC6vbmJTZCZA0cCpiNVg1LLbhbhVTZC5W3sZAGYteZAE4QmGzXyCZAMQhYeRlZBlgWLvQHaXtWDd6fRXMVJc3m9I7qAVwkjaS8h");
#endif

        if (Debug.isDebugBuild)
        {
            Debug.Log("setting account info");
        }

        Hashtable details = GSApi.accountDetails();


        if (!GSApi.OfflineMode() && details["userId"] != null)
        {
            if (details["userId"] != null)
            {
                GameGlobals.userID = (string)details["userId"];
            }


            if (Debug.isDebugBuild)
            {
                Debug.Log("finished setting account info");
            }
            GameGlobals.online = true;
            dlcManager.initDLC();            //start managing dlc
        }
#if UNITY_ANDROID && !UNITY_EDITOR
        if (Debug.isDebugBuild)
        {
            Debug.Log("setting GCM");
        }
        GCM.Initialize();
        IAP.init(key);

        if (!GCM.IsRegistered())
        {
            GCM.Register();
        }
        if (!GCM.IsRegisteredOnServer())
        {
            GCM.SetRegisteredOnServer(true);
        }
        if (Debug.isDebugBuild)
        {
            Debug.Log("finished setting GCM");
        }
#endif
    }
    void OnGUI()
    {
        //write your GUI elements for 1280x720
        GUI.matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity, new Vector3(Screen.width / targetWidth, Screen.height / targetHeight, 1));

        KongregateAPI kongregate = KongregateAPI.GetAPI();

        // isReady() is true if we are on iOS platform and the API is initalized properly
        if (kongregate.IsReady())
        {
#if UNITY_STANDALONE
            if (GUI.Button(new Rect(targetWidth / 2 - 170 - 5, 10, 80, 40), "Reset Data"))
            {
                Kongregate.DataStore dataStore = Kongregate.DataStore.Get("analytics");
                string playerId = dataStore.GetString("player_id", "");
                Debug.Log("PlayerID was: " + playerId);
                dataStore.DeleteAll();
                if (!string.IsNullOrEmpty(playerId))
                {
                    dataStore.SetString("player_id", playerId);
                }
            }
#endif

            // add a simple button to demonstrate hidding and showing the K button
            if (GUI.Button(new Rect(targetWidth / 2 - 80 - 5, 10, 80, 40), "Toggle K"))
            {
                if (kongregate.Mobile.ButtonIsHidden())
                {
                    kongregate.Mobile.ButtonShow();
                }
                else
                {
                    kongregate.Mobile.ButtonHide();
                }
            }

            // add a simple button to demonstrate submitting stats
            if (GUI.Button(new Rect(targetWidth / 2 + 5, 10, 80, 40), "Submit Win"))
            {
                kongregate.Stats.Submit("Wins", 1);
            }

            Dictionary <string, object> fields = new Dictionary <string, object>()
            {
                { "type", "Gold Pack" },
                { "discount_percent", 12.5 },
                { "context_of_offer", "StoreFront" }
            };

            if (mPurchaseReady)
            {
                if (GUI.Button(new Rect(targetWidth / 2 - 170 - 5, 60, 80, 40), "Purchase"))
                {
                    mPurchaseReady = false; // disable button when clicked
#if UNITY_IPHONE && PRIME31_STOREKIT
                    kongregate.Analytics.StartPurchase("com.kongregate.mobile.games.angryBots.t05_coins", 1, fields);
                    StoreKitBinding.purchaseProduct("com.kongregate.mobile.games.angryBots.t05_coins", 1);
#elif UNITY_ANDROID && PRIME31_STOREKIT
                    kongregate.Analytics.StartPurchase("com.kongregate.android.games.angrybots.t03_hard", 1, fields);
                    GoogleIAB.purchaseProduct("com.kongregate.android.games.angrybots.t03_hard");
#elif UNITY_WEBPLAYER || UNITY_WEBGL
                    kongregate.Analytics.StartPurchase("com.kongregate.web.angrybots.t05_hard", 1, fields);

                    // Use the Javascript API to initiate the purchase. Notice in this flow we call finishPurchase via
                    // the Javascript API after the purchase is completed by serializing the game fields needed. You
                    // could also save the game fields into a variable in your Unity script and then call
                    // kongregate.Analytics.FinishPurchase(...) in the Unity callback as well.
                    Application.ExternalEval(string.Format(
                                                 @"kongregate.mtx.purchaseItems(['com.kongregate.web.angrybots.t05_hard'], function(result){{
                var status = result.success ? 'SUCCESS' : 'FAIL';
                var data = result.success ? '{0}' : '{1}';
                kongregate.analytics.finishPurchase(status, result.purchase_id, data);

                // Fire the callback in the Unity code
                kongregateUnitySupport.getUnityObject().SendMessage('Kongregate', 'OnKredPurchaseResult', status);
            }});"
                                                 , Kongregate.Analytics.toAnalyticEventJSON(getPurchaseFields()), Kongregate.Analytics.toAnalyticEventJSON(fields)));
#elif UNITY_STANDALONE
                    kongregate.Analytics.StartPurchase("com.kongregate.mobile.games.angryBots.t05_hard", 1, fields);
#endif
                }

#if UNITY_IPHONE && PRIME31_STOREKIT
                if (GUI.Button(new Rect(targetWidth / 2 + 5, 60, 80, 40), "Restore"))
                {
                    StoreKitBinding.restoreCompletedTransactions();
                }
#endif
                if (mRecentPurchase)
                {
                    GUI.Box(new Rect(targetWidth / 2 - 70, targetHeight / 2 - 30, 140, 60), "Purchase Successful!");
                    if (GUI.Button(new Rect(targetWidth / 2 - 20, targetHeight / 2, 40, 20), "OK"))
                    {
                        mRecentPurchase = false;
                    }
                }
            }

#if UNITY_STANDALONE
            if (!mPurchaseReady)
            {
                if (GUI.Button(new Rect(targetWidth / 2 - 170 - 5, 60, 80, 40), "Finish"))
                {
                    kongregate.Analytics.FinishPurchase("SUCCESS", null, getPurchaseFields());
                    mPurchaseReady = true;
                }

                if (GUI.Button(new Rect(targetWidth / 2 - 80 - 5, 60, 80, 40), "Cancel"))
                {
                    kongregate.Analytics.FinishPurchase("FAIL", null, fields);
                    mPurchaseReady = true;
                }
            }
#endif

            // add text fields to demonstrate submitting generic stat types
            GUI.Label(new Rect(targetWidth / 2 + 95, 10, 50, 20), "Stat:");
            mCustomStatId = GUI.TextField(new Rect(targetWidth / 2 + 140, 10, 80, 20), mCustomStatId);
            GUI.Label(new Rect(targetWidth / 2 + 95, 35, 50, 20), "Value:");
            mCustomStatValue = GUI.TextField(new Rect(targetWidth / 2 + 140, 35, 80, 20), mCustomStatValue);
            if (GUI.Button(new Rect(targetWidth / 2 + 230, 10, 80, 40), "Submit"))
            {
                long value = 0;
                if (long.TryParse(mCustomStatValue, out value))
                {
                    kongregate.Stats.Submit(mCustomStatId, long.Parse(mCustomStatValue));
                }
            }

            if (GUI.Button(new Rect(targetWidth / 2 + 430, 10, 100, 40), "Inventory"))
            {
                mInventory = false;
                kongregate.Mtx.RequestUserItemList();
            }

            GUI.Box(new Rect(5, 105, 200, 60), "");

            if (mInventory)
            {
                GUI.Label(new Rect(10, 110, 200, 20), "Has AWESOME GUN: " + mHasGun);
            }
            else
            {
                GUI.Label(new Rect(10, 110, 200, 20), "Requesting inventory...");
            }

            if (mUsername != null)
            {
                GUI.Label(new Rect(10, 125, 200, 20), "Username: "******", id: " + mUserId);
                GUI.Label(new Rect(10, 140, 200, 20), "KongPlus: " + mHasKongPlus);
            }

            if (GUI.Button(new Rect(targetWidth / 2 + 535, 10, 100, 40), "FBPost"))
            {
                Dictionary <string, object> parameters = new Dictionary <string, object>()
                {
                    { "link", "http://www.kongregate.com" },
                    { "name", "AngryBots" },
                    { "caption", "Testing 123" },
                    { "description", "Test Post" }
                };
#if UNITY_ANDROID && PRIME31_SOCIAL
                FacebookAndroid.showFacebookShareDialog(parameters);
#elif UNITY_IPHONE && PRIME31_SOCIAL
                FacebookBinding.showFacebookShareDialog(parameters);
#endif
            }

            if (GUI.Button(new Rect(targetWidth / 2 + 535, 60, 100, 40), "More Games"))
            {
                kongregate.Mobile.OpenKongregateWindow(Kongregate.Mobile.TARGET_MORE_GAMES);
            }
            if (GUI.Button(new Rect(targetWidth / 2 + 535, 110, 100, 40), "High Scores"))
            {
                kongregate.Mobile.OpenKongregateWindow(Kongregate.Mobile.TARGET_HIGH_SCORES);
            }
            if (GUI.Button(new Rect(targetWidth / 2 + 535, 160, 100, 40), "Support"))
            {
                kongregate.Mobile.OpenKongregateWindow(Kongregate.Mobile.TARGET_SUPPORT);
            }
            if (GUI.Button(new Rect(targetWidth / 2 + 535, 210, 100, 40), "Forums"))
            {
                kongregate.Mobile.OpenKongregateWindow(Kongregate.Mobile.TARGET_FORUMS);
            }

            // add a simple button to demonstrate submitting analytics
            mPlayTimer = new System.Diagnostics.Stopwatch();
            mPlayTimer.Start();
            if (GUI.Button(new Rect(targetWidth / 2 + 330, 10, 80, 40), "Play Ends"))
            {
                DemoAddAnalyticsEvent();
            }

            // if our button is not hidden, we need to draw it
            Rect kButtonRect = new Rect(10, 10, 100, 100);
            if (kongregate.Mobile.ButtonIsNativeRendering())
            {
                //nothing to do, rendering is handled in native SDK
                // NOTE: notification count is not supported by native rendering
            }
            else if (!kongregate.Mobile.ButtonIsHidden())
            {
                // draw the K button
                if (GUI.Button(kButtonRect, mKongButtonTexture))
                {
                    Debug.Log("You clicked the Kong button!");
                    kongregate.Mobile.OpenKongregateWindow();
                }
                if (mNotificationCountTexture)
                {
                    GUI.Label(new Rect(90, 20, 50, 50), mNotificationCountTexture);
                }
            }

            // add buttons for the deep links
            Rect deepLinkButtonsRect = new Rect(kButtonRect.x, kButtonRect.y + kButtonRect.height + 60, 200, 400);
            Rect targetIdLabelRect   = new Rect(deepLinkButtonsRect.x, deepLinkButtonsRect.y + deepLinkButtonsRect.height + 20, 100, 50);
            Rect targetIdTextRect    = new Rect(targetIdLabelRect.x + targetIdLabelRect.width, targetIdLabelRect.y, 100, 50);
            GUI.Label(targetIdLabelRect, "TargetId:");
            mTargetIdText = GUI.TextField(targetIdTextRect, mTargetIdText);
            int deepLinkClick = GUI.SelectionGrid(deepLinkButtonsRect, -1, mDeepLinkTargets, 2);
            if (deepLinkClick >= 0)
            {
                KongregateAPI.GetAPI().Mobile.OpenKongregateWindow(mDeepLinkTargets[deepLinkClick], mTargetIdText);
            }
        } // IsReady
    }     // OnGUI
 public void start()
 {
     FacebookAndroid.login();
 }
    void OnClick()
    {
#if !UNITY_STANDALONE_OSX && !UNITY_STANDALONE_WIN
        FacebookAndroid.login();
#endif
    }