Q1: invoking simpleTrace method, cause a "server terminated" crash.
Q2: invoking get_WeaponType method, cause an "access violation" error.
public class TestScene : MonoBehaviour
{
public Text infoText;
private byte[] gameDataWhateverBytes = { 28, 0, 0, 0, 87, 72, 65, 84, 20, 0, 28, 0, 12, 0, 0, 0, 0, 0, 24, 0, 0, 0, 11, 0, 10, 0, 4, 0, 20, 0, 0, 0, 76, 0, 0, 0, 0, 0, 1, 1, 0, 0, 128, 63, 0, 0, 0, 64, 0, 0, 128, 63, 4, 0, 0, 0, 37, 0, 0, 0, 84, 101, 115, 116, 32, 83, 116, 114, 105, 110, 103, 32, 33, 32, 116, 105, 109, 101, 58, 32, 50, 48, 50, 49, 47, 56, 47, 50, 32, 49, 53, 58, 49, 52, 58, 51, 56, 0, 0, 0, 8, 0, 12, 0, 8, 0, 6, 0, 8, 0, 0, 0, 0, 0, 231, 3, 123, 0, 0, 0 };
public void OnBtnReadFromMemory()
{
ReadClassFromMemory();
}
void ReadClassFromMemory()
{
ByteBuffer bb = new ByteBuffer(gameDataWhateverBytes);
GameDataWhatever data = GameDataWhatever.GetRootAsGameDataWhatever(bb);
infoText.text = String.Format("type: {0}\n xyz: ({1},{2},{3})",
data.WeaponType, data.Pos.Value.X, data.Pos.Value.Y, data.Pos.Value.Z);
}
}