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

public class winfx : MonoBehaviour {

    public string level;
    public int timeNext;

    void OnTriggerStay(Collider other)
    {
        if (other.gameObject.tag == "Player")
        {
            AkSoundEngine.PostEvent("WINFX",gameObject);
            AkSoundEngine.SetRTPCValue("WINFX", Time.time % 1900);
            Invoke("nextLevel",timeNext);
        }   
    }


    public void nextLevel()
    {
        SceneManager.LoadScene(level);
    }
}
