New Unity & Rift codes

Rewritten as object-oriented