VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
com.avr.phys/Editor/AVR_Controller_ModuleWizard_Hooks.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 
5 using AVR.UEditor.Core;
6 
7 namespace AVR.UEditor.Phys
8 {
9  public class AVR_ControllerWizard_Hook_GrabProvider : AVR_WizardHook_DropdownChoiceToggle<AVR_Controller_ModuleWizard, AVR.Phys.AVR_BasicGrabProvider>
10  {
11  protected override string moduleName => "GrabProvider";
12 
13  protected override DDChoice[] options => new[] {
14  new DDChoice("Basic", "/editor/defaultPrefabPaths/basicGrabProvider", (p) => p.GetType() == typeof(AVR.Phys.AVR_BasicGrabProvider)),
15  new DDChoice("Offset", "/editor/defaultPrefabPaths/offsetGrabProvider", (p) => p.GetType() == typeof(AVR.Phys.AVR_OffsetGrabProvider)),
16  new DDChoice("Advanced-Offset", "/editor/defaultPrefabPaths/advancedOffsetGrabProvider", (p) => p.GetType() == typeof(AVR.Phys.AVR_AdvancedOffsetGrabProvider))
17  };
18 
19  protected override string[] dependencies => new string[] { "InputManager" };
20  }
21 
22  public class AVR_ControllerWizard_Hook_HandInteractor : AVR_WizardHook_SimpleToggle<AVR_Controller_ModuleWizard, AVR.Phys.AVR_Hand>
23  {
24  private bool is_right_hand = false;
25 
26  protected override string moduleName => "HandInteractor";
27 
28  protected override string prefabPathSettingsToken => is_right_hand ? "/editor/defaultPrefabPaths/rightHandInteractor" : "/editor/defaultPrefabPaths/leftHandInteractor";
29 
30  public override void on_submit(GameObject targetObject)
31  {
32  try {
33  is_right_hand = targetObject.GetComponent<AVR.Core.AVR_Controller>().controllerNode == UnityEngine.XR.XRNode.RightHand;
34  } catch (System.Exception) { }
35  base.on_submit(targetObject);
36  }
37 
38  protected override string[] dependencies => new string[] { "InputManager" };
39  }
40 }
Represents a VR controller. Provides functionality for spacial tracking and haptic feedback...