fork download
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class EnemyManager : MonoBehaviour
  6. {
  7. public static EnemyManager instance;
  8.  
  9. [SerializeField]
  10. private GameObject enemyPrefab;
  11.  
  12. void Awake()
  13. {
  14. if(instance = null)
  15. {
  16. instance = this;
  17. }
  18. }
  19.  
  20. // Start is called before the first frame update
  21. void Start()
  22. {
  23. SpawnEnemy();
  24. }
  25.  
  26. public void SpawnEnemy()
  27. {
  28. Instantiate(enemyPrefab, transform.position, Quaternion.identity);
  29. }
  30.  
  31. // Update is called once per frame
  32. void Update()
  33. {
  34.  
  35. }
  36. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(3,7): error CS0246: The type or namespace name `UnityEngine' could not be found. Are you missing an assembly reference?
prog.cs(5,29): error CS0246: The type or namespace name `MonoBehaviour' could not be found. Are you missing an assembly reference?
prog.cs(10,13): error CS0246: The type or namespace name `GameObject' could not be found. Are you missing an assembly reference?
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty