You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
818 B
31 lines
818 B
using UnityEngine;
|
|
using UnityEngine.Playables;
|
|
using UnityEngine.Timeline;
|
|
|
|
namespace uc.Timeline
|
|
{
|
|
public sealed class MoviePlayerClip : PlayableAsset, ITimelineClipAsset
|
|
{
|
|
//[System.NonSerialized]
|
|
public MoviePlayerBase movie;
|
|
|
|
public ClipCaps clipCaps { get { return ClipCaps.All & ~ClipCaps.Blending; } }
|
|
|
|
public override double duration
|
|
{
|
|
get
|
|
{
|
|
if (movie != null && movie.GetDuration != 0)
|
|
return movie.GetDuration;
|
|
else
|
|
return 5;
|
|
}
|
|
}
|
|
|
|
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
|
|
{
|
|
//owner is director's game object
|
|
return Playable.Create(graph);
|
|
}
|
|
}
|
|
}
|
|
|