public void ShareOnTwitter()
    {
        if (SoomlaProfile.IsLoggedIn(Provider.TWITTER))
        {
            SoomlaProfile.UpdateStory(
                Provider.TWITTER,
                "I'm playing this awesome game!",
                null,
                null,
                null,
                "www.mccarthy.tech",
                null,
                null,
                null

                );
        }
        else
        {
            if (SceneManager.GetActiveScene().name == "menu")
            {
                MenuController.instance.NotificationMessage("Please Connect In Order To Post");
            }
        }
    }
    private void SetUiFromGameVariables()
    {
        // Setting ui elements from game variables

        // Score
        foreach (var highScoreTextObj in _highScoreText)
        {
            highScoreTextObj.GetComponent <Text>().text = GameVariablesScript.ConvertScoreToString(GameVariablesScript.HighScore);
        }
        _lastScoreText.text = GameVariablesScript.ConvertScoreToString(GameVariablesScript.LastScore);

        // Options sliders
        _sensitivitySlider.value = GameVariablesScript.PaddleSensitivity * GameVariablesScript.PaddleSensitivityCoeff;
        _ballSpeedSlider.value   = GameVariablesScript.BallSpeed * GameVariablesScript.BallSpeedCoeff;

        // Control Scheme
        SetControlSchemeUiFromGameVariables();

        // Music  & Sound
        _muteMusicButtonImage.overrideSprite        = GameVariablesScript.MusicMuted ? MusicOffImage : MusicOnImage;
        _muteSoundEffectsButtonImage.overrideSprite = GameVariablesScript.SoundEffectsMuted ? SoundEffectsOffImage : SoundEffectsOnImage;

        // Social Network stuff
        if (SoomlaProfile.IsLoggedIn(Provider.FACEBOOK) || SoomlaProfile.IsLoggedIn(Provider.TWITTER) || SoomlaProfile.IsLoggedIn(Provider.GOOGLE))
        {
            SetUserLoggedIn(true);
        }
    }
 public void LogInOrLogOutTwitter()
 {
     if (SoomlaProfile.IsLoggedIn(Provider.TWITTER))
     {
         SoomlaProfile.Logout(Provider.TWITTER);
     }
     else
     {
         SoomlaProfile.Login(Provider.TWITTER);
     }
 }
Beispiel #4
0
 // Provide form so user can login in to Twitter
 public void twitterLogin()
 {
     if (!SoomlaProfile.IsLoggedIn(Provider.TWITTER))
     {
         SoomlaProfile.Login(Provider.TWITTER, "twitter");
     }
     else
     {
         // If the user is already logged in and presses the button then post to twitter (auto-login scenario)
         postToTwitter();
     }
 }
Beispiel #5
0
 // Provide form so user can login in to Facebook
 public void FBLogin()
 {
     if (!SoomlaProfile.IsLoggedIn(Provider.FACEBOOK))
     {
         SoomlaProfile.Login(Provider.FACEBOOK, "facebook");
     }
     else
     {
         // If the user is already logged in and presses the button then post to facebook (auto-login scenario)
         postToWall();
     }
 }
