1
0
Fork 0
crew-of-one/Assets/Scripts/ship-controls/shieldChargeBar.cs
Ava Gaiety Wroten 0cc43d7fb3 Initial Commit
2020-07-30 13:17:01 -05:00

20 lines
531 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class shieldChargeBar : MonoBehaviour
{
GameObject ship;
void Start()
{
ship = GameObject.FindWithTag("ship");
transform.localScale = new Vector3(0, transform.localScale.y, transform.localScale.z);
}
void Update()
{
float x = Mathf.Lerp(0, 3.55f, ship.GetComponent<ship>().shieldLevels);
transform.localScale = new Vector3(x, transform.localScale.y, transform.localScale.z);
}
}