Example #1
0
        private void RemoveExistingSyncScripts(GameObject gameObject)
        {
            SyncedMultiplayerObject smo = gameObject.GetComponent <SyncedMultiplayerObject>();

            if (smo != null)
            {
                UnityEngine.Object.Destroy(smo);
            }
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }