amazing import spam
This commit is contained in:
parent
655a116647
commit
3160bff7a3
1016 changed files with 801 additions and 51 deletions
|
|
@ -1,26 +0,0 @@
|
|||
using Core.Extensions;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Bremsengine
|
||||
{
|
||||
[CreateAssetMenu(menuName = "Bremsengine/MusicWrapper")]
|
||||
[System.Serializable]
|
||||
public class MusicWrapper : ScriptableObject
|
||||
{
|
||||
public static implicit operator AudioClip(MusicWrapper mw) => mw == null ? null : mw.musicClip;
|
||||
public static implicit operator float(MusicWrapper mw) => mw == null ? 0f : mw.musicVolume;
|
||||
public string TrackName = Helper.DefaultName;
|
||||
public AudioClip musicClip;
|
||||
public float musicVolume => clipVolume * MusicPlayer.GlobalVolume;
|
||||
[SerializeField] float clipVolume = 0.7f;
|
||||
[field: SerializeField] public bool dontReplaceSelf { get; private set; } = true;
|
||||
private void OnValidate()
|
||||
{
|
||||
this.FindStringError(nameof(TrackName), TrackName);
|
||||
}
|
||||
public void Play()
|
||||
{
|
||||
MusicPlayer.PlayMusicWrapper(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue