示例#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
 }
 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");
 }
 public virtual void OnManipulationEnded(VRInteraction caller)
 {
     isManipulated = false;
 }
 public abstract void OnGripPress(VRInteraction caller, VRWand_Controller wand);
 public virtual void OnDeselected(VRInteraction caller)
 {
     isSelected = false;
 }
 public virtual void OnManipulationStarted(VRInteraction caller)
 {
     isManipulated = true;
 }
示例#24
0
 public override void OnGripRelease(VRInteraction caller, VRWand_Controller wand)
 {
 }
 public virtual void OnSelected(VRInteraction caller)
 {
     isSelected = true;
 }
示例#26
0
 protected virtual void Start()
 {
     vrInteraction             = GetComponent <VRInteraction>();
     vrInteraction.onInteract += OnInteract;
 }
 public override void OnManipulationStarted(VRInteraction caller)
 {
 }
 public override void OnSelected(VRInteraction caller)
 {
 }
示例#29
0
 protected abstract void GetPicked(VRInteraction interaction);
 public override void OnTriggerPress(VRInteraction caller, VRWand_Controller wand)
 {
 }