public void UploadGIFToGiphy()
        {
            if (isExportingGif)
            {
                NativeUI.Alert("Exporting In Progress", "Please wait until the GIF exporting is completed.");
                return;
            }
            else if (string.IsNullOrEmpty(exportedGifPath))
            {
                NativeUI.Alert("No Exported GIF", "Please export a GIF file first.");
                return;
            }

            isUploadingGif = true;

            var content = new GiphyUploadParams();

            content.localImagePath = exportedGifPath;
            content.tags           = "demo, easy mobile, sglib games, unity3d";

            if (!string.IsNullOrEmpty(giphyUsername) && !string.IsNullOrEmpty(giphyApiKey))
            {
                Giphy.Upload(giphyUsername, giphyApiKey, content, OnGiphyUploadProgress, OnGiphyUploadCompleted, OnGiphyUploadFailed);
            }
            else
            {
                Giphy.Upload(content, OnGiphyUploadProgress, OnGiphyUploadCompleted, OnGiphyUploadFailed);
            }
        }
Exemple #2
0
        public void UploadGIFToGiphy()
        {
            if (isExportingGif)
            {
                NativeUI.Alert("Exporting In Progress", "Please wait until the GIF exporting is completed.");
                return;
            }
            else if (string.IsNullOrEmpty(exportedGifPath))
            {
                NativeUI.Alert("No Exported GIF", "Please export a GIF file first.");
                return;
            }

            isUploadingGif = true;

            var content = new GiphyUploadParams();

            content.localImagePath = exportedGifPath;
            content.tags           = "demo, easy mobile, sglib games, unity3d";

            if (!string.IsNullOrEmpty(giphyUsername) && !string.IsNullOrEmpty(giphyApiKey))
            {
                Giphy.Upload(giphyUsername, giphyApiKey, content, OnGiphyUploadProgress, OnGiphyUploadCompleted, OnGiphyUploadFailed);
            }
            else
#if UNITY_EDITOR
            { Debug.LogError("Upload failed: please provide valid Giphy username and API key in the GifDemo game object."); }
#else
            { NativeUI.Alert("Upload Failed", "Please provide valid Giphy username and API key in the GifDemo game object."); }
#endif
        }
Exemple #3
0
    void UploadGIFToGiphy(string path)
    {
        var content = new GiphyUploadParams();

        content.localImagePath = path;
        content.tags           = ScreenshotSharer.Instance.giphyUploadTags;

        if (!string.IsNullOrEmpty(ScreenshotSharer.Instance.giphyUsername) && !string.IsNullOrEmpty(ScreenshotSharer.Instance.giphyApiKey))
        {
            Giphy.Upload(ScreenshotSharer.Instance.giphyUsername, ScreenshotSharer.Instance.giphyApiKey,
                         content, OnGiphyUploadProgress, OnGiphyUploadCompleted, OnGiphyUploadFailed);
        }
        else
        {
            Giphy.Upload(content, OnGiphyUploadProgress, OnGiphyUploadCompleted, OnGiphyUploadFailed);
        }

        isUploadingGif = true;
    }
Exemple #4
0
        public override void OnEnter()
        {
            var content = new GiphyUploadParams();

            content.localImagePath = localImagePath.Value;
            content.sourceImageUrl = remoteImageUrl.Value;
            content.tags           = tags.Value;
            content.sourcePostUrl  = sourcePostUrl.Value;
            content.isHidden       = isHidden.Value;

            if (useGiphyBetaKey.Value)
            {
                Giphy.Upload(content, UploadProgressCallback, UploadCompletedCallback, UploadFailedCallback);
            }
            else
            {
                Giphy.Upload(giphyUsername.Value, giphyApiKey.Value, content, UploadProgressCallback, UploadCompletedCallback, UploadFailedCallback);
            }
        }