Ejemplo n.º 1
0
 void OnTriggerEnter2D(Collider2D triggerCollider)
 {
     Debug.Log(gameObject.name + " colliding with trigger.");
     transmitting = true;
     commLightSwitcher.SetSprite(2);
     timer    = 0;
     distance = Vector3.Distance(circleCollider.transform.position, triggerCollider.transform.position);
     Debug.Log(distance);
     UpdateProximity(distance);
     Debug.Log(proximity);
     if (hasText)
     {
         controller.SetTextOneOff(Transmission.incomingTransmission, true);
     }
     if (hasAudio)
     {
         audioSource.volume = minVolume + proximity * (maxVolume - minVolume);
         audioSource.Play();
         if (!hasText)
         {
             controller.SetTextOneOff(Transmission.streamingAudioTransmission, true);
         }
     }
 }