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

address BoundingBoxRigHandle nullreferenceexception #2086

Closed
wants to merge 9 commits into from
80 changes: 10 additions & 70 deletions Assets/HoloToolkit-Examples/UX/Prefabs/ButtonHolographic.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,13 @@ GameObject:
serializedVersion: 5
m_Component:
- component: {fileID: 4400682673061142}
- component: {fileID: 65959870370459156}
- component: {fileID: 114985427041226018}
- component: {fileID: 114941441034285770}
- component: {fileID: 114539127433989172}
- component: {fileID: 114724965930856538}
- component: {fileID: 114888990318196948}
- component: {fileID: 65959870370459156}
- component: {fileID: 95836897654538082}
- component: {fileID: 114372868302156270}
- component: {fileID: 114473421636268844}
m_Layer: 5
m_Name: ButtonHolographic
m_TagString: Untagged
Expand Down Expand Up @@ -340,23 +339,6 @@ BoxCollider:
serializedVersion: 2
m_Size: {x: 0.12, y: 0.12, z: 0.02}
m_Center: {x: 0, y: 0, z: 0}
--- !u!95 &95836897654538082
Animator:
serializedVersion: 3
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1619954670119144}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: dade752fc71c3d940ba5cc7eaf201f24, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
--- !u!102 &102082490485545312
TextMesh:
serializedVersion: 3
Expand All @@ -371,68 +353,26 @@ TextMesh:
m_Anchor: 7
m_Alignment: 1
m_TabSize: 4
m_FontSize: 72
m_FontSize: 48
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 12800000, guid: 86574c70442309b45be5a1c37a37a40b, type: 3}
m_Color:
serializedVersion: 2
rgba: 4294967295
--- !u!114 &114372868302156270
--- !u!114 &114473421636268844
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1619954670119144}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 728fec8e9feecf64f933543126cbecae, type: 3}
m_Script: {fileID: 11500000, guid: d56c23c4a6e0ec6478791a5c1a0f81a1, type: 3}
m_Name:
m_EditorClassIdentifier:
TargetAnimator: {fileID: 95836897654538082}
AnimActions:
- ButtonState: 0
ParamName: State
ParamType: 3
BoolValue: 0
IntValue: 0
FloatValue: 0
InvalidParam: 0
- ButtonState: 1
ParamName: State
ParamType: 3
BoolValue: 0
IntValue: 1
FloatValue: 0
InvalidParam: 0
- ButtonState: 2
ParamName: State
ParamType: 3
BoolValue: 0
IntValue: 2
FloatValue: 0
InvalidParam: 0
- ButtonState: 3
ParamName: State
ParamType: 3
BoolValue: 0
IntValue: 3
FloatValue: 0
InvalidParam: 0
- ButtonState: 4
ParamName: State
ParamType: 3
BoolValue: 0
IntValue: 4
FloatValue: 0
InvalidParam: 0
- ButtonState: 5
ParamName: State
ParamType: 3
BoolValue: 0
IntValue: 5
FloatValue: 0
InvalidParam: 0
KeywordSource: 2
Keyword:
--- !u!114 &114539127433989172
MonoBehaviour:
m_ObjectHideFlags: 1
Expand Down Expand Up @@ -511,8 +451,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e77a98cf320fe9340a55eecfe4567ca4, type: 3}
m_Name:
m_EditorClassIdentifier:
ButtonState: 4
ButtonPressFilter: 1
RequireGaze: 1
buttonState: 4
buttonPressFilter: 1
requireGaze: 1
MainCollider: {fileID: 65959870370459156}
MainRenderer: {fileID: 23714127561629088}
80 changes: 10 additions & 70 deletions Assets/HoloToolkit/UX/Prefabs/Buttons/HolographicButton.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ GameObject:
serializedVersion: 5
m_Component:
- component: {fileID: 4249060311757736}
- component: {fileID: 65091470401894616}
- component: {fileID: 114549673379926378}
- component: {fileID: 114759408391228376}
- component: {fileID: 114731001419964972}
- component: {fileID: 114540301864412650}
- component: {fileID: 114284851947377390}
- component: {fileID: 65091470401894616}
- component: {fileID: 95444211700001698}
- component: {fileID: 114586770699789526}
- component: {fileID: 114700464119774652}
m_Layer: 5
m_Name: HolographicButton
m_TagString: Untagged
Expand Down Expand Up @@ -340,23 +339,6 @@ BoxCollider:
serializedVersion: 2
m_Size: {x: 0.12, y: 0.12, z: 0.02}
m_Center: {x: 0, y: 0, z: 0}
--- !u!95 &95444211700001698
Animator:
serializedVersion: 3
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1210820392543280}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: dade752fc71c3d940ba5cc7eaf201f24, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
--- !u!102 &102845526646414632
TextMesh:
serializedVersion: 3
Expand All @@ -371,7 +353,7 @@ TextMesh:
m_Anchor: 7
m_Alignment: 1
m_TabSize: 4
m_FontSize: 72
m_FontSize: 48
m_FontStyle: 0
m_RichText: 1
m_Font: {fileID: 12800000, guid: 86574c70442309b45be5a1c37a37a40b, type: 3}
Expand Down Expand Up @@ -429,66 +411,24 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e77a98cf320fe9340a55eecfe4567ca4, type: 3}
m_Name:
m_EditorClassIdentifier:
ButtonState: 4
ButtonPressFilter: 1
RequireGaze: 1
buttonState: 4
buttonPressFilter: 1
requireGaze: 1
MainCollider: {fileID: 65091470401894616}
MainRenderer: {fileID: 23637783586042108}
--- !u!114 &114586770699789526
--- !u!114 &114700464119774652
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1210820392543280}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 728fec8e9feecf64f933543126cbecae, type: 3}
m_Script: {fileID: 11500000, guid: d56c23c4a6e0ec6478791a5c1a0f81a1, type: 3}
m_Name:
m_EditorClassIdentifier:
TargetAnimator: {fileID: 95444211700001698}
AnimActions:
- ButtonState: 0
ParamName: State
ParamType: 3
BoolValue: 0
IntValue: 0
FloatValue: 0
InvalidParam: 0
- ButtonState: 1
ParamName: State
ParamType: 3
BoolValue: 0
IntValue: 1
FloatValue: 0
InvalidParam: 0
- ButtonState: 2
ParamName: State
ParamType: 3
BoolValue: 0
IntValue: 2
FloatValue: 0
InvalidParam: 0
- ButtonState: 3
ParamName: State
ParamType: 3
BoolValue: 0
IntValue: 3
FloatValue: 0
InvalidParam: 0
- ButtonState: 4
ParamName: State
ParamType: 3
BoolValue: 0
IntValue: 4
FloatValue: 0
InvalidParam: 0
- ButtonState: 5
ParamName: State
ParamType: 3
BoolValue: 0
IntValue: 5
FloatValue: 0
InvalidParam: 0
KeywordSource: 2
Keyword:
--- !u!114 &114731001419964972
MonoBehaviour:
m_ObjectHideFlags: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,17 @@ public void OnInputUp(InputEventData eventData)
public void OnSourceDetected(SourceStateEventData eventData)
{
}

public void OnSourceLost(SourceStateEventData eventData)
{
if (eventData.SourceId == inputDownEventData.SourceId)
if ((inputDownEventData != null) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event data should never be null. If it is then, something is being used improperly in another location.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this class is setting inputDownEventData during an up event. is this the wrong behavior? it has been this way since the start, I believe

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it is wrong, but we can address a fix in vNEXT

Copy link
Contributor

@StephenHodgson StephenHodgson May 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be related to those null references in the InputManger you were getting.

event datums should never be null

(eventData.SourceId == inputDownEventData.SourceId))
{
inputDownEventData = null;
ResetRigHandles();

eventData.Use();
}
eventData.Use();
}
}
}
5 changes: 1 addition & 4 deletions Assets/HoloToolkit/UX/Scripts/KeyboardInputField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ public override void OnPointerClick(PointerEventData eventData)
/// <param name="newText"></param>
private void Keyboard_OnTextUpdated(string newText)
{
if (!string.IsNullOrEmpty(newText))
{
text = newText;
}
text = newText;
}

/// <summary>
Expand Down