Skip to content

Instantly share code, notes, and snippets.

View meredoth's full-sized avatar
🏠
Working from home

Giannis Akritidis meredoth

🏠
Working from home
View GitHub Profile
@meredoth
meredoth / LootProbabilities.cs
Last active September 13, 2024 15:31
An example of a loot probabilities table based on Unity's Animation and Min Max Curves. Check the explanation post (https://giannisakritidis.com/blog/Animation-And-Min-Max-Curves-In-Unity/)
public class LootProbabilities : MonoBehaviour
{
private const int MAX_LEVEL = 20;
private const float MAX_RARITY = 10;
[SerializeField] private ParticleSystem.MinMaxCurve lootRarityPerLevel;
[SerializeField] private AnimationCurve probabilitiesDistribution;
[ReadOnly, SerializeField] private LevelProbabilities[] probabilitiesPerLevel;