Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.37 KB

README.md

File metadata and controls

54 lines (36 loc) · 1.37 KB

ChanceEditor

Makes it easier to manage the randomness in the inspector

Percantage Attribute

Displays the percentages in the inspector.

  [Percantage]
  [SerializeField] private float _chance;

Percentages in the inspector

PercentagesExtension

ToPercentages()

[float value].ToPercentages()
Parameter Type Description
value float A value from 0 to 1 is required.

ToProbability()

[int value].ToProbability()
Parameter Type Description
value int A value from 0 to 100 is required.

Chance Wrapper

Wraps a serializable value in a wrapper with a manageable chance.

[SerializeField] private List<ChanceWrapper<GameObject>> _chanceObjects;

public void TrySetActive()
    => _chanceObjects.ForEach(wrapper
        => wrapper.Value.SetActive(wrapper.Calculate()));
Generic Type Description
T The original value.

wrapper inspector