Skip to content

Instantly share code, notes, and snippets.

@ppolsinelli

ppolsinelli/PreserveSOSample.cs Secret

Created Aug 13, 2018
Embed
What would you like to do?
Preserve production values in Scriptable Objects
public class EndogenousLikelyhoods : ScriptableObject
{
...
[DeRange(0, 1)]
[SerializeField]
float ChanceOfGoalProduction;
[DeRange(0, 1)]
[SerializeField]
float ChanceOfGoalDevelopment;
public float ChanceOfGoal()
{
if ([check your production criteria])
{
return ChanceOfGoalProduction;
}
else
{
return ChanceOfGoalDevelopment;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.