示例#1
0
        public void StartTrackers()
        {
            if (!IsValidSoundGroup)
            {
                return;
            }

#if !PHY3D_ENABLED
            MasterAudio.LogWarningIfNeverLogged("Ambient Sounds script will not function because you do not have Physics package installed.", MasterAudio.PHYSICS_DISABLED);
#else
            var shouldIgnoreCollisions = Physics.GetIgnoreLayerCollision(AmbientUtil.IgnoreRaycastLayerNumber, AmbientUtil.IgnoreRaycastLayerNumber);
            if (shouldIgnoreCollisions)
            {
                MasterAudio.LogWarningIfNeverLogged("You have disabled collisions between Ignore Raycast layer and itself on the Physics Layer Collision matrix. This must be turned back on or Ambient Sounds script will not function.", MasterAudio.ERROR_MA_LAYER_COLLISIONS_DISABLED);
                return;
            }
#endif

            var isListenerFollowerAvailable = AmbientUtil.InitListenerFollower();
            if (!isListenerFollowerAvailable)
            {
                MasterAudio.LogWarning("Your Ambient Sound script on Game Object '" + name + "' will not function because you have no Audio Listener component in any active Game Object in the Scene.");
                return; // don't bother creating the follower because there's no Listener to collide with.
            }

            if (!AmbientUtil.HasListenerFolowerRigidBody)
            {
                MasterAudio.LogWarning("Your Ambient Sound script on Game Object '" + name + "' will not function because you have turned off the Listener Follower RigidBody in Advanced Settings.");
            }

            var followerName = name + "_" + AmbientSoundGroup + "_" + UnityEngine.Random.Range(0, 9) + "_Follower";
            RuntimeFollower = AmbientUtil.InitAudioSourceFollower(Trans, followerName, AmbientSoundGroup, variationName, playVolume, FollowCaller, UseClosestColliderPosition, UseTopCollider, IncludeChildColliders, exitMode, exitFadeTime, reEnterMode, reEnterFadeTime);
        }
示例#2
0
        private void StartTrackers()
        {
            if (!IsValidSoundGroup)
            {
                return;
            }

            var isListenerFollowerAvailable = AmbientUtil.InitListenerFollower();

            if (!isListenerFollowerAvailable)
            {
                return; // don't bother creating the follower because there's no Listener to collide with.
            }

            var followerName = name + "_" + AmbientSoundGroup + "_" + Random.Range(0, 9) + "_Follower";

            RuntimeFollower = AmbientUtil.InitAudioSourceFollower(Trans, followerName, AmbientSoundGroup, FollowCaller);
        }
示例#3
0
        private void StartTrackers()
        {
            if (!IsValidSoundGroup)
            {
                return;
            }

            var isListenerFollowerAvailable = AmbientUtil.InitListenerFollower();

            if (!isListenerFollowerAvailable)
            {
                return; // don't bother creating the follower because there's no Listener to collide with.
            }

            if (!AmbientUtil.HasListenerFolowerRigidBody)
            {
                MasterAudio.LogWarning("Your Ambient Sound script on Game Object '" + name + "' will not function because you have turned off the Listener Follower RigidBody in Advanced Settings.");
            }

            var followerName = name + "_" + AmbientSoundGroup + "_" + Random.Range(0, 9) + "_Follower";

            RuntimeFollower = AmbientUtil.InitAudioSourceFollower(Trans, followerName, AmbientSoundGroup, FollowCaller, UseClosestColliderPosition, UseTopCollider, IncludeChildColliders);
        }