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

public class ScoreSystem : MonoBehaviour
{
    public int score;
    public float timeScore;
    
	void Update ()
    {

	}
	
 	public void AddToScore (int adj)
    {
        score += adj;
	}

    public void Finish()
    {
        if (timeScore < 0)
            timeScore = 0;

        PlayerPrefs.SetInt("Time Score", Mathf.CeilToInt(timeScore));
        PlayerPrefs.SetInt("Steal Score", score);
        score += Mathf.CeilToInt(timeScore);
        print("Time score is: " + timeScore);
        print("Final score is: " + score);
        PlayerPrefs.SetInt("Final Score", score);

        Application.LoadLevel(3);
    }
}
