Stranar/Assets/Scripts/bombspawner.cs
2022-06-27 11:54:53 +02:00

31 lines
732 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class bombspawner : MonoBehaviour
{
public GameObject totok;
public int maxcubes = 100;
public void PlaceObj(){
int x = Random.Range(-821, 1000);
int z = Random.Range(-950, 950);
int y = Random.Range(-120, 1680);
GameObject iks = Instantiate(totok.gameObject, new Vector3(x, y, z), Quaternion.identity);
iks.SetActive(true);
} // Start is called before the first frame update
public void StartBombs()
{
for (int i = 0; i < maxcubes; i++)
{
PlaceObj();
}
}
// Update is called once per frame
void Update()
{
}
}