Switch between editor and player, fixed some data read/write