Skip to content

Commit 2bc0099

Browse files
committed
feat(state): add ifdefs to determine whether input system is enabled
The relevant input system code is now wrapped in ifdefs to only run if the Unity Input System is enabled and therefore will provide a warning if the code is run when it is not enabled.
1 parent 35e6615 commit 2bc0099

26 files changed

Lines changed: 96 additions & 744 deletions

Documentation/API/Tracking/Velocity/InputActionPropertyVelocityTracker.md

Lines changed: 0 additions & 184 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,11 @@ Retrieves the velocity and angular velocity from the specified InputActionProper
1010
* [Fields]
1111
* [currentAngularVelocity]
1212
* [currentVelocity]
13-
* [Properties]
14-
* [AngularVelocitySource]
15-
* [VelocitySource]
1613
* [Methods]
17-
* [AngularVelocityActionCanceled(InputAction.CallbackContext)]
18-
* [AngularVelocityActionPerformed(InputAction.CallbackContext)]
19-
* [BindAngularVelocityActions()]
20-
* [BindVelocityActions()]
21-
* [DisableAction(InputActionProperty)]
2214
* [DoGetAngularVelocity()]
2315
* [DoGetVelocity()]
24-
* [EnableAction(InputActionProperty)]
2516
* [OnDisable()]
2617
* [OnEnable()]
27-
* [UnbindAngularVelocityActions()]
28-
* [UnbindVelocityActions()]
29-
* [VelocityActionCanceled(InputAction.CallbackContext)]
30-
* [VelocityActionPerformed(InputAction.CallbackContext)]
3118

3219
## Details
3320

@@ -68,98 +55,8 @@ The current velocity.
6855
protected Vector3 currentVelocity
6956
```
7057

71-
### Properties
72-
73-
#### AngularVelocitySource
74-
75-
The InputActionProperty containing the angular velocity source.
76-
77-
##### Declaration
78-
79-
```
80-
public InputActionProperty AngularVelocitySource { get; set; }
81-
```
82-
83-
#### VelocitySource
84-
85-
The InputActionProperty containing the velocity source.
86-
87-
##### Declaration
88-
89-
```
90-
public InputActionProperty VelocitySource { get; set; }
91-
```
92-
9358
### Methods
9459

95-
#### AngularVelocityActionCanceled(InputAction.CallbackContext)
96-
97-
Processes the context when the angular velocity InputActionProperty is canceled.
98-
99-
##### Declaration
100-
101-
```
102-
protected virtual void AngularVelocityActionCanceled(InputAction.CallbackContext context)
103-
```
104-
105-
##### Parameters
106-
107-
| Type | Name | Description |
108-
| --- | --- | --- |
109-
| InputAction.CallbackContext | context | The action context data. |
110-
111-
#### AngularVelocityActionPerformed(InputAction.CallbackContext)
112-
113-
Processes the context when the angular velocity InputActionProperty is performed.
114-
115-
##### Declaration
116-
117-
```
118-
protected virtual void AngularVelocityActionPerformed(InputAction.CallbackContext context)
119-
```
120-
121-
##### Parameters
122-
123-
| Type | Name | Description |
124-
| --- | --- | --- |
125-
| InputAction.CallbackContext | context | The action context data. |
126-
127-
#### BindAngularVelocityActions()
128-
129-
Binds the angular velocity performed and canceled actions to the processing methods.
130-
131-
##### Declaration
132-
133-
```
134-
protected virtual void BindAngularVelocityActions()
135-
```
136-
137-
#### BindVelocityActions()
138-
139-
Binds the velocity performed and canceled actions to the processing methods.
140-
141-
##### Declaration
142-
143-
```
144-
protected virtual void BindVelocityActions()
145-
```
146-
147-
#### DisableAction(InputActionProperty)
148-
149-
Disables the given InputActionProperty.
150-
151-
##### Declaration
152-
153-
```
154-
protected virtual void DisableAction(InputActionProperty property)
155-
```
156-
157-
##### Parameters
158-
159-
| Type | Name | Description |
160-
| --- | --- | --- |
161-
| InputActionProperty | property | The property to disable. |
162-
16360
#### DoGetAngularVelocity()
16461

16562
##### Declaration
@@ -188,22 +85,6 @@ protected override Vector3 DoGetVelocity()
18885
| --- | --- |
18986
| Vector3 | n/a |
19087

191-
#### EnableAction(InputActionProperty)
192-
193-
Enables the given InputActionProperty.
194-
195-
##### Declaration
196-
197-
```
198-
protected virtual void EnableAction(InputActionProperty property)
199-
```
200-
201-
##### Parameters
202-
203-
| Type | Name | Description |
204-
| --- | --- | --- |
205-
| InputActionProperty | property | The property to enable. |
206-
20788
#### OnDisable()
20889

20990
##### Declaration
@@ -220,80 +101,15 @@ protected virtual void OnDisable()
220101
protected virtual void OnEnable()
221102
```
222103

