Пример #1
0
 public static ForceTractorBeam AttachToHandRayPointer(ShellHandRayPointer pointer, GameObject tractorBeamPrefab)
 {
     if (!_staticPointersToTractorBeams.TryGetValue(pointer, out var tractorBeam))
     {
         tractorBeam = Instantiate(tractorBeamPrefab, pointer.transform).GetComponent <ForceTractorBeam>();
         tractorBeam._handRayPointer = pointer;
         _staticPointersToTractorBeams.Add(pointer, tractorBeam);
     }
     return(tractorBeam);
 }
Пример #2
0
 public static ForceTractorBeam GetTractorBeamFromPointer(ShellHandRayPointer pointer)
 {
     return(_staticPointersToTractorBeams.TryGetValue(pointer, out var tb) ? tb : null);
 }
 private ForceTractorBeam AttachTractorBeamToPointer(ShellHandRayPointer pointer)
 {
     return(ForceTractorBeam.AttachToHandRayPointer(pointer, TractionBeamPrefab));
 }
    private static bool TryToVerifyPointerAndController(IMixedRealityPointer pointer, out ShellHandRayPointer handRayPointer)
    {
        // verify that the pointer is a far pointer that inherits from the BaseControllerPointer so it is a MonoBehavior
        handRayPointer = pointer as ShellHandRayPointer;
        if (handRayPointer == null)
        {
            return(false);
        }
        var controller = pointer.Controller;

        return(controller != null &&
               !(controller is WindowsMixedRealityGGVHand) &&
               (controller is IMixedRealityHand ||
                controller is WindowsMixedRealityController)
               );
    }