Exemple #1
0
        /// <summary>
        /// Used to calculate the volume and r effects based on rotation of the <see cref="RemotePeer"/> relative to the <see cref="LocalPeer"/>.
        /// </summary>
        private void CalculateAngleToTarget()
        {
            Vector3 vectorToTarget = (PlayerLocation.GetPlayerLocation() - transform.position);
            float   angleToTarget  = Vector3.Angle(transform.forward, vectorToTarget);

            rotationToTargetPercent = 1 - (angleToTarget / 180);
            filterpercentage        = minRotationalFilterPercentage + ((1 - minRotationalFilterPercentage) * rotationToTargetPercent);
            rotationToTargetPercent = minRotationalVolumePercentage + ((1 - minRotationalVolumePercentage) * rotationToTargetPercent);
        }