Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(InputActionProperty): add functionality based around InputActions #39

Merged
merged 1 commit into from
Dec 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions Documentation/API/Tracking.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Documentation/API/Tracking/Velocity.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,299 @@
# Class InputActionPropertyVelocityTracker

Retrieves the velocity and angular velocity from the specified InputActionProperty.

## Contents

* [Inheritance]
* [Namespace]
* [Syntax]
* [Fields]
* [currentAngularVelocity]
* [currentVelocity]
* [Properties]
* [AngularVelocitySource]
* [VelocitySource]
* [Methods]
* [AngularVelocityActionCanceled(InputAction.CallbackContext)]
* [AngularVelocityActionPerformed(InputAction.CallbackContext)]
* [BindAngularVelocityActions()]
* [BindVelocityActions()]
* [DisableAction(InputActionProperty)]
* [DoGetAngularVelocity()]
* [DoGetVelocity()]
* [EnableAction(InputActionProperty)]
* [OnDisable()]
* [OnEnable()]
* [UnbindAngularVelocityActions()]
* [UnbindVelocityActions()]
* [VelocityActionCanceled(InputAction.CallbackContext)]
* [VelocityActionPerformed(InputAction.CallbackContext)]

## Details

##### Inheritance

* System.Object
* InputActionPropertyVelocityTracker

##### Namespace

* [Tilia.Input.UnityInputSystem.Tracking.Velocity]

##### Syntax

```
public class InputActionPropertyVelocityTracker : VelocityTracker
```

### Fields

#### currentAngularVelocity

The current angular velocity.

##### Declaration

```
protected Vector3 currentAngularVelocity
```

#### currentVelocity

The current velocity.

##### Declaration

```
protected Vector3 currentVelocity
```

### Properties

#### AngularVelocitySource

The InputActionProperty containing the angular velocity source.

##### Declaration

```
public InputActionProperty AngularVelocitySource { get; set; }
```

#### VelocitySource

The InputActionProperty containing the velocity source.

##### Declaration

```
public InputActionProperty VelocitySource { get; set; }
```

### Methods

#### AngularVelocityActionCanceled(InputAction.CallbackContext)

Processes the context when the angular velocity InputActionProperty is canceled.

##### Declaration

```
protected virtual void AngularVelocityActionCanceled(InputAction.CallbackContext context)
```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| InputAction.CallbackContext | context | The action context data. |

#### AngularVelocityActionPerformed(InputAction.CallbackContext)

Processes the context when the angular velocity InputActionProperty is performed.

##### Declaration

```
protected virtual void AngularVelocityActionPerformed(InputAction.CallbackContext context)
```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| InputAction.CallbackContext | context | The action context data. |

#### BindAngularVelocityActions()

Binds the angular velocity performed and canceled actions to the processing methods.

##### Declaration

```
protected virtual void BindAngularVelocityActions()
```

#### BindVelocityActions()

Binds the velocity performed and canceled actions to the processing methods.

##### Declaration

```
protected virtual void BindVelocityActions()
```

#### DisableAction(InputActionProperty)

Disables the given InputActionProperty.

##### Declaration

```
protected virtual void DisableAction(InputActionProperty property)
```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| InputActionProperty | property | The property to disable. |

#### DoGetAngularVelocity()

##### Declaration

```
protected override Vector3 DoGetAngularVelocity()
```

##### Returns

| Type | Description |
| --- | --- |
| Vector3 | n/a |

#### DoGetVelocity()

##### Declaration

```
protected override Vector3 DoGetVelocity()
```

##### Returns

| Type | Description |
| --- | --- |
| Vector3 | n/a |

#### EnableAction(InputActionProperty)

Enables the given InputActionProperty.

##### Declaration

```
protected virtual void EnableAction(InputActionProperty property)
```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| InputActionProperty | property | The property to enable. |

#### OnDisable()

##### Declaration

```
protected virtual void OnDisable()
```

#### OnEnable()

##### Declaration

```
protected virtual void OnEnable()
```

#### UnbindAngularVelocityActions()

Unbinds the velocity performed and canceled actions from the processing methods.

##### Declaration

```
protected virtual void UnbindAngularVelocityActions()
```

#### UnbindVelocityActions()

Unbinds the velocity performed and canceled actions from the processing methods.

##### Declaration

```
protected virtual void UnbindVelocityActions()
```

#### VelocityActionCanceled(InputAction.CallbackContext)

Processes the context when the velocity InputActionProperty is canceled.

##### Declaration

```
protected virtual void VelocityActionCanceled(InputAction.CallbackContext context)
```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| InputAction.CallbackContext | context | The action context data. |

#### VelocityActionPerformed(InputAction.CallbackContext)

