public void read(Reader reader) { switch (type) { case VariableTypes.UINT8: value_uint8 = reader.ReadByte(); break; case VariableTypes.UINT16: value_uint16 = reader.ReadUInt16(); break; case VariableTypes.UINT32: value_uint32 = reader.ReadUInt32(); break; case VariableTypes.INT8: value_int8 = reader.ReadSByte(); break; case VariableTypes.INT16: value_int16 = reader.ReadInt16(); break; case VariableTypes.INT32: value_int32 = reader.ReadInt32(); break; case VariableTypes.ENUM: value_enum = reader.ReadInt32(); break; case VariableTypes.BOOL: value_bool = reader.readBool32(); break; case VariableTypes.STRING: value_string = reader.readRSDKUTF16String(); break; case VariableTypes.VECTOR2: value_vector2.x = reader.ReadInt32(); value_vector2.y = reader.ReadInt32(); break; case VariableTypes.UNKNOWN: value_unknown = reader.ReadInt32(); break; case VariableTypes.COLOR: value_color = new Color(reader); break; } }