public static QuickHumanFingers[] GetHumanFingers() { if (_fingers == null) { _fingers = QuickUtils.GetEnumValues <QuickHumanFingers>().ToArray(); } return(_fingers); }
public static HumanBodyBones[] GetHumanBodyBones() { if (_humanBodyBones == null) { List <HumanBodyBones> tmp = QuickUtils.GetEnumValues <HumanBodyBones>(); tmp.RemoveAt(tmp.Count - 1); //Remove the LastBone, which is not a valid HumanBodyBone ID _humanBodyBones = tmp.ToArray(); } return(_humanBodyBones); }
public static Dictionary <HumanBodyBones, Vector3> GetLocalPositions(this Animator animator) { List <HumanBodyBones> bones = QuickUtils.GetEnumValues <HumanBodyBones>(); Dictionary <HumanBodyBones, Vector3> result = new Dictionary <HumanBodyBones, Vector3>(); foreach (HumanBodyBones boneID in bones) { Transform b = animator.GetBoneTransform(boneID); result[boneID] = b ? b.localPosition : Vector3.zero; } return(result); }
protected override void Awake() { foreach (U u in QuickUtils.GetEnumValues <U>()) { _stringToAxis[u.ToString()] = u; } foreach (V v in QuickUtils.GetEnumValues <V>()) { _stringToButton[v.ToString()] = v; } base.Awake(); }
private static void Init() { _allJoints = QuickUtils.ParseEnum <QuickHumanBodyBones, TrackedJointBody>(); foreach (QuickHumanFingers f in QuickHumanTrait.GetHumanFingers()) { _allJoints.AddRange(QuickHumanTrait.GetBonesFromFinger(f, true)); _allJoints.AddRange(QuickHumanTrait.GetBonesFromFinger(f, false)); } foreach (TrackedJointBody j in QuickUtils.GetEnumValues <TrackedJointBody>()) { _toTrackedJointBody[QuickUtils.ParseEnum <QuickHumanBodyBones>(j.ToString())] = j; } }
public override string[] GetButtonCodes() { string[] sufix = { "Left", "Right" }; List <string> codes = new List <string>(); foreach (string s in sufix) { foreach (ButtonCodes b in QuickUtils.GetEnumValues <ButtonCodes>()) { codes.Add(b.ToString() + s); } } return(GetCodes(codes)); }
protected virtual void Awake() { Reset(); CheckPrefabs(); CheckEventSystem(); _vrManager = QuickSingletonManager.GetInstance <QuickVRManager>(); _xrInteractionManager = QuickSingletonManager.GetInstance <XRInteractionManager>(); _interactorHandLeft = transform.CreateChild("__InteractorHandLeft__").GetOrCreateComponent <QuickVRInteractor>(); _interactorHandLeft._xrNode = XRNode.LeftHand; _interactorHandRight = transform.CreateChild("__InteractorHandRight__").GetOrCreateComponent <QuickVRInteractor>(); _interactorHandRight._xrNode = XRNode.RightHand; //By default, disable all the locomotion providers foreach (DefaultLocomotionProvider lProvider in QuickUtils.GetEnumValues <DefaultLocomotionProvider>()) { EnableLocomotionSystem(lProvider, false); } BaseTeleportationInteractable[] teleportationInteractables = FindObjectsOfType <BaseTeleportationInteractable>(); foreach (BaseTeleportationInteractable t in teleportationInteractables) { t.teleportationProvider = _teleportProvider; } _grabInteractables = new List <XRGrabInteractable>(FindObjectsOfType <XRGrabInteractable>()); foreach (XRGrabInteractable g in _grabInteractables) { if (!g.attachTransform) { //Try to find the default attach transform g.attachTransform = g.transform.Find(GRAB_PIVOT_NAME); } } }
protected static void Init() { _typeList = QuickUtils.ParseEnum <QuickHumanBodyBones, Type>(QuickUtils.GetEnumValues <Type>()); }