修改mesh

This commit is contained in:
2025-11-04 23:11:56 +08:00
parent 32f07eb14e
commit e8f6308580
93 changed files with 1587 additions and 491 deletions

View File

@@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Spawner : MonoBehaviour
{
public Transform prefab;
public float randomRange = 0.5f;
public float timeToSpawn = 4.0f;
private float timer;
public void Update()
{
timer += Time.deltaTime;
if (timer >= timeToSpawn)
{
timer = 0.0f;
var obj = Instantiate(prefab, transform.position + Random.insideUnitSphere * randomRange, transform.rotation);
obj.gameObject.SetActive(true);
}
}
public void OnDrawGizmos()
{
Gizmos.color = Color.yellow;
Gizmos.DrawWireSphere(transform.position, randomRange);
}
}