223-
#### UnbindAngularVelocityActions()
224-
225-
Unbinds the velocity performed and canceled actions from the processing methods.
226-
227-
##### Declaration
228-
229-
```
230-
protected virtual void UnbindAngularVelocityActions()
231-
```
232-
233-
#### UnbindVelocityActions()
234-
235-
Unbinds the velocity performed and canceled actions from the processing methods.
236-
237-
##### Declaration
238-
239-
```
240-
protected virtual void UnbindVelocityActions()
241-
```
242-
243-
#### VelocityActionCanceled(InputAction.CallbackContext)
244-
245-
Processes the context when the velocity InputActionProperty is canceled.
246-
247-
##### Declaration
248-
249-
```
250-
protected virtual void VelocityActionCanceled(InputAction.CallbackContext context)
251-
```
252-
253-
##### Parameters
254-
255-
| Type | Name | Description |
256-
| --- | --- | --- |
257-
| InputAction.CallbackContext | context | The action context data. |
258-
259-
#### VelocityActionPerformed(InputAction.CallbackContext)
260-
261-
Processes the context when the velocity InputActionProperty is performed.
262-
263-
##### Declaration
264-
265-
```
266-
protected virtual void VelocityActionPerformed(InputAction.CallbackContext context)
267-
```
268-
269-
##### Parameters
270-
271-
| Type | Name | Description |
272-
| --- | --- | --- |
273-
| InputAction.CallbackContext | context | The action context data. |
274-
275104
[Tilia.Input.UnityInputSystem.Tracking.Velocity]: README.md
276105
[Inheritance]: #Inheritance
277106
[Namespace]: #Namespace
278107
[Syntax]: #Syntax
279108
[Fields]: #Fields
280109
[currentAngularVelocity]: #currentAngularVelocity
281110
[currentVelocity]: #currentVelocity
282-
[Properties]: #Properties
283-
[AngularVelocitySource]: #AngularVelocitySource
284-
[VelocitySource]: #VelocitySource
285111
[Methods]: #Methods
286-
[AngularVelocityActionCanceled(InputAction.CallbackContext)]: #AngularVelocityActionCanceledInputAction.CallbackContext
287-
[AngularVelocityActionPerformed(InputAction.CallbackContext)]: #AngularVelocityActionPerformedInputAction.CallbackContext
288-
[BindAngularVelocityActions()]: #BindAngularVelocityActions
289-
[BindVelocityActions()]: #BindVelocityActions
290-
[DisableAction(InputActionProperty)]: #DisableActionInputActionProperty
291112
[DoGetAngularVelocity()]: #DoGetAngularVelocity
292113
[DoGetVelocity()]: #DoGetVelocity
293-
[EnableAction(InputActionProperty)]: #EnableActionInputActionProperty
294114
[OnDisable()]: #OnDisable
295115
[OnEnable()]: #OnEnable
296-
[UnbindAngularVelocityActions()]: #UnbindAngularVelocityActions
297-
[UnbindVelocityActions()]: #UnbindVelocityActions
298-
[VelocityActionCanceled(InputAction.CallbackContext)]: #VelocityActionCanceledInputAction.CallbackContext
299-
[VelocityActionPerformed(InputAction.CallbackContext)]: #VelocityActionPerformedInputAction.CallbackContext

