test
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "Timeline.Samples.Video.Editor",
|
||||
"references": [
|
||||
"GUID:f06555f75b070af458a003d92f9efb00",
|
||||
"GUID:02f771204943f4a40949438e873e3eff",
|
||||
"GUID:1b3591fbe8ae54d40b7e51a41d987b5c"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e42c9be5a2cd22f44bd16a41a92745e5
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,33 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor.Timeline;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Timeline.Samples
|
||||
{
|
||||
// Editor used by the TimelineEditor to customize the view of a VideoPlayableAsset
|
||||
[CustomTimelineEditor(typeof(VideoPlayableAsset))]
|
||||
public class VideoAssetClipEditor : ClipEditor
|
||||
{
|
||||
// Called by the Timeline Editor to draw the background of the timeline clip
|
||||
// when the clip has a VideoPlayableAsset attached
|
||||
public override void DrawBackground(TimelineClip clip, ClipBackgroundRegion region)
|
||||
{
|
||||
VideoPlayableAsset videoAsset = clip.asset as VideoPlayableAsset;
|
||||
if (videoAsset != null && videoAsset.videoClip != null)
|
||||
{
|
||||
// Load the preview or the thumbnail for the video
|
||||
Texture texturePreview = AssetPreview.GetAssetPreview(videoAsset.videoClip);
|
||||
if (texturePreview == null)
|
||||
texturePreview = AssetPreview.GetMiniThumbnail(videoAsset.videoClip);
|
||||
|
||||
if (texturePreview != null)
|
||||
{
|
||||
Rect rect = region.position;
|
||||
rect.width = texturePreview.width * rect.height / texturePreview.height;
|
||||
GUI.DrawTexture(rect, texturePreview, ScaleMode.StretchToFill);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0581bc7142d0a18408d067aa7ff193b2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user