Here is the code if anyone is interested: https://github.com/dtoillion/ECGJ3-Cycles/tree/master/Assets/_Scripts