12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
-
- #if (UNITY_2018_1_OR_NEWER && AVPRO_PACKAGE_TIMELINE)
- using UnityEngine;
- using UnityEngine.Playables;
- using UnityEngine.Timeline;
- using System.Collections.Generic;
- namespace RenderHeads.Media.AVProVideo.Playables
- {
- [System.Serializable]
- public class MediaPlayerControlAsset : PlayableAsset
- {
- public Object binding { get; set; }
-
- public MediaReference mediaReference;
- [Range(0f, 1f)]
- public float audioVolume = 1f;
- public double startTime = -1.0;
- public bool pauseOnEnd = true;
- public override Playable CreatePlayable (PlayableGraph graph, GameObject owner)
- {
- var playable = ScriptPlayable<MediaPlayerControlBehaviour>.Create(graph);
- var behaviour = playable.GetBehaviour();
-
- behaviour.audioVolume = audioVolume;
- behaviour.pauseOnEnd = pauseOnEnd;
- behaviour.startTime = startTime;
- behaviour.mediaReference = mediaReference;
- behaviour.mediaPlayer = (MediaPlayer)binding;
- return playable;
- }
- }
- }
- #endif
|