Class MiniSimulationView
Simulation view that can be drawn to a window and supports basic camera controls and composite rendering
Namespace: UnityEditor.MARS.Simulation
Syntax
public class MiniSimulationView : ScriptableObject, ISimulationView, ICompositeView
Properties
BackgroundColor
Declaration
public Color BackgroundColor { get; }
Property Value
| Type | Description |
|---|---|
| Color |
BackgroundSceneActive
Declaration
public bool BackgroundSceneActive { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
camera
Camera used to render the view.
Declaration
public Camera camera { get; }
Property Value
| Type | Description |
|---|---|
| Camera |
Implements
CameraTargetDescriptor
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
Declaration
public ContextViewType ContextViewType { get; }
Property Value
| Type | Description |
|---|---|
| ContextViewType |
DesaturateComposited
Declaration
public bool DesaturateComposited { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
isRotationLocked
Is rotation locked
Declaration
public bool isRotationLocked { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Implements
orthographic
Is the scene view ortho.
Declaration
public bool orthographic { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Implements
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 |
Implements
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 |
Implements
SceneType
Type of view mode that is being used
Declaration
public ViewSceneType SceneType { get; set; }
Property Value
| Type | Description |
|---|---|
| ViewSceneType |
Implements
ShowImageEffects
Declaration
public bool ShowImageEffects { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
size
The size of the view measured diagonally.
Declaration
public float size { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
Implements
TargetCamera
Declaration
public Camera TargetCamera { get; }
Property Value
| Type | Description |
|---|---|
| Camera |
UseXRay
Declaration
public bool UseXRay { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
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(Single, Single)
Initialize the mini simulation view
Declaration
public void InitMiniSimulationView(float width, float height)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | width | width of the viewport |
| Single | height | height of the viewport |
LookAt(Vector3, Quaternion, Single, Boolean, Boolean)
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. |
| Single | newSize | The amount of camera zoom. Sets |
| Boolean | ortho | Whether the camera focus is in orthographic mode (true) or perspective mode (false). |
| Boolean | instant | Apply the movement immediately (true) or animate the transition (false). |
Implements
Repaint()
Make the view repaint.
Declaration
public void Repaint()
Implements
SetupViewAsSimUser(Boolean)
Setup the view as using the Simulation Scene.
Declaration
public void SetupViewAsSimUser(bool forceFrame = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | forceFrame | Force using the framing of the simulated environment settings. |
Implements
SingleFrameRepaint(Boolean)
Render the view as a single frame only
Declaration
public RenderTexture SingleFrameRepaint(bool frameView = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | frameView | Frame the view |
Returns
| Type | Description |
|---|---|
| RenderTexture | The render texture output of the view's composite |