public void Spawn() { var cube = Object.Instantiate(_cubePrefab); cube.transform.position = _spawnPoint.position; cube.transform.SetParent(_rootSpawn); SpawnCube?.Invoke(cube); }
// Use this for initialization void Start() { mainCamera = Camera.main; da = mainCamera.GetComponent <DataAccess>(); var spawnObject = GameObject.Find("Quadri"); sc = spawnObject.GetComponent <SpawnCube>(); fixCountDown = timeToFix; }
void Start() { spawnCube = GameObject.Find("GameManager").GetComponent <SpawnCube>(); }