Ejemplo n.º 1
0
 void ReleaseDart()
 {
     if (currentFollower != null)
     {
         currentFollower.Detach();
         currentFollower.GetComponent <Collider>().enabled            = true;
         currentFollower.GetComponent <RotateAlongVelocity>().enabled = true;
         currentFollower = null;
         audioFX.Play();
         experiment.SetBlockBegin(false);
         experiment.RecordCurrentJointAngles(armKinematics.GetArmResults(), this.transform.position);
         dartsLeft--;
     }
 }
Ejemplo n.º 2
0
        void GrabDart()
        {
            prefabToGrab.SetActive(true);                // Enable dart object
            GameObject dart = Instantiate(prefabToGrab); // Create new instance of the dart prefab

            if (dart != null)
            {
                dartCollider = dart.GetComponent <Collider>();
            }
            dartCollider.enabled = false; // Disable dart collider
            currentFollower      = dart.GetComponent <Follower>();
            if (glove.GloveEnabled())
            {
                currentFollower.AttachTo(gloveAttachmentPoint); // Attach dart to glove
            }
            else
            {
                currentFollower.AttachTo(controllerAttachmentPoint); // Attach dart to hand
            }
        }