test
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "Timeline.Samples.Tween.Editor",
|
||||
"references": [
|
||||
"GUID:f06555f75b070af458a003d92f9efb00",
|
||||
"GUID:02f771204943f4a40949438e873e3eff",
|
||||
"GUID:5aa8f7d60b800d541918c447feb05a5a"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 75818fc8ec6b2c64793fde0cb60c9172
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,45 @@
|
||||
using UnityEditor;
|
||||
using UnityEditor.Timeline;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Timeline.Samples
|
||||
{
|
||||
// Editor used by the TimelineEditor to customize the view of TweenClip.
|
||||
[CustomTimelineEditor(typeof(TweenClip))]
|
||||
public class TweenClipEditor : ClipEditor
|
||||
{
|
||||
static GUIStyle s_StartTextStyle;
|
||||
static GUIStyle s_EndTextStyle;
|
||||
|
||||
static TweenClipEditor()
|
||||
{
|
||||
s_StartTextStyle = GUI.skin.label;
|
||||
s_EndTextStyle = new GUIStyle(GUI.skin.label) { alignment = TextAnchor.MiddleRight };
|
||||
}
|
||||
|
||||
// Called by the Timeline editor to draw the background of a TweenClip.
|
||||
public override void DrawBackground(TimelineClip clip, ClipBackgroundRegion region)
|
||||
{
|
||||
TweenClip asset = clip.asset as TweenClip;
|
||||
|
||||
if (asset == null)
|
||||
return;
|
||||
|
||||
PlayableDirector director = TimelineEditor.inspectedDirector;
|
||||
|
||||
if (director == null)
|
||||
return;
|
||||
|
||||
Transform startLocation = director.GetReferenceValue(asset.startLocation.exposedName, out bool startFound) as Transform;
|
||||
Transform endLocation = director.GetReferenceValue(asset.endLocation.exposedName, out bool endFound) as Transform;
|
||||
|
||||
if (startFound && startLocation != null)
|
||||
EditorGUI.LabelField(region.position, startLocation.gameObject.name, s_StartTextStyle);
|
||||
|
||||
if (endFound && endLocation != null)
|
||||
EditorGUI.LabelField(region.position, endLocation.gameObject.name, s_EndTextStyle);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 516ce7ed748647adb925b7fe7ef3f62c
|
||||
timeCreated: 1598901529
|
Reference in New Issue
Block a user