IF_VR_Steam_Hand convertSteamVRHand(IF_VR_Hand hand) { IF_VR_Steam_Hand steamVRHand; if (hand.Type == IF_VR_HandType.Left) { steamVRHand = IF_VR_Steam_Player.instance.leftHand; } else { steamVRHand = IF_VR_Steam_Player.instance.rightHand; } return(steamVRHand); }
void buildHand(GameObject go) { var entity = go.GetEntity(true); var hand = go.GetComponent <IF_VR_Steam_Hand>(); var handComponent = new IF_VR_Hand(); if (hand.handType == Valve.VR.SteamVR_Input_Sources.LeftHand) { handComponent.Type = Defines.IF_VR_HandType.Left; } else if (hand.handType == Valve.VR.SteamVR_Input_Sources.RightHand) { handComponent.Type = Defines.IF_VR_HandType.Right; } else { handComponent.Type = Defines.IF_VR_HandType.Any; } entity.AddComponent(handComponent); if (hand.trackedObject == null) { // used fallback return; } var pool = EcsRxApplicationBehaviour.Instance.EntityDatabase.GetCollection(); pool.CreateEntity(new IF_FollowEntityBlueprint(IF.Defines.IF_UpdateMomentType.Update, hand.trackedObject.gameObject.GetEntity(), entity, true, true, Vector3.zero, Vector3.zero)); }