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

public class BatteryDisplayController : MonoBehaviour {

    public RectTransform batteryBar;
    public UnityEngine.UI.Text text;
	
	void Update () {
        var j = DroneController.active.joules;
        text.text = j + "kJ";
        batteryBar.anchorMax = new Vector2(
            (float)j / DroneController.active.jouleCapacity,
            batteryBar.anchorMax.y);
	}
}
