mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Added Serializable and SerializeField
This commit is contained in:
parent
7011fade2d
commit
98652e708f
@ -22,17 +22,20 @@ To use it, create a class that derives from SyncDictionary for your specific typ
|
||||
using UnityEngine;
|
||||
using Mirror;
|
||||
|
||||
[System.Serializable]
|
||||
public struct Item
|
||||
{
|
||||
public string name;
|
||||
public int hitPoints;
|
||||
public int durability;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class SyncDictionaryStringItem : SyncDictionary<string, Item> {}
|
||||
|
||||
public class ExamplePlayer : NetworkBehaviour
|
||||
{
|
||||
public class SyncDictionaryStringItem : SyncDictionary<string, Item> {}
|
||||
|
||||
public struct Item
|
||||
{
|
||||
public string name;
|
||||
public int hitPoints;
|
||||
public int durability;
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
public readonly SyncDictionaryStringItem Equipment = new SyncDictionaryStringItem();
|
||||
|
||||
public override void OnStartServer()
|
||||
|
Loading…
Reference in New Issue
Block a user