2022-01-12 10:06:03 +03:00
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.Timeline;
|
|
|
|
|
|
|
|
namespace UnityEditor.Timeline.Signals
|
|
|
|
{
|
|
|
|
[CustomTimelineEditor(typeof(SignalEmitter))]
|
|
|
|
class SignalEmitterEditor : MarkerEditor
|
|
|
|
{
|
2022-01-12 10:39:15 +03:00
|
|
|
static readonly string MissingAssetError = L10n.Tr("No signal assigned");
|
2022-01-12 10:06:03 +03:00
|
|
|
|
|
|
|
public override MarkerDrawOptions GetMarkerOptions(IMarker marker)
|
|
|
|
{
|
|
|
|
var options = base.GetMarkerOptions(marker);
|
|
|
|
SignalEmitter emitter = (SignalEmitter)marker;
|
|
|
|
if (emitter.asset != null)
|
|
|
|
options.tooltip = emitter.asset.name;
|
|
|
|
else
|
|
|
|
options.errorText = MissingAssetError;
|
|
|
|
|
|
|
|
return options;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|