Power Control script
Following is the code for the power control script. I’ve annotated it more with an eye towards beginning/intermediate Unity users than anything else. At the least, bits of it won’t make sense without some grasp of C#/.NET conventions.