Exemple #1
0
        // No guarantee of getting stockRumbleStrength, depends of when it's called (meant to be called at startup)
        public static void InitializeRumbleStrengthStuff(VRInputModule vrinmod)
        {
            if (!NalunaRumbleModeDetected && !m_fVanillaStockRumbleStrength.HasValue)
            {
                HapticPresetSO hapticPreset = vrinmod.GetField <HapticPresetSO, VRInputModule>("_rumblePreset");
                m_fVanillaStockRumbleStrength = hapticPreset._strength;
            }

            m_fRumbleStrength = StockRumbleStrength;
        }
Exemple #2
0
        private static void SetHapticFeedbackController()
        {
            VRInputModule vrInputModule = Resources.FindObjectsOfTypeAll <VRInputModule>().FirstOrDefault();

            if (vrInputModule != null)
            {
                m_oHaptic = vrInputModule.GetField <HapticFeedbackController, VRInputModule>("_hapticFeedbackController");
            }
            else
            {
                Plugin.Log?.Error($"Couldn't find HapticFeedbackController");
            }
        }