Rework how prefabs for cards are pre-defined (#88)
Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com> Reviewed-on: #88
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using AppleHills.Core.Settings;
|
||||
using Minigames.CardSorting.Data;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Core.Settings
|
||||
@@ -29,21 +28,21 @@ namespace Core.Settings
|
||||
[SerializeField] private AnimationCurve speedCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
|
||||
|
||||
[Header("Item Pools")]
|
||||
[Tooltip("Garbage items that can spawn (banana peels, cans, receipts, etc.)")]
|
||||
[SerializeField] private GarbageItemDefinition[] garbageItems = new GarbageItemDefinition[0];
|
||||
[Tooltip("Normal rarity card prefabs that can spawn")]
|
||||
[SerializeField] private GameObject[] normalCardPrefabs = new GameObject[0];
|
||||
|
||||
[Tooltip("Rare rarity card prefabs that can spawn")]
|
||||
[SerializeField] private GameObject[] rareCardPrefabs = new GameObject[0];
|
||||
|
||||
[Tooltip("Legendary rarity card prefabs that can spawn")]
|
||||
[SerializeField] private GameObject[] legendaryCardPrefabs = new GameObject[0];
|
||||
|
||||
[Tooltip("Garbage prefabs that can spawn")]
|
||||
[SerializeField] private GameObject[] garbagePrefabs = new GameObject[0];
|
||||
|
||||
[Header("Spawn Weights")]
|
||||
[Tooltip("Weight for spawning normal rarity cards")]
|
||||
[Range(0, 100)] [SerializeField] private float normalCardWeight = 40f;
|
||||
|
||||
[Tooltip("Weight for spawning rare rarity cards")]
|
||||
[Range(0, 100)] [SerializeField] private float rareCardWeight = 30f;
|
||||
|
||||
[Tooltip("Weight for spawning legendary rarity cards")]
|
||||
[Range(0, 100)] [SerializeField] private float legendCardWeight = 20f;
|
||||
|
||||
[Tooltip("Weight for spawning garbage items")]
|
||||
[Range(0, 100)] [SerializeField] private float garbageWeight = 10f;
|
||||
[Tooltip("Ratio of cards to garbage (0 = all garbage, 0.5 = 50/50 split, 1 = all cards)")]
|
||||
[Range(0, 1)] [SerializeField] private float cardToGarbageRatio = 0.5f;
|
||||
|
||||
[Header("Scoring")]
|
||||
[Tooltip("Points awarded for correct sort")]
|
||||
@@ -81,11 +80,11 @@ namespace Core.Settings
|
||||
public float InitialBeltSpeed => initialBeltSpeed;
|
||||
public float MaxBeltSpeed => maxBeltSpeed;
|
||||
public AnimationCurve SpeedCurve => speedCurve;
|
||||
public GarbageItemDefinition[] GarbageItems => garbageItems;
|
||||
public float NormalCardWeight => normalCardWeight;
|
||||
public float RareCardWeight => rareCardWeight;
|
||||
public float LegendCardWeight => legendCardWeight;
|
||||
public float GarbageWeight => garbageWeight;
|
||||
public GameObject[] NormalCardPrefabs => normalCardPrefabs;
|
||||
public GameObject[] RareCardPrefabs => rareCardPrefabs;
|
||||
public GameObject[] LegendaryCardPrefabs => legendaryCardPrefabs;
|
||||
public GameObject[] GarbagePrefabs => garbagePrefabs;
|
||||
public float CardToGarbageRatio => cardToGarbageRatio;
|
||||
public int CorrectSortPoints => correctSortPoints;
|
||||
public int IncorrectSortPenalty => incorrectSortPenalty;
|
||||
public int MissedItemPenalty => missedItemPenalty;
|
||||
|
||||
@@ -18,14 +18,14 @@ namespace Core.Settings
|
||||
float MaxBeltSpeed { get; }
|
||||
AnimationCurve SpeedCurve { get; }
|
||||
|
||||
// Item Pools
|
||||
GarbageItemDefinition[] GarbageItems { get; }
|
||||
// Item Pools - Arrays of prefabs
|
||||
GameObject[] NormalCardPrefabs { get; }
|
||||
GameObject[] RareCardPrefabs { get; }
|
||||
GameObject[] LegendaryCardPrefabs { get; }
|
||||
GameObject[] GarbagePrefabs { get; }
|
||||
|
||||
// Spawn Weights
|
||||
float NormalCardWeight { get; }
|
||||
float RareCardWeight { get; }
|
||||
float LegendCardWeight { get; }
|
||||
float GarbageWeight { get; }
|
||||
// Spawn Ratio (0 = all garbage, 1 = all cards)
|
||||
float CardToGarbageRatio { get; }
|
||||
|
||||
// Scoring
|
||||
int CorrectSortPoints { get; }
|
||||
|
||||
Reference in New Issue
Block a user