Exemplo n.º 1
0
        public override void OnEnter()
        {
            _player = playerType == PlayerType.ClipPlayer ? (IClipPlayer)clipPlayer : (IClipPlayer)clipPlayerUI;

            switch (actionType)
            {
            case ActionType.Play:
                var proxyClip = (AnimatedClipProxy)clip.Value;
                Gif.PlayClip(_player, proxyClip.clip, startDelay.Value, loop.Value);
                break;

            case ActionType.Pause:
                Gif.PausePlayer(_player);
                break;

            case ActionType.Resume:
                Gif.ResumePlayer(_player);
                break;

            case ActionType.Stop:
                Gif.StopPlayer(_player);
                break;
            }

            Finish();
        }
Exemplo n.º 2
0
 public void OpenPlaybackPanel()
 {
     if (recordedClip != null)
     {
         playbackPanel.SetActive(true);
         Gif.PlayClip(clipPlayer, recordedClip, 1f);
     }
     else
     {
         NativeUI.Alert("Nothing Recorded", "Please finish recording first.");
     }
 }
Exemplo n.º 3
0
    public void OpenPlaybackPanel(int playerID)
    {
        if (currentClip != null)
        {
            currentClip.Dispose();
        }

        if (isPlaying)
        {
            CancelInvoke();
        }

        if (playerID == 0)
        {
            if (recordedClip1 != null)
            {
                playbackPanel.SetActive(true);
                playbackPanel.transform.DOScale(Vector3.one, 0.5f);
                currentClip = recordedClip1;
                Gif.PlayClip(clipPlayer, currentClip, 0.25f, false);
                Invoke("ClosePlaybackPanel", currentClip.Length + 0.5f);
                isPlaying = true;
            }
            else
            {
                NativeUI.Alert("Nothing Recorded", "Please finish recording first.");
            }
        }
        else
        {
            if (recordedClip2 != null)
            {
                playbackPanel.SetActive(true);
                playbackPanel.transform.DOScale(Vector3.one, 0.5f);
                currentClip = recordedClip2;
                Gif.PlayClip(clipPlayer, currentClip, 0.25f, false);
                Invoke("ClosePlaybackPanel", currentClip.Length + 0.5f);
                isPlaying = true;
            }
            else
            {
                NativeUI.Alert("Nothing Recorded", "Please finish recording first.");
            }
        }
    }
Exemplo n.º 4
0
        public void ShowDemoGifFirstFrame()
        {
            decodedClipPlayer.gameObject.SetActive(true);

            if (string.IsNullOrEmpty(demoGifFilePath))
            {
                Debug.LogError("Couldn't file demo GIF file in persistentDataPath. Filepath: " + demoGifFilePath);
                return;
            }

            Gif.DecodeGif(demoGifFilePath, 1, decodeThreadPriority, clip =>
            {
                if (clip != null)
                {
                    decodedClip = clip;
                    clip.SetFilterMode(FilterMode.Point);
                    Gif.PlayClip(decodedClipPlayer, decodedClip);
                }
                else
                {
                    Debug.LogError("Error decoding GIF: received null AnimatedClip object.");
                }
            });
        }