using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameSession : MonoBehaviour {

    [System.Serializable]
    public class Path {
        public Mr1.PathData path;
        public float time;
    }

    public static GameSession Get;
    public Path Path1, Path2, Path3, Path4, Path5, Path6, Path7, Path8, Path9, Path10, Path11, Path12;
    public WavePlatform Plat1, Plat2, Plat3;
    public int Song = 1;

    void Awake() {
        Get = this;
    }

    void Start() {
        AudioManager.Get.PlaySFX("Start");
    }

    void Update() {
        AudioManager.Get.PlayBGM("Song" + Song);
    }

    public void NextSong() {
        Song++;
        switch(Song) {
            case 2:
                Plat1.Path = Path4.path;
                Plat2.Path = Path5.path;
                Plat3.Path = Path6.path;
                Plat1.Speed = Path4.time;
                Plat2.Speed = Path5.time;
                Plat3.Speed = Path6.time;
                break;
            case 3:
                Plat1.Path = Path7.path;
                Plat2.Path = Path8.path;
                Plat3.Path = Path9.path;
                Plat1.Speed = Path7.time;
                Plat2.Speed = Path8.time;
                Plat3.Speed = Path9.time;
                break;
            case 4:
                Plat1.Path = Path10.path;
                Plat2.Path = Path11.path;
                Plat3.Path = Path12.path;
                Plat1.Speed = Path10.time;
                Plat2.Speed = Path11.time;
                Plat3.Speed = Path12.time;
                break;
            default:
                Plat1.Path = Path1.path;
                Plat2.Path = Path2.path;
                Plat3.Path = Path3.path;
                Plat1.Speed = Path1.time;
                Plat2.Speed = Path2.time;
                Plat3.Speed = Path3.time;
                break;
        }
        Plat1.Reset();
        Plat2.Reset();
        Plat3.Reset();
    }
}
