public override void Process(ItemPosition drop)
        {
            Optional <GameObject> opItem = GuidHelper.GetObjectFrom(drop.Guid);

            if (opItem.IsPresent())
            {
                MovementHelper.MoveGameObject(opItem.Get(), ApiHelper.Vector3(drop.Position), ApiHelper.Quaternion(drop.Rotation), ITEM_TRANSFORM_SMOOTH_PERIOD);
            }
        }
Example #2
0
        public override void Process(VehicleMovement vehicleMovement)
        {
            playerGameObjectManager.HidePlayerGameObject(vehicleMovement.PlayerId);

            Optional <GameObject> opGameObject = GuidHelper.GetObjectFrom(vehicleMovement.Guid);

            if (opGameObject.IsEmpty())
            {
                opGameObject = CreateVehicle(vehicleMovement.TechType, vehicleMovement.Guid);

                if (opGameObject.IsEmpty())
                {
                    return;
                }

                GuidHelper.SetNewGuid(opGameObject.Get(), vehicleMovement.Guid);
            }

            GameObject gameObject = opGameObject.Get();
            Vector3    position   = ApiHelper.Vector3(vehicleMovement.PlayerPosition);
            Quaternion rotation   = ApiHelper.Quaternion(vehicleMovement.Rotation);

            MovementHelper.MoveGameObject(gameObject, position, rotation, VEHICLE_TRANSFORM_SMOOTH_PERIOD);
        }