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; } }
void Awake() { instance = this; }