Enemy_UI.cs 721 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class Enemy_UI : MonoBehaviour {
  6. public static Enemy_UI instance;
  7. public Image hpbar;
  8. public Text level;
  9. public Image hpbox;
  10. public float UIscale;
  11. void Start () {
  12. instance = this;
  13. UIscale = GetComponentInParent<CanvasData>().UIScale;
  14. hid();
  15. }
  16. public void hid()
  17. {
  18. hpbox.enabled = false;
  19. hpbar.enabled = false;
  20. level.enabled = false;
  21. }
  22. public void show()
  23. {
  24. hpbox.enabled = true;
  25. hpbar.enabled = true;
  26. level.enabled = true;
  27. }
  28. // Update is called once per frame
  29. void Update () {
  30. }
  31. }