Skip to content

Components

Simon edited this page Apr 21, 2021 · 2 revisions

Namespace: WIDVE.Utilities
Location: WIDVE Unity Scripts/Utilities/Components

The Utilities/Components folder includes various components that don't fit neatly into any category.

CursorSettings

CursorSettings component

The CursorSettings component serves as an interface to control cursor settings for the program. Cursor settings are applied during Start and can also be changed through script.

PropertyDescription
ShowCursorDetermines whether the cursor will be visible or not.
ConstraintsCursor constraint options, using Unity's CursorLockMode enum.

FollowTransform

FollowTransform component

The FollowTransform component provides a simple way to have one GameObject's transform match the values of another Transform component. The object to follow is specified by a tag. The FollowTransform component will update its transform values to match the object being followed every LateUpdate during Play mode, and optionally during Edit mode as well.

PropertyDescription
TagThe tag that specifies which object to follow. The first Transform with the given tag will be used. If multiple objects use this tag, it cannot be guaranteed which object will be followed.
FollowPositionIf checked, transform's position will match the followed object's position.
FollowRotationIf checked, transform's rotation will match the followed object's rotation.
FollowInEditorIf checked, transform will follow the tagged object in Edit mode.

Gizmo

Gizmo component

The Gizmo component serves as a customizable way to draw gizmos during Edit mode, without having to hardcode gizmos into any specific script. It offers customizable properties for any type of gizmo that Unity supports. See Unity's Gizmo page for complete details. Gizmos are drawn using the component's current Transform values.

PropertyDescription
TypeThe type of gizmo to draw. Each type of gizmo exposes different properties in the inspector.
ColorColor to use when drawing the gizmo.
UseWorldScaleIf checked, gizmo size will be calculated using world scale rather than local scale.

The DrawMode property exposes several options for when to draw the gizmo, described below:

Gizmo Draw ModesDescription
HiddenGizmo will not be drawn.
AlwaysGizmo will always be drawn, regardless of selection.
If SelectedGizmo will be drawn when the object is included in the current selection.
If Top Level SelectionGizmo will be drawn when the object is the currently selected object, visible in the inspector.
If Not SelectedGizmo will be drawn when the object is not included in the current selection.

MouseLook

MouseLook component

The MouseLook component enables camera control through mouse movement. This is simlar to any first-person game.

PropertyDescription
CameraParentMoving the mouse will control the rotation of this Camera.
SpeedThe speed (or sensitivity) value that controls how much the camera will rotate in response to the mouse.
InvertXIf checked, horizontal camera rotation will be inverted.
InvertYIf checked, vertical camera rotation will be inverted.
MenuOpenedEventThe ScriptableEvent that indicates the main menu has been opened. When invoked, mouse look will be disabled.
MenuClosedEventThe ScriptableEvent that indicates the main menu has been opened. When invoked, mouse look will be enabled.
ActiveAtStartIf checked, mouse look will be enabled during Start in Play mode.
ActiveAtStartEditorIf checked, mouse look will be enabled when entering Play mode in the editor.

QuitApplication

QuitApplication component

The QuitApplication component quits the program in response to a Button press. It also provides a public method to quit the program from script. The QuitApplication component correctly handles quitting the program during Play mode in the editor, and should be used when this functionality is necessary.

WindowSettings

WindowSettings component

The WindowSettings component serves as a way to control fullscreen and window settings in the editor and through script.

PropertyDescription
StartModeSpecifies whether the program should start in a window or fullscreen.
DefaultWindowResolutionResolution to use when starting in windowed mode, or when switching to windowed mode and no other resolution has been set.
ButtonButton used to change current windowed setting.
ButtonModeSpecifies what pressing the Button should do. Can switch to fullscreen mode, switch to windowed mode, or toggle between fullscreen and windowed mode based on the current mode.

Clone this wiki locally