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.

Property Description
ShowCursor Determines whether the cursor will be visible or not.
Constraints Cursor 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.

Property Description
Tag The 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.
FollowPosition If checked, transform's position will match the followed object's position.
FollowRotation If checked, transform's rotation will match the followed object's rotation.
FollowInEditor If 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.

Property Description
Type The type of gizmo to draw. Each type of gizmo exposes different properties in the inspector.
Color Color to use when drawing the gizmo.
UseWorldScale If 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 Modes Description
Hidden Gizmo will not be drawn.
Always Gizmo will always be drawn, regardless of selection.
If Selected Gizmo will be drawn when the object is included in the current selection.
If Top Level Selection Gizmo will be drawn when the object is the currently selected object, visible in the inspector.
If Not Selected Gizmo 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.

Property Description
CameraParent Moving the mouse will control the rotation of this Camera.
Speed The speed (or sensitivity) value that controls how much the camera will rotate in response to the mouse.
InvertX If checked, horizontal camera rotation will be inverted.
InvertY If checked, vertical camera rotation will be inverted.
MenuOpenedEvent The ScriptableEvent that indicates the main menu has been opened. When invoked, mouse look will be disabled.
MenuClosedEvent The ScriptableEvent that indicates the main menu has been opened. When invoked, mouse look will be enabled.
ActiveAtStart If checked, mouse look will be enabled during Start in Play mode.
ActiveAtStartEditor If 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.

Property Description
StartMode Specifies whether the program should start in a window or fullscreen.
DefaultWindowResolution Resolution to use when starting in windowed mode, or when switching to windowed mode and no other resolution has been set.
Button Button used to change current windowed setting.
ButtonMode Specifies 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