Пример #1
0
 public override void OnManipulationStarted(VRInteraction caller)
 {
     base.OnManipulationStarted(caller);
     rby.useGravity    = false;
     rby.isKinematic   = true;
     currSelectingCtrl = null;
 }
Пример #2
0
 public override void OnTriggerPress(VRInteraction caller, VRWand_Controller wand)
 {
     if (!isBeingHeld && caller.CanManipulate(this))
     {
         GetPicked(caller);
     }
 }
Пример #3
0
 public override void OnGripPress(VRInteraction caller, VRWand_Controller wand)
 {
     if (holder == caller)
     {
         GetDropped(wand.throwVelocity);
     }
 }
Пример #4
0
 public override void OnTriggerRelease(VRInteraction caller, VRWand_Controller wand)
 {
     if (!releaseWithGripOnly && holder == caller)
     {
         GetDropped(wand.throwVelocity);
     }
 }
Пример #5
0
 public override bool IsCompatibleWithAction(VRInteraction.InteractionEvent action)
 {
     if (VRInteraction.ActionToType(action) == VRInteraction.InteractionType.Trigger)
     {
         return(true);
     }
     return(false);
 }
 public void RequestAssignClientAuthority(GameObject iObject, VRInteraction interaction)
 {
     if (iObject != null && isLocalPlayer)
     {
         m_AssignClientAuthorityRequests.Add(iObject, interaction);
         CmdAssignClientAuthority(iObject);
     }
 }
Пример #7
0
    protected override void GetPicked(VRInteraction interaction)
    {
        interaction.SetManipulatedInteractable(this);

        SetPositionAndRotation();

        rby.useGravity  = false;
        rby.isKinematic = true;
    }
Пример #8
0
    public override void OnDeselected(VRInteraction caller)
    {
        base.OnDeselected(caller);
        HandController hand = caller as HandController;

        if (hand != null)
        {
            hand.RecoverBaseAnimator();
        }
    }
Пример #9
0
    public override void OnSelected(VRInteraction caller)
    {
        base.OnSelected(caller);
        HandController hand = caller as HandController;

        if (hand != null)
        {
            SetAnimOverride(hand.animHand);
        }
    }
Пример #10
0
    public override void OnSelected(VRInteraction caller)
    {
        base.OnSelected(caller);
        HandController_Ray rayCtrl = caller as HandController_Ray;

        if (rayCtrl != null)
        {
            referencePos = tRoot.position;
            rayCtrl.SetRenderLine(false);
            currSelectingCtrl = rayCtrl;
        }
    }
Пример #11
0
    public override void OnManipulationStarted(VRInteraction caller)
    {
        base.OnManipulationStarted(caller);
        HandController hand = caller as HandController;

        if (hand != null)
        {
            holder       = hand;
            tRoot.parent = holder.modelGrabPoint;
            hand.SetGrabAnimParams(this);
        }
    }
Пример #12
0
    public override void OnDeselected(VRInteraction caller)
    {
        base.OnDeselected(caller);
        HandController_Ray rayCtrl = caller as HandController_Ray;

        if (rayCtrl != null)
        {
            rayCtrl.SetRenderLine(true);
            currSelectingCtrl = null;

            rby.useGravity  = true;
            rby.isKinematic = false;
        }
    }
Пример #13
0
    public override void OnManipulationEnded(VRInteraction caller)
    {
        base.OnManipulationEnded(caller);
        HandController hand = caller as HandController;

        if (hand != null)
        {
            hand.animHand.SetBool("Grab", false);
        }

        holder = null;

        tRoot.parent = null;
    }
Пример #14
0
    public override void OnManipulationEnded(VRInteraction caller)
    {
        base.OnManipulationEnded(caller);
        HandController hand = caller as HandController;

        if (hand != null)
        {
            hand.SetReleaseAnimParams(this);
        }

        holder = null;

        tRoot.parent = null;
    }
Пример #15
0
    public override void OnManipulationStarted(VRInteraction caller)
    {
        base.OnManipulationStarted(caller);
        HandController hand = caller as HandController;

        if (hand != null)
        {
            hand.animHand.SetBool("Grab", true);
            hand.animHand.SetFloat("Squeeze", squeeze);
        }

        holder = hand;

        tRoot.parent = holder.modelGrabPoint;
    }
    public bool SetVRInteraction(VRInteraction interaction)
    {
        if (interaction != null)
        {
            if (vrInteraction != null)
            {
                vrInteraction.enabled = false;
            }
            vrInteraction         = interaction;
            vrInteraction.enabled = true;

            return(true);
        }

        return(false);
    }
Пример #17
0
 public override void OnManipulationEnded(VRInteraction caller)
 {
     base.OnManipulationEnded(caller);
     //Verificar se está na barra: Cair se sim, voltar à posição inicial se não
 }
Пример #18
0
 public abstract void OnGripRelease(VRInteraction caller, VRWand_Controller wand);
Пример #19
0
 private void Awake()
 {
     vrInteraction = transform.GetActiveComponentInChildren <VRInteraction>();
     trackedObj    = GetComponent <SteamVR_TrackedObject>();
     isLeftHand    = trackedObj.transform.name.ToLower().Contains("left");
 }
Пример #20
0
 public virtual void OnManipulationEnded(VRInteraction caller)
 {
     isManipulated = false;
 }
Пример #21
0
 public abstract void OnGripPress(VRInteraction caller, VRWand_Controller wand);
Пример #22
0
 public virtual void OnDeselected(VRInteraction caller)
 {
     isSelected = false;
 }
Пример #23
0
 public virtual void OnManipulationStarted(VRInteraction caller)
 {
     isManipulated = true;
 }
Пример #24
0
 public override void OnGripRelease(VRInteraction caller, VRWand_Controller wand)
 {
 }
Пример #25
0
 public virtual void OnSelected(VRInteraction caller)
 {
     isSelected = true;
 }
Пример #26
0
 protected virtual void Start()
 {
     vrInteraction             = GetComponent <VRInteraction>();
     vrInteraction.onInteract += OnInteract;
 }
Пример #27
0
 public override void OnManipulationStarted(VRInteraction caller)
 {
 }
Пример #28
0
 public override void OnSelected(VRInteraction caller)
 {
 }
Пример #29
0
 protected abstract void GetPicked(VRInteraction interaction);
Пример #30
0
 public override void OnTriggerPress(VRInteraction caller, VRWand_Controller wand)
 {
 }