Makes it easier to manage the randomness in the inspector
[Percantage]
[SerializeField] private float _chance;
[float value].ToPercentages()
Parameter | Type | Description |
---|---|---|
value |
float |
A value from 0 to 1 is required. |
[int value].ToProbability()
Parameter | Type | Description |
---|---|---|
value |
int |
A value from 0 to 100 is required. |
[SerializeField] private List<ChanceWrapper<GameObject>> _chanceObjects;
public void TrySetActive()
=> _chanceObjects.ForEach(wrapper
=> wrapper.Value.SetActive(wrapper.Calculate()));
Generic Type | Description |
---|---|
T |
The original value. |