Skip to content

Instantly share code, notes, and snippets.

@ppolsinelli
Created August 13, 2018 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ppolsinelli/2b72c398abf80eb1fac22aaeb6eaa1d7 to your computer and use it in GitHub Desktop.
Save ppolsinelli/2b72c398abf80eb1fac22aaeb6eaa1d7 to your computer and use it in GitHub Desktop.
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