コード例 #1
0
    public static void InstagramShare(string status, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent("Share", status, texture, "com.instagram.android");
            }
            else
            {
                AndroidSocialGate.StartShareIntent("Share", status, "com.instagram.android");
            }


            break;

        case RuntimePlatform.IPhonePlayer:

            IOSSocialManager.Instance.InstagramPost(texture, status);
            break;

#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
        case RuntimePlatform.WP8Player:
#else
        case RuntimePlatform.WSAPlayerARM:
        case RuntimePlatform.WSAPlayerX64:
        case RuntimePlatform.WSAPlayerX86:
#endif
            break;
        }
    }
コード例 #2
0
    public static void FacebookShare(string message, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent("Share", message, texture, "facebook.katana");
            }
            else
            {
                AndroidSocialGate.StartShareIntent("Share", message, "facebook.katana");
            }

            break;

        case RuntimePlatform.IPhonePlayer:
            IOSSocialManager.Instance.FacebookPost(message, null, texture);
            break;

#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
        case RuntimePlatform.WP8Player:
#else
        case RuntimePlatform.WSAPlayerARM:
        case RuntimePlatform.WSAPlayerX64:
        case RuntimePlatform.WSAPlayerX86:
#endif
            break;
        }
    }
コード例 #3
0
    public static void ShareMedia(string caption, string message, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent(caption, message, texture);
            }
            else
            {
                AndroidSocialGate.StartShareIntent(caption, message);
            }

            break;

        case RuntimePlatform.IPhonePlayer:
            IOSSocialManager.Instance.ShareMedia(message, texture);
            break;

#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
        case RuntimePlatform.WP8Player:
#else
        case RuntimePlatform.WSAPlayerARM:
        case RuntimePlatform.WSAPlayerX64:
        case RuntimePlatform.WSAPlayerX86:
#endif
            break;
        }
    }
コード例 #4
0
    public static void FacebookShare(string message, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent("Share", message, texture, "facebook.katana");
            }
            else
            {
                AndroidSocialGate.StartShareIntent("Share", message, "facebook.katana");
            }

            break;

        case RuntimePlatform.IPhonePlayer:
            IOSSocialManager.instance.FacebookPost(message, texture);
            break;

        case RuntimePlatform.WP8Player:
            WP8SocialManager.instance.FacebookPost(message, texture);
            break;
        }
    }
コード例 #5
0
    public static void TwitterShare(string status, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent("Share", status, texture, "twi");
            }
            else
            {
                AndroidSocialGate.StartShareIntent("Share", status, "twi");
            }


            break;

        case RuntimePlatform.IPhonePlayer:
            IOSSocialManager.instance.TwitterPost(status, null, texture);
            break;

        case RuntimePlatform.WP8Player:
            break;
        }
    }
コード例 #6
0
    public static void ShareMedia(string caption, string message, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent("Share", message, texture);
            }
            else
            {
                AndroidSocialGate.StartShareIntent("Share", message);
            }

            break;

        case RuntimePlatform.IPhonePlayer:
            IOSSocialManager.instance.ShareMedia(message, texture);
            break;

        case RuntimePlatform.WP8Player:
            WP8SocialManager.instance.ShareMedia(message, texture);
            break;
        }
    }
コード例 #7
0
    public static void InstagramShare(string status, Texture2D texture)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            if (texture != null)
            {
                AndroidSocialGate.StartShareIntent("Share", status, texture, "com.instagram.android");
            }
            else
            {
                AndroidSocialGate.StartShareIntent("Share", status, "com.instagram.android");
            }


            break;

        case RuntimePlatform.IPhonePlayer:

            IOSSocialManager.Instance.InstagramPost(texture, status);
            break;

        case RuntimePlatform.WP8Player:
            break;
        }
    }
コード例 #8
0
 public void ShareTexture()
 {
     #if UNITY_IOS
     IOSSocialManager.instance.ShareMedia("Timi's Playground", (Texture2D)textureToSave.mainTexture);
     #elif UNITY_ANDROID
     AndroidSocialGate.StartShareIntent("Timi's Playground", "Timi's Playground", (Texture2D)textureToSave.mainTexture);
     #endif
 }
コード例 #9
0
    public void NativeInvite(Texture2D tex)
    {
#if UNITY_IOS
        IOSSocialManager.OnMediaSharePostResult += HandleOnShareCallback;
        IOSSocialManager.Instance.ShareMedia(string.Format("{0} #{1}", Constants.ShareURLLink(Constants.ShareCodes.Native), Constants.HashTagSocials), tex);
#endif

#if UNITY_ANDROID
        AndroidSocialGate.OnShareIntentCallback += HandleOnShareIntentCallback;
        AndroidSocialGate.StartShareIntent(LocaliseText.Get("GameName"), string.Format("{0} #{1}", Constants.ShareURLLink(Constants.ShareCodes.Native), Constants.HashTagSocials), tex);
#endif
    }
