// Update is called once per frame void Update() { Text text = GetComponent <Text>(); //Gets the text component of object TargetSpawn TargetSpawner = FindObjectOfType <TargetSpawn>(); //Finds target spawner and sets a temporary value to be a reference of target spawner text.text = "Target Ammount : " + TargetSpawner.TargetMax; //Sets text to be target amount : + target spawner target count/max }
public static void START_SPAWN_TARGET() { TargetSpawn.SPAWN_TARGET(); }