Code changes for Unity3D