コード例 #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;
 }