mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkIdentity
This commit is contained in:
parent
30afb60eca
commit
c23b0b89c4
@ -140,19 +140,17 @@ public bool isServer
|
|||||||
|
|
||||||
[SerializeField] string m_AssetId;
|
[SerializeField] string m_AssetId;
|
||||||
|
|
||||||
|
// the AssetId trick:
|
||||||
|
// - ideally we would have a serialized 'Guid m_AssetId' but Unity can't
|
||||||
|
// serialize it because Guid's internal bytes are private
|
||||||
|
// - UNET used 'NetworkHash128' originally, with byte0, ..., byte16
|
||||||
|
// which works, but it just unnecessary extra code
|
||||||
|
// - using just the Guid string would work, but it's 32 chars long and
|
||||||
|
// would then be sent over the network as 64 instead of 16 bytes
|
||||||
|
// -> the solution is to serialize the string internally here and then
|
||||||
|
// use the real 'Guid' type for everything else via .assetId
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unique identifier used to find the source assets when server spawns the on clients.
|
/// Unique identifier used to find the source assets when server spawns the on clients.
|
||||||
/// <para>
|
|
||||||
/// the AssetId trick:
|
|
||||||
/// - ideally we would have a serialized 'Guid m_AssetId' but Unity can't
|
|
||||||
/// serialize it because Guid's internal bytes are private
|
|
||||||
/// - UNET used 'NetworkHash128' originally, with byte0, ..., byte16
|
|
||||||
/// which works, but it just unnecessary extra code
|
|
||||||
/// - using just the Guid string would work, but it's 32 chars long and
|
|
||||||
/// would then be sent over the network as 64 instead of 16 bytes
|
|
||||||
/// -> the solution is to serialize the string internally here and then
|
|
||||||
/// use the real 'Guid' type for everything else via .assetId
|
|
||||||
/// </para>
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid assetId
|
public Guid assetId
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user