Description
The OnFrameTo
property is an event handler of type System.Action<BBox>
in the Editor.SceneEditorSession
class. It is used to define a callback that is triggered when a specific bounding box (BBox
) needs to be framed within the scene editor. This can be useful for focusing the editor's view on a particular area or object within the scene.
Usage
To use the OnFrameTo
property, assign a method that matches the System.Action<BBox>
delegate signature. This method will be called whenever the event is triggered, allowing you to implement custom logic for handling the framing of a bounding box in the scene editor.
Example
// Example of assigning a method to the OnFrameTo event
// Define a method that matches the Action<BBox> signature
void FrameToBoundingBox(BBox box)
{
// Implement logic to handle the framing of the bounding box
// For example, adjust the camera or editor view to focus on the box
// This is a placeholder for actual implementation
Console.WriteLine($"Framing to bounding box: {box}");
}
// Create an instance of SceneEditorSession
var sceneEditorSession = new SceneEditorSession();
// Assign the method to the OnFrameTo event
sceneEditorSession.OnFrameTo = FrameToBoundingBox;
// Now, whenever the OnFrameTo event is triggered, the FrameToBoundingBox method will be called