updated example code

This commit is contained in:
Chris Langsenkamp 2020-02-06 19:32:18 -05:00
parent c06ea6b6c8
commit 626f084a87

View File

@ -46,7 +46,7 @@ public class PlayerEquip : NetworkBehaviour
[SyncVar(hook = nameof(OnChangeEquipment))]
public EquippedItem equippedItem;
void OnChangeEquipment(EquippedItem newEquippedItem)
void OnChangeEquipment(EquippedItem oldEquippedItem, EquippedItem newEquippedItem)
{
StartCoroutine(ChangeEquipment(newEquippedItem));
}
@ -166,7 +166,7 @@ public class SceneObject : NetworkBehaviour
public GameObject boxPrefab;
public GameObject cylinderPrefab;
void OnChangeEquipment(EquippedItem newEquippedItem)
void OnChangeEquipment(EquippedItem oldEquippedItem, EquippedItem newEquippedItem)
{
StartCoroutine(ChangeEquipment(newEquippedItem));
}