Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- public class Spawn_Manager : MonoBehaviour
- {
- public GameStatus _gameStatus;
- public GameObject[] _powerUp;
- public Ball _ball;
- public SceneLoader _sceneLoader;
- public GameObject spawner;
- // Start is called before the first frame update
- void Start()
- {
- _sceneLoader = GameObject.Find("SceneLoader").GetComponent<SceneLoader>();
- _gameStatus = GameObject.Find("GameStatus").GetComponent<GameStatus>();
- //StartCoroutine(PowerUpSpawnRoutine());
- }
- // Update is called once per frame
- void Update()
- {
- }
- public void StartSpawnRoutines()
- {
- //StartCoroutine(EnemySpwanRoutine());
- StartCoroutine(PowerUpSpawnRoutine());
- }
- IEnumerator PowerUpSpawnRoutine()
- {
- while (_gameStatus.gameStatusCount <= 1)
- {
- int randomPowerup = Random.Range(0, 2);
- Instantiate(_powerUp[randomPowerup], new Vector3(Random.Range(0.62f, 15.32f), 13, 0), Quaternion.identity);
- yield return new WaitForSeconds(8.0f);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement