Example #1
0
        private void OnRenderObject()
        {
            fixedSpear.transform.position = transform.position;
            if (VHVRConfig.SpearTwoHanded())
            {
                if (SteamVR_Actions.valheim_Grab.GetState(SteamVR_Input_Sources.LeftHand) && SteamVR_Actions.valheim_Grab.GetState(SteamVR_Input_Sources.RightHand))
                {
                    UpdateTwoHandedWield();
                    return;
                }
                else if (SteamVR_Actions.valheim_Grab.GetStateUp(SteamVR_Input_Sources.LeftHand) || SteamVR_Actions.valheim_Grab.GetStateUp(SteamVR_Input_Sources.RightHand))
                {
                    _isTwoHanded = isTwoHanded.SingleHanded;
                    ResetSpearOffset();
                }
            }
            switch (VHVRConfig.SpearThrowType())
            {
            case "DartType":
                UpdateDartSpearThrowCalculation();
                return;

            case "TwoStagedThrowing":
                UpdateTwoStagedThrowCalculation();
                return;

            case "SecondHandAiming":
                UpdateSecondHandAimCalculation();
                return;

            default:
                UpdateDartSpearThrowCalculation();
                return;
            }
        }