Added audio of Pulver combining stuff
This commit is contained in:
@@ -5,6 +5,7 @@ using UnityEngine.SceneManagement;
|
||||
using Utils;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using UnityEngine.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Controls the follower character, including following the player, handling pickups, and managing held items.
|
||||
@@ -75,7 +76,12 @@ public class FollowerController: MonoBehaviour
|
||||
/// </summary>
|
||||
public event FollowerPickupHandler OnPickupReturned;
|
||||
private Coroutine _pickupCoroutine;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Event fired when Pulver is combining stuff
|
||||
/// </summary>
|
||||
public UnityEvent PulverIsCombining;
|
||||
|
||||
private Input.PlayerTouchController _playerTouchController;
|
||||
|
||||
void Awake()
|
||||
@@ -583,6 +589,7 @@ public class FollowerController: MonoBehaviour
|
||||
Destroy(pickupB.gameObject);
|
||||
TryPickupItem(newItem, itemData);
|
||||
PlayAnimationStationary("Combine", 10.0f);
|
||||
PulverIsCombining.Invoke();
|
||||
return CombinationResult.Successful;
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
2
Assets/Scripts/Sound/PulverAudioController.cs.meta
Normal file
2
Assets/Scripts/Sound/PulverAudioController.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bd397a60643eed45b586961ae6e3453
|
||||
Reference in New Issue
Block a user