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

public class EnergyTankController : MonoBehaviour {

    public float maxScale = 1.72f;
    public DroneController droneController;
	
    void Start()
    {
        droneController = GetComponentInParent<DroneController>();
    }

	void Update () {
        var scale = transform.localScale;
        var pos = transform.localPosition;
        scale.x = (float)droneController.joules / droneController.jouleCapacity;
        pos.x = -0.2f + ((droneController.joules*0.2f) / droneController.jouleCapacity);
        transform.localScale = scale;
        transform.localPosition = pos;
	}
}
