Here's the simple method I worked out to make this easy:
1. Declare bools as normal in NinjaScript. Use them as normal. Too easy!
private bool MyFavouritebool = false ; // Just a normal bool
2. In the Properties region, declare bools as follows:
// Pseudo-bool -- 0 is false, 1 is true.
public int _MyFavouritebool
{
get { return MyFavouritebool ? 1 : 0 ; }
set { MyFavouritebool = value % 2 == 1 ? true : false ; }
}
3. Set the parameter value to 0 for false and 1 for true. This makes optimization with bools simple. To leave the bool as false, use 0;0;1. To leave it as true, use 1;1;1. To optimize using the bool as false, then true, use 0;1;1.
I hope you find this useful.
Cheers.
Comment