void Awake() { view = GetComponent <NetView>(); character = GetComponent <Character>(); character.id = IDManager.GenerateId(); view.OnWriteProxyData += OnWriteInstantiate; view.OnWriteCreatorData += OnWriteInstantiate; view.OnWritePeerData += OnWriteInstantiate; view.OnWriteSync += OnWriteSync; view.OnReadInstantiateData += OnReadInstantiate; }
void Awake() { View = GetComponent <NetView>(); inventory = GetComponent <Inventory>(); equipment = GetComponent <Equipment>(); character = GetComponent <Character>(); character.id = IDManager.GenerateId(); inventory.OnItemAdd += OnItemAdded; inventory.OnItemRemove += OnItemRemoved; equipment.OnEquip += OnEquipped; View.OnWriteOwnerData += WriteOwnerData; View.OnWriteProxyData += WriteInstantiateData; View.OnWritePeerData += WriteInstantiateData; View.OnWriteCreatorData += WriteOwnerData; View.OnReadInstantiateData += ReadInstantiateData; }