﻿using System.Collections;
using UnityEngine;

public class collider_fin : MonoBehaviour {

    public Canvas ending_Canvas;
    public Canvas time;
    public Canvas Pick_Up_Canvas;
    public Canvas boussole;
  

    private void Start()
    {
        // If spline exists, position = the end of the spline.
        if (WindSpline.instance != null)
            transform.position = WindSpline.instance.Spline.GetPoint(1);
    }

    IEnumerator TempsMort()
    {
        yield return new WaitForSeconds(5.0f);
    }


    void OnTriggerEnter(Collider col)
    {
        if (col.GetComponentInParent<Boat>() != null)
        {
            PlayManager.instance.temps_Recup();
            ending_Canvas.enabled = true;
            time.enabled = false;
            Pick_Up_Canvas.enabled = false;
            boussole.enabled = false;
            Boat.instance.Rb.isKinematic= true;

        }
    }
}
