VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
AVR_BasicGrabProvider_Editor.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 using UnityEditor;
5 
6 using AVR.Phys;
7 
8 /// <summary>
9 /// Namespace of the arc-vr-phys (UnityEditor) package
10 /// </summary>
11 namespace AVR.UEditor.Phys
12 {
13  [CustomEditor(typeof(AVR_BasicGrabProvider), true)]
14  [CanEditMultipleObjects]
15  public class AVR_BasicGrabProvider_Editor : AVR.UEditor.Core.AVR_Component_Editor
16  {
17  public override void OnInspectorGUI()
18  {
19  base.OnInspectorGUI();
20 
21  if(Application.isPlaying) {
22  if(GUILayout.Button("Debug Grab Toggle")) {
24  if(gp.isGrabbing) gp.makeRelease();
25  else gp.makeGrab();
26  }
27  }
28  }
29  }
30 }
31 
Simplest GrabProvider. Grabbed objects will move their center (obj.transform.position) towards the re...
bool isGrabbing
Returns true if this provider is currently grabbing an object.