Processes the context when the velocity InputActionProperty is performed.

##### Declaration

```
protected virtual void VelocityActionPerformed(InputAction.CallbackContext context)
```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| InputAction.CallbackContext | context | The action context data. |

[Tilia.Input.UnityInputSystem.Tracking.Velocity]: README.md
[Inheritance]: #Inheritance
[Namespace]: #Namespace
[Syntax]: #Syntax
[Fields]: #Fields
[currentAngularVelocity]: #currentAngularVelocity
[currentVelocity]: #currentVelocity
[Properties]: #Properties
[AngularVelocitySource]: #AngularVelocitySource
[VelocitySource]: #VelocitySource
[Methods]: #Methods
[AngularVelocityActionCanceled(InputAction.CallbackContext)]: #AngularVelocityActionCanceledInputAction.CallbackContext
[AngularVelocityActionPerformed(InputAction.CallbackContext)]: #AngularVelocityActionPerformedInputAction.CallbackContext
[BindAngularVelocityActions()]: #BindAngularVelocityActions
[BindVelocityActions()]: #BindVelocityActions
[DisableAction(InputActionProperty)]: #DisableActionInputActionProperty
[DoGetAngularVelocity()]: #DoGetAngularVelocity
[DoGetVelocity()]: #DoGetVelocity
[EnableAction(InputActionProperty)]: #EnableActionInputActionProperty
[OnDisable()]: #OnDisable
[OnEnable()]: #OnEnable
[UnbindAngularVelocityActions()]: #UnbindAngularVelocityActions
[UnbindVelocityActions()]: #UnbindVelocityActions
[VelocityActionCanceled(InputAction.CallbackContext)]: #VelocityActionCanceledInputAction.CallbackContext
[VelocityActionPerformed(InputAction.CallbackContext)]: #VelocityActionPerformedInputAction.CallbackContext

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Documentation/API/Tracking/Velocity/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Namespace Tilia.Input.UnityInputSystem.Tracking.Velocity

### Classes

#### [InputActionPropertyVelocityTracker]

Retrieves the velocity and angular velocity from the specified InputActionProperty.

[InputActionPropertyVelocityTracker]: InputActionPropertyVelocityTracker.md
7 changes: 7 additions & 0 deletions Documentation/API/Tracking/Velocity/README.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ Transforms a InputAction.CallbackContext to a System.Boolean.
##### Inheritance

* System.Object
* [InputSystemTransformer]<InputAction.CallbackContext, System.Boolean, [CallbackContextToBoolean.UnityEvent]\>
* [CallbackContextTransformer]<System.Boolean, [CallbackContextToBoolean.UnityEvent]\>
* CallbackContextToBoolean

##### Inherited Members

[CallbackContextTransformer<Boolean, CallbackContextToBoolean.UnityEvent>.ContextToProcess]

[CallbackContextTransformer<Boolean, CallbackContextToBoolean.UnityEvent>.ProcessResult(InputAction.CallbackContext)]

[InputSystemTransformer<InputAction.CallbackContext, Boolean, CallbackContextToBoolean.UnityEvent>.ContextToProcess]

##### Namespace

* [Tilia.Input.UnityInputSystem.Transformation.Conversion]
Expand Down Expand Up @@ -58,10 +59,11 @@ protected override bool Process(InputAction.CallbackContext input)
| --- | --- |
| System.Boolean | The transformed value. |

[InputSystemTransformer]: InputSystemTransformer-3.md
[CallbackContextTransformer]: CallbackContextTransformer-2.md
[CallbackContextToBoolean.UnityEvent]: CallbackContextToBoolean.UnityEvent.md
[CallbackContextTransformer<Boolean, CallbackContextToBoolean.UnityEvent>.ContextToProcess]: CallbackContextTransformer-2.md#Tilia_Input_UnityInputSystem_Transformation_Conversion_CallbackContextTransformer_2_ContextToProcess
[CallbackContextTransformer<Boolean, CallbackContextToBoolean.UnityEvent>.ProcessResult(InputAction.CallbackContext)]: CallbackContextTransformer-2.md#Tilia_Input_UnityInputSystem_Transformation_Conversion_CallbackContextTransformer_2_ProcessResult_InputAction_CallbackContext_
[InputSystemTransformer<InputAction.CallbackContext, Boolean, CallbackContextToBoolean.UnityEvent>.ContextToProcess]: InputSystemTransformer-3.md#Tilia_Input_UnityInputSystem_Transformation_Conversion_InputSystemTransformer_3_ContextToProcess
[Tilia.Input.UnityInputSystem.Transformation.Conversion]: README.md
[Inheritance]: #Inheritance
[Namespace]: #Namespace
Expand Down