Ejemplo 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();
        }
Ejemplo n.º 2
0
Archivo: Gif.cs Proyecto: akil03/bx
 /// <summary>
 /// Plays the clip on the specified clip player.
 /// </summary>
 /// <param name="player">Player.</param>
 /// <param name="clip">Clip.</param>
 /// <param name="startDelay">Optional delay before the playing starts.</param>
 /// <param name="loop">If set to <c>true</c> loop indefinitely.</param>
 public static void PlayClip(IClipPlayer player, AnimatedClip clip, float startDelay = 0, bool loop = true)
 {
     if (player == null)
     {
         Debug.LogError("Player is null.");
         return;
     }
     else
     {
         player.Play(clip, startDelay, loop);
     }
 }
Ejemplo n.º 3
0
Archivo: Gif.cs Proyecto: akil03/bx
 /// <summary>
 /// Stops the clip player.
 /// </summary>
 /// <param name="player">Player.</param>
 public static void StopPlayer(IClipPlayer player)
 {
     if (player == null)
     {
         Debug.LogError("Player is null.");
         return;
     }
     else
     {
         player.Stop();
     }
 }