1234567891011121314151617181920212223242526272829303132333435 |
- 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);
- }
- }
- }
- }
|