- Increased SFX pool size from 8 to 16 in AudioManager - Enabled preloadAudioData for multiple SFX files - Removed unused VisualScripting import from Checkpoint script - Reordered using statements in several scripts for consistency - Added CoinCollectible component to Coin prefab with pickup effects - Updated sorting layers and mesh LOD settings in Coin prefabs - Fixed typo in Interfaces.cs: optionaAttachPoint to optionalAttachPoint - Modified AddCoin method to accept count parameter and handle coin overflow - Moved projectile scripts (BasicProjectile, EnemyBasicProjectile, PhysicsProjectile, PickableProjectile) - Cleaned up unused namespaces and imports across various scripts
33 lines
932 B
C#
33 lines
932 B
C#
using UnityEngine;
|
|
|
|
using RR.Common.Managers;
|
|
using RR.Game2D.Core.Managers;
|
|
|
|
namespace RR.Common.Controllers
|
|
{
|
|
public class MusicController : MonoBehaviour
|
|
{
|
|
[SerializeField] private AudioManager audioManager;
|
|
[SerializeField] private AudioClip musicClip;
|
|
[SerializeField] private float musicVolume = -1f;
|
|
[SerializeField] private bool loop = true;
|
|
|
|
[SerializeField] private bool useCrossfade = false;
|
|
[SerializeField] private float fadeDuration = -1f;
|
|
|
|
|
|
|
|
private void Start()
|
|
{
|
|
if (audioManager == null) audioManager = GameManager.Instance.Audio;
|
|
|
|
if (!musicClip) return;
|
|
|
|
if (useCrossfade)
|
|
audioManager.CrossfadeMusic(musicClip, fadeDuration, loop, musicVolume);
|
|
else
|
|
audioManager.PlayMusicImmediate(musicClip, loop, musicVolume);
|
|
}
|
|
}
|
|
}
|