public void GetSpecificInteractionType() { if (soundInteractionSource.GetComponent <PowerInteraction>() != null) { powerInteractionSource = soundInteractionSource.GetComponent <PowerInteraction>(); PowerInteractionType = true; } if (soundInteractionSource.GetComponent <StateInteraction>() != null) { stateInteractionSource = soundInteractionSource.GetComponent <StateInteraction>(); StateInteractionType = true; } }
public void ConfigureAudioSetUp() { CheckSoundBanks(); if (AmbiantSound != null && RoomAmbiantType) { PlayerDetectionSphereCollider.enabled = false; PlayerDetectionBoxCollider.enabled = true; PlayerDetectionBoxCollider.isTrigger = true; PlayerDetectionBoxCollider.size = new Vector3(maxDistanceToHear + 5f, maxDistanceToHear + 5f, PlayerDetectionBoxCollider.size.z); AmbiantAudioInit(); } else if (AmbiantSound != null && ObjectAmbiantType) { PlayerDetectionBoxCollider.enabled = false; PlayerDetectionSphereCollider.enabled = true; PlayerDetectionSphereCollider.radius = maxDistanceToHear + 5f; AmbiantAudioInit(); } else if (PonctualSoundsEnabled && InteractionType) { PlayerDetectionBoxCollider.enabled = false; PlayerDetectionSphereCollider.enabled = true; PlayerDetectionSphereCollider.radius = maxDistanceToHear + 5f; audio.loop = false; audio.playOnAwake = false; if (this.transform.parent.GetComponent <InteractionBase>() != null) { soundInteractionSource = this.transform.parent.GetComponent <InteractionBase>(); } if (soundInteractionSource.GetComponent <PowerInteraction>() != null) { powerInteractionSource = soundInteractionSource.GetComponent <PowerInteraction>(); } GetSpecificInteractionType(); } else if (AmbiantSound != null && MixedType) { PlayerDetectionBoxCollider.enabled = false; PlayerDetectionSphereCollider.enabled = true; PlayerDetectionSphereCollider.radius = maxDistanceToHear + 5f; AmbiantAudioInit(); if (this.transform.parent.GetComponent <InteractionBase>() != null) { soundInteractionSource = this.transform.parent.GetComponent <InteractionBase>(); } GetSpecificInteractionType(); } else if (OtherType) { PlayerDetectionBoxCollider.enabled = false; PlayerDetectionSphereCollider.enabled = true; PlayerDetectionSphereCollider.radius = maxDistanceToHear + 5f; audio.loop = false; audio.playOnAwake = false; } else if (OtherTypeLoop) { PlayerDetectionBoxCollider.enabled = false; PlayerDetectionSphereCollider.enabled = true; PlayerDetectionSphereCollider.radius = maxDistanceToHear + 5f; audio.playOnAwake = false; if (this.transform.parent.GetComponent <InteractionBase>() != null) { soundInteractionSource = this.transform.parent.GetComponent <InteractionBase>(); } } else { PlayerDetectionBoxCollider.enabled = false; PlayerDetectionSphereCollider.enabled = true; PlayerDetectionSphereCollider.radius = maxDistanceToHear + 5f; audio.mute = true; audio.Pause(); } }