File tree 2 files changed +3
-7
lines changed
Assets/HTC.UnityPlugin/ViveInputUtility/Examples/5.ColliderEvent/Scripts
2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ public class ResetButton : MonoBehaviour
17
17
18
18
private RigidPose [ ] resetPoses ;
19
19
20
- private Vector3 buttonOriginPosition ;
21
-
22
20
private HashSet < ColliderButtonEventData > pressingEvents = new HashSet < ColliderButtonEventData > ( ) ;
23
21
24
22
public ColliderButtonEventData . InputButton activeButton
@@ -45,8 +43,6 @@ private void Start()
45
43
{
46
44
resetPoses [ i ] = new RigidPose ( effectTargets [ i ] ) ;
47
45
}
48
-
49
- buttonOriginPosition = buttonObject . position ;
50
46
}
51
47
#if UNITY_EDITOR
52
48
protected virtual void OnValidate ( )
@@ -81,15 +77,15 @@ public void OnColliderEventPressEnter(ColliderButtonEventData eventData)
81
77
{
82
78
if ( eventData . button == m_activeButton && pressingEvents . Add ( eventData ) && pressingEvents . Count == 1 )
83
79
{
84
- buttonObject . position = buttonOriginPosition + buttonDownDisplacement ;
80
+ buttonObject . localPosition += buttonDownDisplacement ;
85
81
}
86
82
}
87
83
88
84
public void OnColliderEventPressExit ( ColliderButtonEventData eventData )
89
85
{
90
86
if ( pressingEvents . Remove ( eventData ) && pressingEvents . Count == 0 )
91
87
{
92
- buttonObject . position = buttonOriginPosition ;
88
+ buttonObject . localPosition -= buttonDownDisplacement ;
93
89
}
94
90
}
95
91
}
Original file line number Diff line number Diff line change @@ -44,6 +44,6 @@ Repository: [GitHub](https://github.com/ViveSoftware/ViveInputUtility-Unity)
44
44
3 . [ Fork this project] ( https://github.com/ViveSoftware/ViveInputUtility-Unity/fork ) on GitHub.
45
45
4 . Create a new branch (based on master branch) for your work on your fork.
46
46
5 . After you finish your work
47
- - Make sure all files start with ` //========= Copyright 2016-2018 , HTC Corporation. All rights reserved. =========== `
47
+ - Make sure all files start with ` //========= Copyright 2016-2019 , HTC Corporation. All rights reserved. =========== `
48
48
- Try leaving [ good commit message] ( https://chris.beams.io/posts/git-commit/ ) and [ keeping commit histories clean] ( https://www.notion.so/Keeping-Commit-Histories-Clean-0f717c4e802c4a0ebd852cf9337ce5d2 ) .
49
49
6 . Submit a pull request from your new branch to our develop branch.
You can’t perform that action at this time.
0 commit comments