コード例 #1
0
ファイル: PacketSender.cs プロジェクト: evanmalmud/Nitrox
        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);
        }
コード例 #2
0
ファイル: Item.cs プロジェクト: PlayTerik/Nitrox
        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);
        }