C# Class Microsoft.MixedReality.Toolkit.Utilities.Editor.MixedRealityInspectorUtility

This class has handy inspector utilities and functions.
显示文件 Open project: microsoft/MixedReality-WorldLockingTools-Samples Class Usage Examples

Public Properties

Property Type Description
DarkColor Color
DisabledColor Color
ErrorColor Color
HandleColorAxis Color
HandleColorCircle Color
HandleColorRotation Color
HandleColorSphere Color
HandleColorSquare Color
HandleColorTangent Color
LineVelocityColor Color
LogoDarkTheme Texture2D
LogoLightTheme Texture2D
SectionColor Color
SuccessColor Color
WarningColor Color

Public Methods

Method Description
AddMixedRealityToolkitToScene ( MixedRealityToolkitConfigurationProfile configProfile = null, bool inPlayMode = false ) : void

If MRTK is not initialized in scene, adds and initializes instance to current scene

AxisMoveHandle ( Object target, Vector3 origin, Vector3 direction, float distance, float handleSize = 0.2f, bool autoSize = true, bool recordUndo = true ) : float

Draw an axis move handle.

CenterOnMainWin ( EditorWindow window ) : void

Centers an editor window on the main display.

CheckMixedRealityConfigured ( bool renderEditorElements = false ) : bool

Check and make sure we have a Mixed Reality Toolkit and an active profile.

CircleMoveHandle ( Object target, Vector3 position, float xScale = 1f, float yScale = 1f, float zScale = 1f, float handleSize = 0.2f, bool autoSize = true, bool recordUndo = true ) : Vector3

Draw a Circle Move Handle.

DrawProfileDropDownList ( SerializedProperty property, BaseMixedRealityProfile profile, Object oldProfileObject, Array profileTypes, bool requiresProfile, bool showAddButton ) : bool

Draws a dropdown with all available profiles of types contained in the array profilyTypes.

DrawProfileDropDownList ( SerializedProperty property, BaseMixedRealityProfile profile, Object oldProfileObject, Type profileType, bool requiresProfile, bool showAddButton ) : bool

Draws a dropdown with all available profiles of profilyType.

DrawSubProfileEditor ( Object profileObject, bool renderProfileInBox ) : void

Draws an editor for a profile object.

GetDefaultConfigProfile ( ) : MixedRealityToolkitConfigurationProfile

Returns the default config profile, if it exists.

GetDefaultConfigProfile ( Array allProfiles ) : MixedRealityToolkitConfigurationProfile

Given a list of MixedRealityToolkitConfigurationProfile objects, returns the one that matches the default profile name.

GetEditorMainWindowPos ( ) : Rect

Found at https://answers.unity.com/questions/960413/editor-window-how-to-center-a-window.html

RenderMixedRealityToolkitLogo ( ) : void

Render the Mixed Reality Toolkit Logo.

RotationHandle ( Object target, Vector3 position, Quaternion rotation, float handleSize = 0.2f, bool autoSize = true, bool recordUndo = true ) : Quaternion

Draw a rotation handle.

SphereMoveHandle ( Object target, Vector3 position, float xScale = 1f, float yScale = 1f, float zScale = 1f, float handleSize = 0.2f, bool autoSize = true, bool recordUndo = true ) : Vector3

Draw a sphere move handle.

SquareMoveHandle ( Object target, Vector3 position, float xScale = 1f, float yScale = 1f, float zScale = 1f, float handleSize = 0.2f, bool autoSize = true, bool recordUndo = true ) : Vector3

Draw a square move handle.

VectorHandle ( Object target, Vector3 origin, Vector3 vector, bool normalize = true, bool clamp = true, float handleLength = 1f, float handleSize = 0.1f, bool recordUndo = true, bool autoSize = true ) : Vector3

Draw a vector handle.

Private Methods

Method Description
GetAllDerivedTypes ( AppDomain appDomain, Type aType ) : Type[]

Method Details

AddMixedRealityToolkitToScene() public static method

