Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages