Tanoda
TrackerOffsetHelperEditor.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using NaughtyAttributes;
4using UnityEngine;
5#if !UNITY_WEBGL
6using ViveHandTracking;
7
8[RequireComponent(typeof(ModelRenderer))]
9public class TrackerOffsetHelperEditor : MonoBehaviour
10{
11 [Button]
12 void SetOffset()
13 {
14 var mr = GetComponent<ModelRenderer>();
15 var tracker = mr.tracker;
16 mr.offset = mr.transform.InverseTransformPoint(tracker.position);
17 }
18}
19
20#endif
UnityEngine.UI.Button Button
Definition: Pointer.cs:7