This commit is contained in:
2026-04-21 23:02:51 +08:00
parent e6ff3d2c19
commit fbe6ca9605
100 changed files with 10668 additions and 19173 deletions
@@ -0,0 +1,30 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class BoxesSpawner : MonoBehaviour
{
public int num;
public float maxSize;
public float minSize;
public GameObject boxPrefab;
public List<Color> colors;
private void Start()
{
for (int i = 0; i < num; i++)
{
var box = Instantiate(boxPrefab, Random.insideUnitCircle * 5, Quaternion.identity);
box.GetComponent<SpriteRenderer>().color = colors[Random.Range(0, colors.Count)];
box.transform.localScale = Vector3.one * Random.Range(minSize, maxSize);
}
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.R))
{
SceneManager.LoadScene(0);
}
}
}