Stash paralax work

This commit is contained in:
Michal Pikulski
2025-12-17 12:39:44 +01:00
parent 4ce61ee756
commit 7a598c302c
21 changed files with 1404 additions and 523 deletions

View File

@@ -0,0 +1,24 @@
namespace Minigames.Airplane.Data
{
/// <summary>
/// Defines parallax layer depth for background elements.
/// </summary>
public enum ParallaxLayer
{
/// <summary>
/// Furthest back layer, moves slowest (lowest parallax factor).
/// </summary>
Background,
/// <summary>
/// Middle layer, moves at medium speed.
/// </summary>
Middle,
/// <summary>
/// Closest layer, moves fastest (highest parallax factor).
/// </summary>
Foreground
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 30cd4bc1743c44089146678153542aae
timeCreated: 1765965854

View File

@@ -0,0 +1,45 @@
using System;
using UnityEngine;
namespace Minigames.Airplane.Data
{
/// <summary>
/// Configuration for a single spawn pool.
/// Contains prefabs, unlock timing, and optional spawn parameter overrides.
/// </summary>
[Serializable]
public class SpawnPoolConfig
{
[Tooltip("Prefabs that can spawn from this pool")]
public GameObject[] prefabs;
[Tooltip("Time (seconds from game start) when this pool becomes available. 0 = available immediately.")]
public float unlockTime = 0f;
[Tooltip("Description for this pool (editor reference only)")]
public string description = "Pool";
[Header("Spawn Parameter Overrides (0 = use global)")]
[Tooltip("Override minimum spawn distance for this pool (0 = use global)")]
public float overrideMinDistance = 0f;
[Tooltip("Override maximum spawn distance for this pool (0 = use global)")]
public float overrideMaxDistance = 0f;
/// <summary>
/// Check if this pool has valid prefabs assigned.
/// </summary>
public bool HasPrefabs => prefabs != null && prefabs.Length > 0;
/// <summary>
/// Get effective minimum distance (uses override if non-zero, otherwise uses global).
/// </summary>
public float GetMinDistance(float globalMin) => overrideMinDistance > 0f ? overrideMinDistance : globalMin;
/// <summary>
/// Get effective maximum distance (uses override if non-zero, otherwise uses global).
/// </summary>
public float GetMaxDistance(float globalMax) => overrideMaxDistance > 0f ? overrideMaxDistance : globalMax;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 51d29acb7cdd48819588acd1401456a9
timeCreated: 1765965854

View File

@@ -0,0 +1,21 @@
namespace Minigames.Airplane.Data
{
/// <summary>
/// Defines how multiple spawn pools are combined.
/// </summary>
public enum SpawnPoolMode
{
/// <summary>
/// All unlocked pools contribute to a single shared spawn stream.
/// Objects spawn at regular intervals considering all available pools.
/// </summary>
Together,
/// <summary>
/// Each pool spawns independently with its own timing.
/// Multiple objects can spawn simultaneously from different pools.
/// </summary>
Exclusive
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5206332ad0e54ed4b20df47663202967
timeCreated: 1765965854