Class MiniSimulationView
Simulation view that can be drawn to a window and supports basic camera controls and composite rendering
Implements
Inherited Members
Namespace: UnityEditor.MARS.Simulation
Assembly: Unity.MARS.Editor.dll
Syntax
[Serializable]
[MovedFrom("Unity.MARS")]
public class MiniSimulationView : ScriptableObject, ISimulationView
Properties
BackgroundColor
Color to use as a background fill when drawing the composite
Declaration
public Color BackgroundColor { get; }
Property Value
Type | Description |
---|---|
Color |
BackgroundSceneActive
Is the composited scene the active scene
Declaration
public bool BackgroundSceneActive { get; }
Property Value
Type | Description |
---|---|
bool |
CameraTargetDescriptor
Render texture descriptor for the TargetCamera
Declaration
public RenderTextureDescriptor CameraTargetDescriptor { get; }
Property Value
Type | Description |
---|---|
RenderTextureDescriptor |
CompositeCamera
The composite camera being used in the view
Declaration
public Camera CompositeCamera { get; }
Property Value
Type | Description |
---|---|
Camera |
ContextViewType
Context view type of the view
Declaration
[Obsolete]
public ContextViewType ContextViewType { get; }
Property Value
Type | Description |
---|---|
ContextViewType |
DesaturateComposited
Desaturate the layer being composited to the view
Declaration
public bool DesaturateComposited { get; }
Property Value
Type | Description |
---|---|
bool |
SceneType
Type of view mode that is being used
Declaration
public ViewSceneType SceneType { get; set; }
Property Value
Type | Description |
---|---|
ViewSceneType |
ShowImageEffects
Are image effects active and should be rendered
Declaration
public bool ShowImageEffects { get; }
Property Value
Type | Description |
---|---|
bool |
TargetCamera
Camera associated with the view. This is the one providing the render for a view.
Declaration
public Camera TargetCamera { get; }
Property Value
Type | Description |
---|---|
Camera |
UseXRay
Enable the x-ray rendering for the view
Declaration
public bool UseXRay { get; }
Property Value
Type | Description |
---|---|
bool |
camera
Camera used to render the view.
Declaration
public Camera camera { get; }
Property Value
Type | Description |
---|---|
Camera |
isRotationLocked
Is rotation locked
Declaration
public bool isRotationLocked { get; set; }
Property Value
Type | Description |
---|---|
bool |
orthographic
Is the scene view ortho.
Declaration
public bool orthographic { get; set; }
Property Value
Type | Description |
---|---|
bool |
pivot
Center point of the view. Modify it to move the view immediately, or use LookAt to animate it nicely.
Declaration
public Vector3 pivot { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
rotation
The direction of the scene view. Modify it to rotate the view immediately, or use LookAt to animate it nicely.
Declaration
public Quaternion rotation { get; set; }
Property Value
Type | Description |
---|---|
Quaternion |
size
The size of the view measured diagonally.
Declaration
public float size { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
DrawMarsRenderView(Rect)
Draw as a dynamic view in the given rect.
Declaration
public void DrawMarsRenderView(Rect rect)
Parameters
Type | Name | Description |
---|---|---|
Rect | rect | Rect to draw the View. |
InitMiniSimulationView(float, float)
Initialize the mini simulation view
Declaration
public void InitMiniSimulationView(float width, float height)
Parameters
Type | Name | Description |
---|---|---|
float | width | width of the viewport |
float | height | height of the viewport |
LookAt(Vector3, Quaternion, float, bool, bool)
Look at a specific point from a given direction with a given zoom level, enabling and disabling perspective
Declaration
public void LookAt(Vector3 point, Quaternion direction, float newSize, bool ortho, bool instant)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point | The position in world space to frame. |
Quaternion | direction | The direction that the Scene view should view the target point from. |
float | newSize | The amount of camera zoom. Sets |
bool | ortho | Whether the camera focus is in orthographic mode (true) or perspective mode (false). |
bool | instant | Apply the movement immediately (true) or animate the transition (false). |
Repaint()
Make the view repaint.
Declaration
public void Repaint()
SetupViewAsSimUser(bool)
Setup the view as using the Simulation Scene.
Declaration
public void SetupViewAsSimUser(bool forceFrame = false)
Parameters
Type | Name | Description |
---|---|---|
bool | forceFrame | Force using the framing of the simulated environment settings. |
SingleFrameRepaint(bool)
Render the view as a single frame only
Declaration
public RenderTexture SingleFrameRepaint(bool frameView = false)
Parameters
Type | Name | Description |
---|---|---|
bool | frameView | Frame the view |
Returns
Type | Description |
---|---|
RenderTexture | The render texture output of the view's composite |