Skip to content

Commit

Permalink
feat: implement half precision
Browse files Browse the repository at this point in the history
  • Loading branch information
insthync committed Feb 10, 2025
1 parent 51d7e0d commit 6c1e0d5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Scripts/GameApi/LiteNetLibSyncField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -753,5 +753,32 @@ protected override bool IsValueChanged(DirectionVector3 newValue)
return Value.x != newValue.x || Value.y != newValue.y || Value.z != newValue.z;
}
}

[Serializable]
public class SyncFieldHalfPrecision : LiteNetLibSyncField<HalfPrecision>
{
protected override bool IsValueChanged(HalfPrecision newValue)
{
return Value.halfValue != newValue.halfValue;
}
}

[Serializable]
public class SyncFieldHalfVector2 : LiteNetLibSyncField<HalfVector2>
{
protected override bool IsValueChanged(HalfVector2 newValue)
{
return Value.x != newValue.x || Value.y != newValue.y;
}
}

[Serializable]
public class SyncFieldHalfVector3 : LiteNetLibSyncField<HalfVector3>
{
protected override bool IsValueChanged(HalfVector3 newValue)
{
return Value.x != newValue.x || Value.y != newValue.y || Value.z != newValue.z;
}
}
#endregion
}

0 comments on commit 6c1e0d5

Please sign in to comment.