Big stupid refactor of spawning almost done

This commit is contained in:
Michal Pikulski
2025-12-17 18:51:33 +01:00
parent 7a598c302c
commit 867399c838
32 changed files with 1450 additions and 403 deletions

View File

@@ -0,0 +1,27 @@
using Minigames.Airplane.Data;
using UnityEngine;
namespace Minigames.Airplane.Data
{
/// <summary>
/// Component to store spawn positioning data on prefabs.
/// Attach this to obstacle prefabs that need specific positioning behavior.
/// If not present, spawner will use default positioning from AirplaneSettings.
/// </summary>
[AddComponentMenu("Airplane/Prefab Spawn Entry")]
public class PrefabSpawnEntryComponent : MonoBehaviour
{
[Tooltip("How to position this object vertically")]
public SpawnPositionMode spawnPositionMode = SpawnPositionMode.SnapToGround;
[Tooltip("Y position to use (when mode is SpecifiedY)")]
public float specifiedY;
[Tooltip("Min Y for random range (when mode is RandomRange)")]
public float randomYMin = -5f;
[Tooltip("Max Y for random range (when mode is RandomRange)")]
public float randomYMax = 5f;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 90239fb003214b4087d0717f6f417161
timeCreated: 1765990367

View File

@@ -0,0 +1,32 @@
using Core.Settings;
using UnityEngine;
namespace Minigames.Airplane.Data
{
/// <summary>
/// Parameters passed from AirplaneSpawnManager to spawners during initialization.
/// Encapsulates shared references and configuration.
/// </summary>
public class SpawnInitParameters
{
/// <summary>
/// Parent transform for spawned objects (organization)
/// </summary>
public Transform SpawnContainer { get; set; }
/// <summary>
/// Settings reference for spawn configuration
/// </summary>
public IAirplaneSettings Settings { get; set; }
/// <summary>
/// Create spawn initialization parameters
/// </summary>
public SpawnInitParameters(Transform spawnContainer, IAirplaneSettings settings)
{
SpawnContainer = spawnContainer;
Settings = settings;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: eb788e2f6d204a5fb1b2ae79ed38e7c2
timeCreated: 1765972065