Beispiel #6
0
 public void UpdateTwitterStory()
 {
     Debug.Log("Share button clicked. Login status: " + SoomlaProfile.IsLoggedIn(Provider.TWITTER));
     if (!SoomlaProfile.IsLoggedIn(Provider.TWITTER))
     {
         SoomlaProfile.Login(Provider.TWITTER);
         ProfileEvents.OnLoginFinished += (UserProfile userProfile, bool autologin, string payload) => {
             //Your code to execute here
             Debug.Log("onloginfinished Logged into " + userProfile.Provider + " username: "******"", null);
     CloseSharePopup();
 }
 public void ShareStatusTwitter()
 {
     if (SoomlaProfile.IsLoggedIn(Provider.TWITTER))
     {
         SoomlaProfile.UpdateStatusWithConfirmation(
             Provider.TWITTER,                                // Provider
             "Check out this great challenging memory game",  // Message to post as status
             "",                                              // Payload
             null,                                            // Reward
             "Do you want to share this f****n awsom status?" // Message to show in the confirmation dialog
             );
     }
     else
     {
         TwitterLogin();
     }
 }
 public void ShareOnTwitter()
 {
     if (SoomlaProfile.IsLoggedIn(Provider.TWITTER))
     {
         SoomlaProfile.UpdateStory(
             Provider.TWITTER,
             "All your base are belong to us",
             null,
             null,
             null,
             "WWW.link.com",
             null,
             null,
             null
             );
     }
     else if (SceneManager.GetActiveScene().name == "MainMenu")
     {
         MenuController.instance.NotificationMessage("Please connect in order to post");
     }
 }
 public void ShareOnTwitter()
 {
     if (SoomlaProfile.IsLoggedIn(Provider.TWITTER))
     {
         SoomlaProfile.UpdateStory(
             Provider.TWITTER,
             "Im Playing This Awesome Game " + Random.Range(0, 100),
             null,
             null,
             null,
             null,
             "www.Link.com",
             null,
             null
             );
     }
     else
     {
         if (Application.loadedLevelName == "MainMenu")
         {
             MenuController.instance.NotificationMessage("Please Connect In Order To Post");
         }
     }
 }
Beispiel #10
0
 //comprueba si esta logeado en facebook mediante soomla
 public bool isloggedFB()
 {
     return(SoomlaProfile.IsLoggedIn(Provider.FACEBOOK));
 }
Beispiel #11
0
    /// <summary>
    /// Displays the welcome screen of the game.
    /// </summary>
    void welcomeScreen()
    {
        Color backupColor = GUI.color;
        float vertGap     = 80f;

        //drawing background, just using a white pixel here
        GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), tBackground);
        GUI.DrawTexture(new Rect(0, 0, Screen.width, timesH(240f)), tShed, ScaleMode.StretchToFill, true);


        float rowsTop    = 300.0f;
        float rowsHeight = 120.0f;

        GUI.DrawTexture(new Rect(timesW(65.0f), timesH(rowsTop + 10f), timesW(516.0f), timesH(102.0f)), tBGBar, ScaleMode.StretchToFill, true);

        if (SoomlaProfile.IsLoggedIn(targetProvider))
        {
            GUI.skin.button.normal.background = tShare;
            GUI.skin.button.hover.background  = tShare;
            GUI.skin.button.active.background = tSharePress;
            if (GUI.Button(new Rect(timesW(50.0f), timesH(rowsTop), timesW(212.0f), timesH(120.0f)), ""))
            {
                SoomlaProfile.UpdateStatus(targetProvider, "I LOVE SOOMLA !  http://www.soom.la", null, exampleReward);
            }
        }
        else
        {
            GUI.DrawTexture(new Rect(timesW(50.0f), timesH(rowsTop), timesW(212.0f), timesH(120.0f)), tShareDisable,
                            ScaleMode.StretchToFill, true);
        }

        GUI.color                = Color.black;
        GUI.skin.label.font      = fgoodDog;
        GUI.skin.label.fontSize  = 30;
        GUI.skin.label.alignment = TextAnchor.MiddleCenter;
        GUI.Label(new Rect(timesW(270.0f), timesH(rowsTop), timesW(516.0f - 212.0f), timesH(120.0f)), "I Love SOOMLA!");
        GUI.color = backupColor;


        rowsTop += vertGap + rowsHeight;


        GUI.DrawTexture(new Rect(timesW(65.0f), timesH(rowsTop + 10f), timesW(516.0f), timesH(102.0f)), tBGBar, ScaleMode.StretchToFill, true);

        if (SoomlaProfile.IsLoggedIn(targetProvider))
        {
            GUI.skin.button.normal.background = tShareStory;
            GUI.skin.button.hover.background  = tShareStory;
            GUI.skin.button.active.background = tShareStoryPress;
            if (GUI.Button(new Rect(timesW(50.0f), timesH(rowsTop), timesW(212.0f), timesH(120.0f)), ""))
            {
                SoomlaProfile.UpdateStory(targetProvider,
                                          "The story of SOOMBOT (Profile Test App)",
                                          "The story of SOOMBOT (Profile Test App)",
                                          "SOOMBOT Story",
                                          "DESCRIPTION",
                                          "http://about.soom.la/soombots",
                                          "http://about.soom.la/wp-content/uploads/2014/05/330x268-spockbot.png",
                                          null,
                                          exampleReward);
            }
        }
        else
        {
            GUI.DrawTexture(new Rect(timesW(50.0f), timesH(rowsTop), timesW(212.0f), timesH(120.0f)), tShareStoryDisable,
                            ScaleMode.StretchToFill, true);
        }

        GUI.color                = Color.black;
        GUI.skin.label.font      = fgoodDog;
        GUI.skin.label.fontSize  = 25;
        GUI.skin.label.alignment = TextAnchor.MiddleCenter;
        GUI.Label(new Rect(timesW(270.0f), timesH(rowsTop), timesW(516.0f - 212.0f), timesH(120.0f)), "Full story of The SOOMBOT!");
        GUI.color = backupColor;



        rowsTop += vertGap + rowsHeight;


        GUI.DrawTexture(new Rect(timesW(65.0f), timesH(rowsTop + 10f), timesW(516.0f), timesH(102.0f)), tBGBar, ScaleMode.StretchToFill, true);

        if (SoomlaProfile.IsLoggedIn(targetProvider))
        {
            GUI.skin.button.normal.background = tUpload;
            GUI.skin.button.hover.background  = tUpload;
            GUI.skin.button.active.background = tUploadPress;
            if (GUI.Button(new Rect(timesW(50.0f), timesH(rowsTop), timesW(212.0f), timesH(120.0f)), ""))
            {
//				string fileName = "soom.jpg";
//				string path = "";
//
//				#if UNITY_IOS
//				path = Application.dataPath + "/Raw/" + fileName;
//				#elif UNITY_ANDROID
//				path = "jar:file://" + Application.dataPath + "!/assets/" + fileName;
//				#endif
//
//				byte[] bytes = File.ReadAllBytes(path);
//				SoomlaProfile.UploadImage(targetProvider, "Awesome Test App of SOOMLA Profile!", fileName, bytes, 10, null, exampleReward);
                SoomlaProfile.UploadCurrentScreenShot(this, targetProvider, "Awesome Test App of SOOMLA Profile!", "This a screenshot of the current state of SOOMLA's test app on my computer.", null);
            }
        }
        else
        {
            GUI.DrawTexture(new Rect(timesW(50.0f), timesH(rowsTop), timesW(212.0f), timesH(120.0f)), tUploadDisable,
                            ScaleMode.StretchToFill, true);
        }

        GUI.color                = Color.black;
        GUI.skin.label.font      = fgoodDog;
        GUI.skin.label.fontSize  = 28;
        GUI.skin.label.alignment = TextAnchor.MiddleCenter;
        GUI.Label(new Rect(timesW(270.0f), timesH(rowsTop), timesW(516.0f - 212.0f), timesH(120.0f)), "Current Screenshot");
        GUI.color = backupColor;



        if (SoomlaProfile.IsLoggedIn(targetProvider))
        {
            GUI.skin.button.normal.background = tLogout;
            GUI.skin.button.hover.background  = tLogout;
            GUI.skin.button.active.background = tLogoutPress;
            if (GUI.Button(new Rect(timesW(20.0f), timesH(950f), timesW(598.0f), timesH(141.0f)), ""))
            {
                SoomlaProfile.Logout(targetProvider);
            }
        }
        else if (isInit)
        {
            GUI.skin.button.normal.background = tConnect;
            GUI.skin.button.hover.background  = tConnect;
            GUI.skin.button.active.background = tConnectPress;
            if (GUI.Button(new Rect(timesW(20.0f), timesH(950f), timesW(598.0f), timesH(141.0f)), ""))
            {
                //SoomlaProfile.GetLeaderboards(Provider.GAME_CENTER);
                SoomlaProfile.Login(targetProvider, null, exampleReward);
            }
        }
    }