private void GameDetailsSurvivor() { lastNpc = GameObject.FindGameObjectWithTag(Tags.Npc).GetComponentInChildren <NpcController>(); endGameDetails.text = TextSurvivorInfo + " "; endGameDetails.text += lastNpc.GetHealth(); endGameDetails.text += Environment.NewLine; endGameDetails.text += TextTimeTaken + " "; endGameDetails.text += timePassed; }
private void Update() { if (npcController == null) { healthText.text = "0"; stateText.text = "dead"; stateText.color = Color.red; positionText.text = ""; } else { healthText.text = npcController.GetHealth().ToString(); stateText.text = npcController.GetStateString(); positionText.text = "x: " + (int)npcController.transform.position.x + ", y: " + (int)npcController.transform.position.y; } }