// Start is called before the first frame update void Start() { myClass = FindObjectOfType <Numofenemies>(); GameObject copy = Instantiate(enemy, transform.position, Quaternion.identity) as GameObject; if (myClass) { myClass.numofenemies++; } }
private void Start() { myClass = FindObjectOfType <Numofenemies>(); }