If MRTK is not initialized in scene, adds and initializes instance to current scene
public static AddMixedRealityToolkitToScene ( MixedRealityToolkitConfigurationProfile configProfile = null, bool inPlayMode = false ) : void
configProfile MixedRealityToolkitConfigurationProfile
inPlayMode bool
return void

AxisMoveHandle() public static method

Draw an axis move handle.
public static AxisMoveHandle ( Object target, Vector3 origin, Vector3 direction, float distance, float handleSize = 0.2f, bool autoSize = true, bool recordUndo = true ) : float
target UnityEngine.Object Object that is undergoing the transformation. Also used for recording undo.
origin Vector3 The initial position of the axis.
direction Vector3 The direction the axis is facing.
distance float Distance from the axis.
handleSize float Optional handle size.
autoSize bool Optional, auto sizes the handles based on position and handle size.
recordUndo bool Optional, records undo state.
return float

CenterOnMainWin() public static method

Centers an editor window on the main display.
public static CenterOnMainWin ( EditorWindow window ) : void
window EditorWindow
return void

CheckMixedRealityConfigured() public static method

Check and make sure we have a Mixed Reality Toolkit and an active profile.
public static CheckMixedRealityConfigured ( bool renderEditorElements = false ) : bool
renderEditorElements bool
return bool

CircleMoveHandle() public static method

Draw a Circle Move Handle.
public static CircleMoveHandle ( Object target, Vector3 position, float xScale = 1f, float yScale = 1f, float zScale = 1f, float handleSize = 0.2f, bool autoSize = true, bool recordUndo = true ) : Vector3
target UnityEngine.Object Object that is undergoing the transformation. Also used for recording undo.
position Vector3 The position to draw the handle.
xScale float Scale the new value on the x axis by this amount.
yScale float Scale the new value on the x axis by this amount.
zScale float Scale the new value on the x axis by this amount.
handleSize float Optional handle size.
autoSize bool Optional, auto sizes the handles based on position and handle size.
recordUndo bool Optional, records undo state.
return Vector3

DrawProfileDropDownList() public static method

Draws a dropdown with all available profiles of types contained in the array profilyTypes.
public static DrawProfileDropDownList ( SerializedProperty property, BaseMixedRealityProfile profile, Object oldProfileObject, Array profileTypes, bool requiresProfile, bool showAddButton ) : bool
property SerializedProperty
profile BaseMixedRealityProfile
oldProfileObject UnityEngine.Object
profileTypes Array
requiresProfile bool
showAddButton bool
return bool

DrawProfileDropDownList() public static method

Draws a dropdown with all available profiles of profilyType.
public static DrawProfileDropDownList ( SerializedProperty property, BaseMixedRealityProfile profile, Object oldProfileObject, Type profileType, bool requiresProfile, bool showAddButton ) : bool
property SerializedProperty
profile BaseMixedRealityProfile
oldProfileObject UnityEngine.Object
profileType Type
requiresProfile bool
showAddButton bool
return bool

DrawSubProfileEditor() public static method

Draws an editor for a profile object.
public static DrawSubProfileEditor ( Object profileObject, bool renderProfileInBox ) : void
profileObject UnityEngine.Object
renderProfileInBox bool
return void

GetDefaultConfigProfile() public static method

Returns the default config profile, if it exists.
public static GetDefaultConfigProfile ( ) : MixedRealityToolkitConfigurationProfile
return MixedRealityToolkitConfigurationProfile

GetDefaultConfigProfile() public static method

Given a list of MixedRealityToolkitConfigurationProfile objects, returns the one that matches the default profile name.
public static GetDefaultConfigProfile ( Array allProfiles ) : MixedRealityToolkitConfigurationProfile
allProfiles Array
return MixedRealityToolkitConfigurationProfile

GetEditorMainWindowPos() public static method

Found at https://answers.unity.com/questions/960413/editor-window-how-to-center-a-window.html
public static GetEditorMainWindowPos ( ) : Rect
return Rect

RenderMixedRealityToolkitLogo() public static method

Render the Mixed Reality Toolkit Logo.
public static RenderMixedRealityToolkitLogo ( ) : void
return void

