using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class CounterText : MonoBehaviour
{
    TMP_Text mText;

    // Start is called before the first frame update
    void Start()
    {
        mText = gameObject.GetComponent<TMP_Text    >();
    }

    // Update is called once per frame
    void FixedUpdate()
    {
    
            GameObject[] gos = GameObject.FindGameObjectsWithTag("SpawnPoints");
            int num_factories = gos.Length;

            gos = GameObject.FindGameObjectsWithTag("bullet");
            int num_bullets = gos.Length;

            gos = GameObject.FindGameObjectsWithTag("Enemy");
            int num_enemies = gos.Length;

            mText.text = "Missing factories : "+ num_factories.ToString() + "\nFlying bullets : "+ num_bullets.ToString() +
            "\nEnemies : "+ num_enemies.ToString() ;
       
    }
}
