Saving Loadouts
Added entity save option to the inventory panel dropdown
This commit is contained in:
parent
8d6770ab15
commit
b4432b7aca
18 changed files with 192 additions and 103 deletions
|
|
@ -87,6 +87,47 @@ public class Int2Formatter : MessagePack.Formatters.IMessagePackFormatter<int2>
|
|||
}
|
||||
}
|
||||
|
||||
public class Bool2Formatter : MessagePack.Formatters.IMessagePackFormatter<bool2>
|
||||
{
|
||||
public void Serialize(ref MessagePackWriter writer, bool2 value, MessagePackSerializerOptions options)
|
||||
{
|
||||
writer.WriteArrayHeader(2);
|
||||
writer.Write(value.x);
|
||||
writer.Write(value.y);
|
||||
}
|
||||
|
||||
public bool2 Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options)
|
||||
{
|
||||
if (reader.IsNil)
|
||||
{
|
||||
throw new InvalidOperationException("typecode is null, struct not supported");
|
||||
}
|
||||
|
||||
var length = reader.ReadArrayHeader();
|
||||
var x = default(bool);
|
||||
var y = default(bool);
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
var key = i;
|
||||
switch (key)
|
||||
{
|
||||
case 0:
|
||||
x = reader.ReadBoolean();
|
||||
break;
|
||||
case 1:
|
||||
y = reader.ReadBoolean();
|
||||
break;
|
||||
default:
|
||||
reader.Skip();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var result = bool2(x, y);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public class Float3Formatter : MessagePack.Formatters.IMessagePackFormatter<float3>
|
||||
{
|
||||
public void Serialize(ref MessagePackWriter writer, float3 value, MessagePackSerializerOptions options)
|
||||
|
|
|
|||
Loading…
Reference in a new issue