public IEnumerator ShareScreenshotSoomla(Provider p)
    {
        isProcessing = true;
        // wait for graphics to render
        yield return(new WaitForEndOfFrame());

        //———————————————————————————————————————————————————————————– PHOTO
        // create the texture
        Texture2D screenTexture = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, true);

        // put buffer into texture
        screenTexture.ReadPixels(new Rect(0f, 0f, Screen.width, Screen.height), 0, 0);
        // apply
        screenTexture.Apply();
        //———————————————————————————————————————————————————————————– PHOTO
        string appLink = "";

        #if UNITY_ANDROID
        appLink = Manager.instance.ANDROID_APP_URL;
        #endif
        #if UNITY_IOS
        appLink = Manager.instance.IOS_APP_URL;
        #endif

        SoomlaProfile.UploadImage(
            p,
            "Bear Boom top score! How high can you get?",
            "BearBoomtopscore.png",
            screenTexture,
            "",
            null
            );

        isProcessing = false;
    }
Beispiel #2
0
        /// <summary>
        /// Opens this <c>Gate</c> by uploading the associated image.
        /// </summary>
        /// <returns>If the image was successfully uploaded returns <c>true</c>; otherwise
        /// <c>false</c>.</returns>
        protected override bool openInner()
        {
            if (CanOpen())
            {
                SoomlaProfile.UploadImage(Provider.FACEBOOK,
                                          Message,
                                          FileName,
                                          ImgTexture,
                                          this.ID);

                return(true);
            }

            return(false);
        }