22using System . Collections . Generic ;
33using UnityEngine ;
44
5- public class HandPositionHandler : MonoBehaviour {
5+ namespace Example
6+ {
7+ public class HandPositionHandler : MonoBehaviour
8+ {
69
7- public GameObject leftCursor , rightCursor ;
10+ public GameObject leftCursor , rightCursor ;
811
9- void Start ( )
10- {
11- GameObject . Find ( "DepthCameraManager" ) . GetComponent < HandPositionManager > ( ) . AddSubscriber ( gameObject ) ;
12- }
12+ void Start ( )
13+ {
14+ GameObject . Find ( "DepthCameraManager" ) . GetComponent < HandPositionManager > ( ) . AddSubscriber ( gameObject ) ;
15+ }
1316
14- void OnLeftHandChange ( Vector3 handPosition )
15- {
16- leftCursor . transform . position = Camera . main . transform . position + new Vector3 ( handPosition . x * 100 , handPosition . y * 100 , handPosition . z * 100 ) + Camera . main . transform . forward ;
17- }
17+ void OnLeftHandChange ( Vector3 handPosition )
18+ {
19+ leftCursor . transform . position = Camera . main . transform . position + new Vector3 ( handPosition . x * 100 , handPosition . y * 100 , handPosition . z * 100 ) + Camera . main . transform . forward ;
20+ }
1821
19- void OnRightHandChange ( Vector3 handPosition )
20- {
21- rightCursor . transform . position = Camera . main . transform . position + new Vector3 ( handPosition . x * 100 , handPosition . y * 100 , handPosition . z * 100 ) + Camera . main . transform . forward ;
22- }
22+ void OnRightHandChange ( Vector3 handPosition )
23+ {
24+ rightCursor . transform . position = Camera . main . transform . position + new Vector3 ( handPosition . x * 100 , handPosition . y * 100 , handPosition . z * 100 ) + Camera . main . transform . forward ;
25+ }
2326
24- void OnLeftHandAppear ( )
25- {
26- leftCursor . SetActive ( true ) ;
27- }
27+ void OnLeftHandAppear ( )
28+ {
29+ leftCursor . SetActive ( true ) ;
30+ }
2831
29- void OnLeftHandDisappear ( )
30- {
31- leftCursor . SetActive ( false ) ;
32- }
32+ void OnLeftHandDisappear ( )
33+ {
34+ leftCursor . SetActive ( false ) ;
35+ }
3336
34- void OnRightHandAppear ( )
35- {
36- rightCursor . SetActive ( true ) ;
37- }
37+ void OnRightHandAppear ( )
38+ {
39+ rightCursor . SetActive ( true ) ;
40+ }
41+
42+ void OnRightHandDisappear ( )
43+ {
44+ rightCursor . SetActive ( false ) ;
45+ }
3846
39- void OnRightHandDisappear ( )
40- {
41- rightCursor . SetActive ( false ) ;
4247 }
4348
44- }
49+ }
0 commit comments