initial project setup. like you know. 500 folders and dependencies. actually its not i literally just made like 4 folders and added 3 random plugins i use
This commit is contained in:
parent
4af2291d26
commit
5c63db722e
377 changed files with 66388 additions and 0 deletions
26
Assets/Plugins/Bremsengine/Music Player/MusicWrapper.cs
Normal file
26
Assets/Plugins/Bremsengine/Music Player/MusicWrapper.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
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