Esempio n. 1
0
        private bool AreControllersWithinDoubleHandStartDistance()
        {
            if (ItemEquippableEvents.IsCurrentItemShootableWeapon())
            {
                ItemEquippable currentHeldItem = ItemEquippableEvents.currentItem;
                if (currentHeldItem.LeftHandGripTrans)
                {
                    Vector3 correctedGripPosition = ItemEquippableEvents.GetCorrectedGripPosition();

                    if (GTFO_VR_Plugin.DEBUG_ENABLED)
                    {
                        if (VRConfig.configDebugShowTwoHHitboxes.Value)
                        {
                            DebugDraw3D.DrawSphere(correctedGripPosition, m_doubleHandStartDistance, ColorExt.Blue(0.2f));
                        }
                    }

                    return(Vector3.Distance(offhandController.transform.position, ItemEquippableEvents.GetCorrectedGripPosition()) < m_doubleHandStartDistance);
                }
            }

            return(Vector3.Distance(mainController.transform.position, offhandController.transform.position) < m_doubleHandStartDistance);
        }
Esempio n. 2
0
 private bool AreControllersOutsideOfDoubleHandExitDistance()
 {
     if (ItemEquippableEvents.IsCurrentItemShootableWeapon())
     {
         ItemEquippable currentHeldItem = ItemEquippableEvents.currentItem;
         if (currentHeldItem.IsReloading)
         {
             return(false);
         }
         if (currentHeldItem.LeftHandGripTrans)
         {
             Vector3 correctedGripPosition = ItemEquippableEvents.GetCorrectedGripPosition();
             if (GTFO_VR_Plugin.DEBUG_ENABLED)
             {
                 if (VRConfig.configDebugShowTwoHHitboxes.Value)
                 {
                     DebugDraw3D.DrawSphere(correctedGripPosition, m_doubleHandLeaveDistance, ColorExt.Red(0.1f));
                 }
             }
             return(Vector3.Distance(offhandController.transform.position, ItemEquippableEvents.GetCorrectedGripPosition()) > m_doubleHandLeaveDistance);
         }
     }
     return(Vector3.Distance(mainController.transform.position, offhandController.transform.position) > m_doubleHandLeaveDistance);
 }