コード例 #10
0
    private IEnumerator CaptureScreenshot(string text, GameObject[] disableObjects, GameObject[] enableObjects)
    {
        if (disableObjects != null)
        {
            for (int i = 0; i < disableObjects.Length; i++)
            {
                disableObjects[i].SetActive(false);
            }
        }

        if (enableObjects != null)
        {
            for (int i = 0; i < enableObjects.Length; i++)
            {
                enableObjects[i].SetActive(true);
            }
        }

        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);

        if (enableObjects != null)
        {
            for (int i = 0; i < enableObjects.Length; i++)
            {
                enableObjects[i].SetActive(false);
            }
        }

        if (disableObjects != null)
        {
            for (int i = 0; i < disableObjects.Length; i++)
            {
                disableObjects[i].SetActive(true);
            }
        }

        tex.Apply();

        AndroidSocialGate.StartShareIntent("Share", text, tex);

        Destroy(tex);
    }
コード例 #11
0
    private static void OnFacebookPackageCheckResult(AN_PackageCheckResult res)
    {
        if (res.IsSucceeded)
        {
            //if is installed lest shared it
            AndroidSocialGate.StartShareIntent(_shareTitle, _shareContent + " " + _playStoreURL, defaultImageToShare, "facebook.katana");
        }

        else
        {
            AndroidMessage msg = AndroidMessage.Create("Share error!", "Please before install facebook app");
        }

        AndroidNativeUtility.OnPackageCheckResult -= OnFacebookPackageCheckResult;
    }
コード例 #12
0
    IEnumerator ShareScreen()
    {
        bgLoadCanvasGroup.alpha          = 1;
        bgLoadCanvasGroup.blocksRaycasts = true;
        Texture2D texture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, true);

        texture.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0);
        texture.Apply();
        yield return(new WaitForSeconds(4));

        bgLoadCanvasGroup.alpha          = 0;
        bgLoadCanvasGroup.blocksRaycasts = false;

        AndroidSocialGate.StartShareIntent("Share", "This is my score. Try to Beat me! https://play.google.com/store/apps/details?id=com.Dreamup.Swapper", texture);
    }
コード例 #13
0
    private IEnumerator PostTWScreenshot()
    {
        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();

        AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", tex, "twi");

        Destroy(tex);
    }
コード例 #14
0
    public static void WhatsappShare(string message, Texture2D texture = null)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            AndroidSocialGate.StartShareIntent(string.Empty, message, texture, "whatsapp");
            break;

        case RuntimePlatform.IPhonePlayer:
            if (texture == null)
            {
                IOSSocialManager.Instance.WhatsAppShareText(message);
            }
            else
            {
                IOSSocialManager.Instance.WhatsAppShareImage(texture);
            }
            break;
        }
    }
コード例 #15
0
    public static void ShareMedia(string caption, string message, Texture2D[] textures)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.Android:
            AndroidSocialGate.StartShareIntent(caption, message, textures);
            break;

        case RuntimePlatform.IPhonePlayer:
            //TODO: Add iOS platform implementation here
            break;

#if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2
        case RuntimePlatform.WP8Player:
#else
        case RuntimePlatform.WSAPlayerARM:
        case RuntimePlatform.WSAPlayerX64:
        case RuntimePlatform.WSAPlayerX86:
#endif
            break;
        }
    }
コード例 #16
0
 public static void TwitterDefaultShare()
 {
     AndroidSocialGate.StartShareIntent(_shareTitle, _shareContent + " " + _playStoreURL, defaultImageToShare, "twi");
 }
コード例 #17
0
 public void PostImage()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", ImageToShare, "twi");
 }
コード例 #18
0
 private void PostMSG()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", "twi");
 }
コード例 #19
0
 private void PostImage()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", ImageToShare, "facebook.katana");
 }
コード例 #20
0
 public void ShareText()
 {
     AndroidSocialGate.OnShareIntentCallback += HandleOnShareIntentCallback;
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share https://d45nf.app.goo.gl/QcRv");
     //AndroidSocialGate.StartVideoPickerAndShareIntent("message for video", "share the video");
 }
コード例 #21
0
 public void GoogleShare()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", shareTexture, "com.google.android.apps.plus");
 }
コード例 #22
0
 public void TwitterShare()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", shareTexture, "twi");
 }
コード例 #23
0
 public void InstaShare()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share", shareTexture, "insta");
 }
コード例 #24
0
 public void ShareImage()
 {
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "Sharing Hello wolrd image", shareTexture);
 }
コード例 #25
0
 public void ShareText()
 {
     Debug.Log("ShareText");
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share");
 }
コード例 #26
0
 public void ShareText()
 {
     AndroidSocialGate.OnShareIntentCallback += HandleOnShareIntentCallback;
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share");
 }
コード例 #27
0
 public static void NativeSharing()
 {
     AndroidSocialGate.StartShareIntent(_shareTitle, _shareContent + " " + _playStoreURL, defaultImageToShare);
 }
コード例 #28
0
 public void ShareText()
 {
     AndroidSocialGate.OnShareIntentCallback += HandleOnShareIntentCallback;
     AndroidSocialGate.StartShareIntent("Hello Share Intent", "This is my text to share https://d45nf.app.goo.gl/QcRv");
 }