void OnTriggerExit(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         prototype = other.gameObject.GetComponentInParent <PrototypeMover> ();
         if (prototype.enlarged == false)
         {
             Debug.Log("SCALE UP BITCH!");
             prototype.playAudio();
             prototype.ScaleUp();
         }
     }
 }
Exemple #2
0
 void OnTriggerEnter(Collider other)
 {
     //other.gameObject.tag == "Player"
     // Transfer rigidbody of the sphere to the damping coroutine
     if (other.gameObject.tag == "Player")
     {
         prototype = other.gameObject.GetComponent <PrototypeMover> ();
         // only slow down if in the target collider
         if (prototype.target == transform)
         {
             StartCoroutine(DampVelocity(other.GetComponent <Rigidbody> (), other));
         }
     }
 }
Exemple #3
0
    private void gazeTrigger2()
    {
        Ray        ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0));
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, 500.0f) && hit.collider.gameObject.layer == LayerMask.NameToLayer("Text Container"))
        {
            moving = hit.collider.gameObject.GetComponentInParent <PrototypeMover> ();

            if (moving.isMoving == false)
            {
                text = hit.collider.gameObject.GetComponentInParent <textDisplay> ();
                turnTextOn();
            }

            if (triggered == false)
            {
                timer += Time.deltaTime;
                reticle.fillAmount += 1.0f / triggerTime * Time.deltaTime;
            }

            if (timer >= triggerTime)
            {
                triggered = true;
                timer     = 0.0f;
                StartCoroutine(FadeReticle(0.0f, 0.7f));
                turnTextOff();

                //retcolor.a = Mathf.Lerp (retcolor.a, 0.0f, Time.deltaTime * 5.0f);
                //Debug.Log (retcolor.a);
                //reticle.material.color.a = retcolor;
                moving.isMoving = true;
            }
        }
        else if (text != null)
        {
            triggered          = false;
            reticle.fillAmount = 0;
            timer = 0.0f;
            turnTextOff();
        }
    }