RotationHandle() public static method

Draw a rotation handle.
public static RotationHandle ( Object target, Vector3 position, Quaternion rotation, float handleSize = 0.2f, bool autoSize = true, bool recordUndo = true ) : Quaternion
target UnityEngine.Object Object that is undergoing the transformation. Also used for recording undo.
position Vector3 The position to draw the handle.
rotation Quaternion The rotation to draw the handle.
handleSize float Optional, handle size.
autoSize bool Optional, auto sizes the handles based on position and handle size.
recordUndo bool Optional, records undo state.
return Quaternion

SphereMoveHandle() public static method

Draw a sphere move handle.
public static SphereMoveHandle ( Object target, Vector3 position, float xScale = 1f, float yScale = 1f, float zScale = 1f, float handleSize = 0.2f, bool autoSize = true, bool recordUndo = true ) : Vector3
target UnityEngine.Object Object that is undergoing the transformation. Also used for recording undo.
position Vector3 The position to draw the handle.
xScale float Scale the new value on the x axis by this amount.
yScale float Scale the new value on the x axis by this amount.
zScale float Scale the new value on the x axis by this amount.
handleSize float Optional handle size.
autoSize bool Optional, auto sizes the handles based on position and handle size.
recordUndo bool Optional, records undo state.
return Vector3

SquareMoveHandle() public static method

Draw a square move handle.
public static SquareMoveHandle ( Object target, Vector3 position, float xScale = 1f, float yScale = 1f, float zScale = 1f, float handleSize = 0.2f, bool autoSize = true, bool recordUndo = true ) : Vector3
target UnityEngine.Object Object that is undergoing the transformation. Also used for recording undo.
position Vector3 The position to draw the handle.
xScale float Scale the new value on the x axis by this amount.
yScale float Scale the new value on the x axis by this amount.
zScale float Scale the new value on the x axis by this amount.
handleSize float Optional handle size.
autoSize bool Optional, auto sizes the handles based on position and handle size.
recordUndo bool Optional, records undo state.
return Vector3

VectorHandle() public static method

Draw a vector handle.
public static VectorHandle ( Object target, Vector3 origin, Vector3 vector, bool normalize = true, bool clamp = true, float handleLength = 1f, float handleSize = 0.1f, bool recordUndo = true, bool autoSize = true ) : Vector3
target UnityEngine.Object Object that is undergoing the transformation. Also used for recording undo.
origin Vector3
vector Vector3
normalize bool Optional, Normalize the new vector value.
clamp bool Optional, Clamp new vector's value based on the distance to the origin.
handleLength float Optional, handle length.
handleSize float Optional, handle size.
recordUndo bool Optional, records undo state.
autoSize bool Optional, auto sizes the handles based on position and handle size.
return Vector3

Property Details

DarkColor public_oe static_oe property

public static Color DarkColor
return Color

DisabledColor public_oe static_oe property

public static Color DisabledColor
return Color

ErrorColor public_oe static_oe property

public static Color ErrorColor
return Color

HandleColorAxis public_oe static_oe property

public static Color HandleColorAxis
return Color

HandleColorCircle public_oe static_oe property

public static Color HandleColorCircle
return Color

HandleColorRotation public_oe static_oe property

public static Color HandleColorRotation
return Color

HandleColorSphere public_oe static_oe property

public static Color HandleColorSphere
return Color

HandleColorSquare public_oe static_oe property

public static Color HandleColorSquare
return Color

HandleColorTangent public_oe static_oe property

public static Color HandleColorTangent
return Color

LineVelocityColor public_oe static_oe property

public static Color LineVelocityColor
return Color

LogoDarkTheme public_oe static_oe property

public static Texture2D LogoDarkTheme
return Texture2D

LogoLightTheme public_oe static_oe property

public static Texture2D LogoLightTheme
return Texture2D

SectionColor public_oe static_oe property

public static Color SectionColor
return Color

SuccessColor public_oe static_oe property

public static Color SuccessColor
return Color

WarningColor public_oe static_oe property

public static Color WarningColor
return Color