Documentation/API/Transformation/Conversion/CallbackContextToBoolean.md

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,25 @@
22

33
Transforms a InputAction.CallbackContext to a System.Boolean.
44

5-
## Contents
6-
7-
* [Inheritance]
8-
* [Namespace]
9-
* [Syntax]
10-
* [Methods]
11-
* [Process(InputAction.CallbackContext)]
12-
13-
## Details
14-
155
##### Inheritance
166

177
* System.Object
18-
* [InputSystemTransformer]<InputAction.CallbackContext, System.Boolean, [CallbackContextToBoolean.UnityEvent]\>
198
* [CallbackContextTransformer]<System.Boolean, [CallbackContextToBoolean.UnityEvent]\>
209
* CallbackContextToBoolean
2110

2211
##### Inherited Members
2312

24-
[CallbackContextTransformer<Boolean, CallbackContextToBoolean.UnityEvent>.ProcessResult(InputAction.CallbackContext)]
25-
26-
[InputSystemTransformer<InputAction.CallbackContext, Boolean, CallbackContextToBoolean.UnityEvent>.ContextToProcess]
13+
[CallbackContextTransformer<Boolean, CallbackContextToBoolean.UnityEvent>.OnEnable()]
2714

28-
##### Namespace
29-
30-
* [Tilia.Input.UnityInputSystem.Transformation.Conversion]
15+
###### **Namespace**: [Tilia.Input.UnityInputSystem.Transformation.Conversion]
3116

3217
##### Syntax
3318

3419
```
3520
public class CallbackContextToBoolean : CallbackContextTransformer<bool, CallbackContextToBoolean.UnityEvent>
3621
```
3722

38-
### Methods
39-
40-
#### Process(InputAction.CallbackContext)
41-
42-
Transforms the given input InputAction.CallbackContext to the equivalent System.Boolean value.
43-
44-
##### Declaration
45-
46-
```
47-
protected override bool Process(InputAction.CallbackContext input)
48-
```
49-
50-
##### Parameters
51-
52-
| Type | Name | Description |
53-
| --- | --- | --- |
54-
| InputAction.CallbackContext | input | The value to transform. |
55-
56-
##### Returns
57-
58-
| Type | Description |
59-
| --- | --- |
60-
| System.Boolean | The transformed value. |
61-
62-
[InputSystemTransformer]: InputSystemTransformer-3.md
6323
[CallbackContextTransformer]: CallbackContextTransformer-2.md
6424
[CallbackContextToBoolean.UnityEvent]: CallbackContextToBoolean.UnityEvent.md
65-
[CallbackContextTransformer<Boolean, CallbackContextToBoolean.UnityEvent>.ProcessResult(InputAction.CallbackContext)]: CallbackContextTransformer-2.md#Tilia_Input_UnityInputSystem_Transformation_Conversion_CallbackContextTransformer_2_ProcessResult_InputAction_CallbackContext_
66-
[InputSystemTransformer<InputAction.CallbackContext, Boolean, CallbackContextToBoolean.UnityEvent>.ContextToProcess]: InputSystemTransformer-3.md#Tilia_Input_UnityInputSystem_Transformation_Conversion_InputSystemTransformer_3_ContextToProcess
25+
[CallbackContextTransformer<Boolean, CallbackContextToBoolean.UnityEvent>.OnEnable()]: CallbackContextTransformer-2.md#Tilia_Input_UnityInputSystem_Transformation_Conversion_CallbackContextTransformer_2_OnEnable
6726
[Tilia.Input.UnityInputSystem.Transformation.Conversion]: README.md
68-
[Inheritance]: #Inheritance
69-
[Namespace]: #Namespace
70-
[Syntax]: #Syntax
71-
[Methods]: #Methods
72-
[Process(InputAction.CallbackContext)]: #ProcessInputAction.CallbackContext

