Files

17 lines
356 B
C#
Raw Permalink Normal View History

2026-04-29 09:22:08 +09:00
using UnityEngine;
public class SpawnZone : MonoBehaviour
{
public BoxCollider area;
public Vector3 GetRandomPosition()
{
Bounds bounds = area.bounds;
return new Vector3(
Random.Range(bounds.min.x, bounds.max.x),
bounds.center.y,
Random.Range(bounds.min.z, bounds.max.z)
);
}
}