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

public class Batery : Pickable {

	public float Gauge = 0.0f;

	Material GaugeMat;
	int GaugeProp;

	void Start() {
		GaugeProp = Shader.PropertyToID("_Gauge");
		MeshRenderer MRGauge = GetComponent<MeshRenderer>();
		GaugeMat = MRGauge.material;
	}

	void Update() {
		float GaugeValue = Mathf.Clamp01(Gauge);
		if(GaugeMat) {
			GaugeMat.SetFloat(GaugeProp,GaugeValue);
		}
	}
}
