Added audio of Pulver combining stuff
This commit is contained in:
26
Assets/Scripts/Sound/PulverAudioController.cs
Normal file
26
Assets/Scripts/Sound/PulverAudioController.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
public class PulverAudioController : MonoBehaviour
|
||||
{
|
||||
private AppleAudioSource audioSource;
|
||||
public AudioResource combineAudio;
|
||||
private FollowerController followerController;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
audioSource = GetComponent<AppleAudioSource>();
|
||||
followerController = GetComponent<FollowerController>();
|
||||
followerController.PulverIsCombining.AddListener(PulverIsCombining);
|
||||
|
||||
}
|
||||
|
||||
void PulverIsCombining()
|
||||
{
|
||||
audioSource.audioSource.resource = combineAudio;
|
||||
audioSource.Play(0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user