Skip to content

Commit a3370bf

Browse files
committed
Remove warning
1 parent 2204d2a commit a3370bf

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Packages/webxr-interactions/Runtime/Scripts/MouseDragObject.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,38 @@ namespace WebXR.Interactions
55
[RequireComponent(typeof(Rigidbody))]
66
public class MouseDragObject : MonoBehaviour
77
{
8-
private Camera currentCamera;
9-
private new Rigidbody rigidbody;
10-
private Vector3 screenPoint;
11-
private Vector3 offset;
8+
private Camera m_currentCamera;
9+
private Rigidbody m_rigidbody;
10+
private Vector3 m_screenPoint;
11+
private Vector3 m_offset;
1212

1313
void Awake()
1414
{
15-
rigidbody = GetComponent<Rigidbody>();
15+
m_rigidbody = GetComponent<Rigidbody>();
1616
}
1717

1818
void OnMouseDown()
1919
{
20-
currentCamera = FindCamera();
21-
if (currentCamera != null)
20+
m_currentCamera = FindCamera();
21+
if (m_currentCamera != null)
2222
{
23-
screenPoint = currentCamera.WorldToScreenPoint(gameObject.transform.position);
24-
offset = gameObject.transform.position - currentCamera.ScreenToWorldPoint(GetMousePosWithScreenZ(screenPoint.z));
23+
m_screenPoint = m_currentCamera.WorldToScreenPoint(gameObject.transform.position);
24+
m_offset = gameObject.transform.position - m_currentCamera.ScreenToWorldPoint(GetMousePosWithScreenZ(m_screenPoint.z));
2525
}
2626
}
2727

2828
void OnMouseUp()
2929
{
30-
currentCamera = null;
30+
m_currentCamera = null;
3131
}
3232

3333
void FixedUpdate()
3434
{
35-
if (currentCamera != null)
35+
if (m_currentCamera != null)
3636
{
37-
Vector3 currentScreenPoint = GetMousePosWithScreenZ(screenPoint.z);
38-
rigidbody.velocity = Vector3.zero;
39-
rigidbody.MovePosition(currentCamera.ScreenToWorldPoint(currentScreenPoint) + offset);
37+
Vector3 currentScreenPoint = GetMousePosWithScreenZ(m_screenPoint.z);
38+
m_rigidbody.velocity = Vector3.zero;
39+
m_rigidbody.MovePosition(m_currentCamera.ScreenToWorldPoint(currentScreenPoint) + m_offset);
4040
}
4141
}
4242

0 commit comments

Comments
 (0)