using System.Collections; using System.Collections.Generic; using UnityEngine; using Sirenix.OdinInspector; namespace KairoEngine.SoundtrackSystem { public class SoundtrackTrigger : MonoBehaviour { public Soundtrack soundtrack; public bool playOnStart = true; public bool endOnSceneChange = true; [ShowIf("@hasLayers()")] public string playLayer = ""; private bool hasLayers() { if(soundtrack != null) { if(soundtrack.soundtrackType == SoundtrackType.Layered) return true; } return false; } void Start() { if(playOnStart) { // changed this.... SoundtrackManager.PlayTrack(soundtrack); } } } }