Core C# changes for Unity3d and some fixes #5431764503338