Advertisement
JonneOpettaja

Spawn

Mar 8th, 2019
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Spawn : MonoBehaviour {
  6.  
  7.     public GameObject[] enemyPool;
  8.     public bool active = true;
  9.  
  10.     public void generateEnemy()
  11.     {
  12.         if (active)
  13.         {
  14.             GameObject go = Instantiate(enemyPool[Random.Range(0, enemyPool.Length)], transform.position, Quaternion.identity) as GameObject;
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement