示例#1
0
文件: UI.cs 项目: jamioflan/LD48
 public void SpawnHealthbar(Creature creature)
 {
     if (creature.GetComponentInChildren <UIHealthbar>() == null)
     {
         UIHealthbar hpBar = Instantiate(healthbarPrefab, Vector3.up * creature.hpbarheight, Quaternion.identity, creature.transform);
         hpBar.transform.localPosition = new Vector3(0f, creature.hpbarheight, 0f);
         hpBar.transform.localRotation = Quaternion.identity;
         //hpBar.transform.localScale = Vector3.one;
         hpBar.creature = creature;
     }
 }
示例#2
0
 void Awake()
 {
     instance = this;
 }