Documentation/API/Transformation/Conversion/CallbackContextToFloat.md

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,25 @@
22

33
Transforms a InputAction.CallbackContext to a System.Single.
44

5-
## Contents
6-
7-
* [Inheritance]
8-
* [Namespace]
9-
* [Syntax]
10-
* [Methods]
11-
* [Process(InputAction.CallbackContext)]
12-
13-
## Details
14-
155
##### Inheritance
166

177
* System.Object
18-
* [InputSystemTransformer]<InputAction.CallbackContext, System.Single, [CallbackContextToFloat.UnityEvent]\>
198
* [CallbackContextTransformer]<System.Single, [CallbackContextToFloat.UnityEvent]\>
209
* CallbackContextToFloat
2110

2211
##### Inherited Members
2312

24-
[CallbackContextTransformer<Single, CallbackContextToFloat.UnityEvent>.ProcessResult(InputAction.CallbackContext)]
25-
26-
[InputSystemTransformer<InputAction.CallbackContext, Single, CallbackContextToFloat.UnityEvent>.ContextToProcess]
13+
[CallbackContextTransformer<Single, CallbackContextToFloat.UnityEvent>.OnEnable()]
2714

28-
##### Namespace
29-
30-
* [Tilia.Input.UnityInputSystem.Transformation.Conversion]
15+
###### **Namespace**: [Tilia.Input.UnityInputSystem.Transformation.Conversion]
3116

3217
##### Syntax
3318

3419
```
3520
public class CallbackContextToFloat : CallbackContextTransformer<float, CallbackContextToFloat.UnityEvent>
3621
```
3722

38-
### Methods
39-
40-
#### Process(InputAction.CallbackContext)
41-
42-
Transforms the given input InputAction.CallbackContext to the equivalent System.Single value.
43-
44-
##### Declaration
45-
46-
```
47-
protected override float Process(InputAction.CallbackContext input)
48-
```
49-
50-
##### Parameters
51-
52-
| Type | Name | Description |
53-
| --- | --- | --- |
54-
| InputAction.CallbackContext | input | The value to transform. |
55-
56-
##### Returns
57-
58-
| Type | Description |
59-
| --- | --- |
60-
| System.Single | The transformed value. |
61-
62-
[InputSystemTransformer]: InputSystemTransformer-3.md
6323
[CallbackContextTransformer]: CallbackContextTransformer-2.md
6424
[CallbackContextToFloat.UnityEvent]: CallbackContextToFloat.UnityEvent.md
65-
[CallbackContextTransformer<Single, CallbackContextToFloat.UnityEvent>.ProcessResult(InputAction.CallbackContext)]: CallbackContextTransformer-2.md#Tilia_Input_UnityInputSystem_Transformation_Conversion_CallbackContextTransformer_2_ProcessResult_InputAction_CallbackContext_
66-
[InputSystemTransformer<InputAction.CallbackContext, Single, CallbackContextToFloat.UnityEvent>.ContextToProcess]: InputSystemTransformer-3.md#Tilia_Input_UnityInputSystem_Transformation_Conversion_InputSystemTransformer_3_ContextToProcess
25+
[CallbackContextTransformer<Single, CallbackContextToFloat.UnityEvent>.OnEnable()]: CallbackContextTransformer-2.md#Tilia_Input_UnityInputSystem_Transformation_Conversion_CallbackContextTransformer_2_OnEnable
6726
[Tilia.Input.UnityInputSystem.Transformation.Conversion]: README.md
68-
[Inheritance]: #Inheritance
69-
[Namespace]: #Namespace
70-
[Syntax]: #Syntax
71-
[Methods]: #Methods
72-
[Process(InputAction.CallbackContext)]: #ProcessInputAction.CallbackContext

0 commit comments

Comments
 (0)