health bar look at cam
This commit is contained in:
parent
9741ce2904
commit
585688b1e2
|
@ -11,6 +11,8 @@ public abstract class Tower : MonoBehaviour
|
|||
protected HealthComponent healthComp;
|
||||
protected Outline outline;
|
||||
|
||||
protected Camera mainCam;
|
||||
|
||||
// Getters
|
||||
public virtual void TowerSelected(bool selected)
|
||||
{
|
||||
|
@ -26,6 +28,8 @@ public abstract class Tower : MonoBehaviour
|
|||
outline = GetComponent<Outline>();
|
||||
Assert.IsNotNull(healthComp);
|
||||
Assert.IsNotNull(outline);
|
||||
|
||||
mainCam = Camera.main;
|
||||
}
|
||||
|
||||
protected virtual void Start()
|
||||
|
@ -38,6 +42,7 @@ public abstract class Tower : MonoBehaviour
|
|||
|
||||
protected virtual void Update()
|
||||
{
|
||||
selectedUI.transform.LookAt(mainCam.transform.position);
|
||||
}
|
||||
|
||||
protected virtual void FixedUpdate()
|
||||
|
|
Loading…
Reference in New Issue