コード例 #1
0
    private bool ValidateNearObjects()
    {
        List <GameObject> nearObjects = RightInteractNearTouch.GetNearTouchedObjects();

        foreach (GameObject nearObject in nearObjects)
        {
            if (nearObject == null)
            {
                RightInteractNearTouch.ForceStopNearTouching(null);
                return(false);
            }
            else
            {
                // We couldn't possiblu be near anything else. So that means if gadget isn't active in heirarchy then our shelf is inactive.
                if (!nearObject.activeInHierarchy)
                {
                    RightInteractNearTouch.ForceStopNearTouching(null);
                    return(false);
                }
            }
        }

        return(true);
    }
コード例 #2
0
 protected virtual void DoControllerNearUntouch(object sender, ObjectInteractEventArgs e)
 {
     if (interactNearTouch.GetNearTouchedObjects().Count == 0 && (interactTouch == null || interactTouch.GetTouchedObject() == null))
     {
         for (int i = 0; i < fingerUntouchedAxis.Length; i++)
         {
             if (!IsButtonPressed(i))
             {
                 SetOverrideValue(i, ref overrideAxisValues, OverrideState.WasOverring);
                 fingerForceAxis[i] = fingerUntouchedAxis[i];
             }
         }
         SetAnimatorStateOff("NearTouchState");
         HandleOverrideOff(nearTouchOverrides.ignoreAllOverrides, GetOverridePermissions(nearTouchOverrides), false);
     }
 }