mixedcards/Assets/Battle/HeroInfoUI.cs
henriquenakashima 3cb9eb5031 Initial import
2020-09-17 22:52:50 -04:00

29 lines
748 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class HeroInfoUI : MonoBehaviour
{
public GameObject target;
public BattleParticipant battleParticipant;
public Text nameText;
public Image healthBarBgImage;
public Image healthBarFgImage;
private Camera mainCamera;
// Start is called before the first frame update
void Start()
{
this.mainCamera = Camera.main;
this.nameText.text = this.battleParticipant.getDisplayName();
}
// Update is called once per frame
void Update()
{
Vector3 targetPos = this.mainCamera.WorldToScreenPoint(target.transform.position);
transform.position = targetPos;
}
}