Skip to main content

ChanceOperation

A class in Root.Township, Alta.Intelligence.

Prefab component that adds a Chance scoring rule to its action, from the scoring child object it sits under. Renames its GameObject to show its values.

Constructors​

MemberWhat it is
ChanceOperation()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

4 private and internal fields
MemberWhat it is
private float chanceProbability of success (default 0.5).
private float failValue on a failed roll (default 0).
private float multiplierWeight of the rule. Only matters for preferred rules.
private float successValue on a successful roll (default 1).

Methods​

MemberWhat it is
override TargetOperation GetOperation()Makes the Chance rule with these values and multiplier as its weight.
protected override string GetName()Builds the GameObject name, like Chance 0.5 ? 1 : 0 (x1).