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

public class BarScript : MonoBehaviour {

    public float curfill;

	// Use this for initialization
	void Start () {
        curfill = 1f;
	}
	
	// Update is called once per frame
	void Update () {
        float targfill = PlayerPrefs.GetInt("Fuel")/10f;
        curfill += (targfill - curfill) * Time.deltaTime;

        Vector3 v = new Vector3(0.8f * curfill, 0.8f, 1);
        this.transform.localScale = v;

        Vector3 p = new Vector3(-7f - 1.9f * (1f-curfill), 3.6f, -0.2f);
        this.transform.position = p;
	    	
	}
}
