1
Fork 0
mirror of https://github.com/Steffo99/keep-everything-alive.git synced 2024-11-23 18:04:18 +00:00
keep-everything-alive/Assets/Scripts/Generic/SpawnInArea.cs

20 lines
472 B
C#
Raw Normal View History

2020-04-19 14:24:38 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpawnInArea : MonoBehaviour
{
public GameObject instantiate;
public Vector2 min;
public Vector2 max;
2020-04-19 16:03:29 +00:00
public int quantity = 1;
2020-04-19 14:24:38 +00:00
private void Start()
{
2020-04-19 16:03:29 +00:00
for(int i = 0; i < quantity; i++) {
2020-04-19 14:24:38 +00:00
Instantiate(instantiate, new Vector2(Random.Range(min.x, max.x), Random.Range(min.y, max.y)), Quaternion.identity, transform);
}
}
}