// Use this for initialization void Start() { gameManager = GameObject.Find("GameManager"); gameManagerRef = gameManager.GetComponent <GameManager>(); soundManager = gameManager.GetComponent <SoundManager>(); waypointGO = GameObject.Find("Waypoints"); spawner = gameManager.GetComponent <SpawnerScript>(); speed = spawner.getCurrentWave().getSpeed(); healthMax = spawner.getCurrentWave().getHealth(); health = healthMax; waypointCount = waypointGO.transform.childCount; healthBar = (GameObject)Resources.Load("Prefabs/healthBar"); healthBarOffset = new Vector3(0.0f, 5.0f, 0.0f); healthBar = Instantiate(healthBar, transform); healthBarScale = new Vector3(health / healthMax, healthBar.transform.localScale.y, healthBar.transform.localScale.z); healthBar.transform.position = transform.position + healthBarOffset; }
public void updateWaveString() { currentWaveString = "Current wave: " + spawner.getCurrentWave().getName(); }