using UnityEngine; public class DinoSpawnManager : MonoBehaviour { public static DinoSpawnManager Instance { get; private set; } public Transform[] spawnPoints; public float laneWidth = 2f; public float defaultZ = 0f; public float defaultY = 0.5f; void Awake() { Instance = this; } public Vector3 GetSpawnPosition(int playerId) { if (spawnPoints != null && spawnPoints.Length > 0) { Transform t = spawnPoints[Mathf.Abs(playerId) % spawnPoints.Length]; if (t != null) return t.position; } int lane = (playerId % 3) - 1; // -1, 0, 1 float x = lane * laneWidth; return new Vector3(x, defaultY, defaultZ); } }