#if HAVE_USEQUENCER
using System;
using UnityEngine;
using WellFired;
namespace Framework.Camera {
/// Displays a camera frustum adjustment event in the uSequencer timeline
[CustomUSEditor(typeof(USAdjustFrustumEvent))]
public class USAdjustFrustumEventEditor : USEventBaseEditor {
/// Renders the event in the uSequencer timeline
/// Area covered by the event
/// The rectangle the event has covered
public override Rect RenderEvent(Rect myArea) {
USAdjustFrustumEvent cameraEvent = TargetEvent as USAdjustFrustumEvent;
if(cameraEvent == null) {
Debug.LogWarning(
"Trying to render an event as a USAdjustFrustumEvent, but it is a: " +
TargetEvent.GetType().ToString()
);
}
DrawDefaultBox(myArea);
GUILayout.BeginArea(myArea);
if(cameraEvent != null) {
GUILayout.Label("Adjust Frustum", DefaultLabel);
GUILayout.Label(
string.Format("{0} - {1}", cameraEvent.NearClipPlane, cameraEvent.FarClipPlane)
);
}
GUILayout.EndArea();
return myArea;
}
}
} // namespace Framework.Camera
#endif // HAVE_USEQUENCER