protected override void OnInitialize() { // If based on head bob is true but head bob is not enabled, complain. if (enableAudio && basedOnHeadBob && !PlayerController.HeadBob.EnableBob) { Debug.LogWarning("Audio on '" + PlayerController.gameObject.name + "' is set to be based on head bob, but head bob isn't actually enabled!", PlayerController); } if (audioType == AudioTypes.Custom) { customBehaviour = PlayerController.GetComponent <PlayerAudioBehaviour>(); if (customBehaviour == null) { Debug.LogError("Audio type on " + PlayerController.gameObject.name + " is set to Custom but no PlayerAudioBehaviour is attached!"); return; } customBehaviour.Initialize(PlayerController, PlayerInput, footstepsSource, jumpSource, landSource); } }