Ejemplo n.º 1
0
    private IEnumerator TakeScreenshot()
    {
        yield return(new WaitForEndOfFrame());

        Texture2D snap = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false);

        //screenShotTexture.mainTexture = snap;

        snap.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);
        //chụp màn hình lưu thành texture2D
        snap.Apply();
        UM_ShareUtility.FacebookShare("Pikachu", snap);
    }
Ejemplo n.º 2
0
    public void Share(string providerName)
    {
        var message = E7.Localization.GetString("share_message") + messageInputField.text;

        switch (providerName)
        {
        default:
        case "Facebook":
            UM_ShareUtility.FacebookShare(message, texture);
            break;

        case "Twitter":
            UM_ShareUtility.TwitterShare(message, texture);
            break;
        }
    }
Ejemplo n.º 3
0
    private IEnumerator PostFBScreenshot()
    {
        yield return(new WaitForEndOfFrame());

        // Create a texture the size of the screen, RGB24 format
        int       width  = Screen.width;
        int       height = Screen.height;
        Texture2D tex    = new Texture2D(width, height, TextureFormat.RGB24, false);

        // Read screen contents into the texture
        tex.ReadPixels(new Rect(0, 0, width, height), 0, 0);
        tex.Apply();


        UM_ShareUtility.FacebookShare("My app ScreehShot", tex);

        Destroy(tex);
    }
Ejemplo n.º 4
0
    void OnGUI()
    {
        float StartY = 20;
        float StartX = 10;

        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Twitter", style);

        StartY += 25;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Post"))
        {
            UM_ShareUtility.TwitterShare("Titter posting test");
        }

        StartX += 170;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Post Screehshot"))
        {
            StartCoroutine(PostTwitterScreenshot());
        }


        StartY += 55;
        StartX  = 10;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Facebook", style);


        StartY += 25;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Post"))
        {
            UM_ShareUtility.FacebookShare("Facebook posting test");
        }

        StartX += 170;

        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Post Screehshot"))
        {
            StartCoroutine(PostFBScreenshot());
        }


        StartX += 170;

        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Post Image"))
        {
            UM_ShareUtility.FacebookShare("Hello world", textureForPost);
        }



        StartY += 55;
        StartX  = 10;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Mail", style);


        StartY += 25;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Send Mail"))
        {
            UM_ShareUtility.SendMail("My E-mail Subject", "This is my text to share", "[email protected], [email protected]");
        }

        StartX += 170;

        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Send Mail with image"))
        {
            UM_ShareUtility.SendMail("My E-mail Subject", "This is my text to share <br> <strong> html text </strong>", "[email protected], [email protected]", textureForPost);
        }



        StartY += 55;
        StartX  = 10;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Native Sharing", style);


        StartY += 25;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Text"))
        {
            UM_ShareUtility.ShareMedia("Title", "Some text to share");
        }

        StartX += 170;

        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Screehshot"))
        {
            StartCoroutine(PostScreenshot());
        }

        StartY += 55;
        StartX  = 10;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Whatsapp", style);

        StartY += 25;
        if (GUI.Button(new Rect(StartX, StartY, 150, 50), "Start Share"))
        {
            UM_ShareUtility.WhatsappShare("This is my text to share", textureForPost);
        }
    }
Ejemplo n.º 5
0
 public void OnFBShare()
 {
     OnShareClose();
     UM_ShareUtility.FacebookShare(url, textureForPost);
 }
    // facebook sharing
    public void postTextureFB()
    {
        UM_ShareUtility.FacebookShare("@thebridebox " + "#thebridebox", screenCap);
//		analyticsControl.screenshotShare("facebook");
    }
Ejemplo n.º 7
0
 public override void OnEnter()
 {
     UM_ShareUtility.FacebookShare(message.Value, texture.Value as Texture2D);
     Finish();
 }
Ejemplo n.º 8
0
    // facebook sharing
    public void postTextureFB()
    {
        UM_ShareUtility.FacebookShare("@TeamLaunchable " + "#launchable", screenCap);
//		analyticsControl.screenshotShare("facebook");
    }
Ejemplo n.º 9
0
 public void OnFBShare()
 {
     UM_ShareUtility.FacebookShare("market://details?id=com.peakrainbow.missionday");        //, textureForPost);
 }