Exemplo n.º 1
0
    private IEnumerator PostScreenshot()
    {
        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.ShareMedia("Title", "Some text to share", tex);

        Destroy(tex);
    }
Exemplo n.º 2
0
    // PostScreenshot
    private IEnumerator PostScreenshot()
    {
        yield return(new WaitForEndOfFrame());

        string title = "";
        string desc  = "";

        switch (Language.CurrentLanguage())
        {
        case LanguageCode.KO:
            title = "벚꽃엔딩";
            desc  = "❀✺따뜻한 봄을 간직한 벚꽃이 피었어요.❀✺";
            break;

        case LanguageCode.JA:
            title = "さくらドロップス";
            desc  = "❀✺暖かい春を秘め桜が血だった.❀✺";
            break;

        default:
            title = "Sakura Drops";
            desc  = "❀✺ was bearing the warm spring blooming cherry .❀✺";
            break;
        }

        // 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.ShareMedia(title, desc, tex);

        Destroy(tex);
    }
Exemplo n.º 3
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);
        }
    }
Exemplo n.º 4
0
 void OnMouseDown()
 {
     UM_ShareUtility.ShareMedia("360 Degrees", "This is my text to share");
     StartCoroutine(PostTwitterScreenshot());
 }
Exemplo n.º 5
0
 public override void OnEnter()
 {
     UM_ShareUtility.ShareMedia(caption.Value, message.Value, texture.Value as Texture2D);
     Finish();
 }