private void RemoveExistingSyncScripts(GameObject gameObject) { SyncedMultiplayerObject smo = gameObject.GetComponent <SyncedMultiplayerObject>(); if (smo != null) { UnityEngine.Object.Destroy(smo); } }
public void DropItem(GameObject gameObject, TechType techType, Vector3 dropPosition) { String guid = GuidHelper.GetGuid(gameObject); SyncedMultiplayerObject.ApplyTo(gameObject); Console.WriteLine("Dropping item with guid: " + guid); DroppedItem droppedItem = new DroppedItem(PlayerId, guid, ApiHelper.TechType(techType), ApiHelper.Vector3(dropPosition)); Send(droppedItem); }
public void Dropped(GameObject gameObject, TechType techType, Vector3 dropPosition) { Optional <String> waterpark = GetCurrentWaterParkGuid(); String guid = GuidHelper.GetGuid(gameObject); byte[] bytes = SerializationHelper.GetBytes(gameObject); SyncedMultiplayerObject.ApplyTo(gameObject); Log.Debug("Dropping item with guid: " + guid); DroppedItem droppedItem = new DroppedItem(packetSender.PlayerId, guid, waterpark, techType, dropPosition, bytes); packetSender.Send(droppedItem); }