private void ApplyData(ObstacleData data, ObstacleDataContainer dataContainer)
        {
            ApplyIndividualObstacleData(data, ObstacleData.ObstacleSide.Left, dataContainer.leftSide);
            ApplyIndividualObstacleData(data, ObstacleData.ObstacleSide.Right, dataContainer.rightSide);

            data.SetupParent(dataContainer.parentBoundsLocation, dataContainer.parentLockedAxis,
                             dataContainer.moveDirection, dataContainer.moveDistancePerSecond);
        }
        /// <summary>
        /// Build ObstacleDataContainer for a vertical obstacle.
        /// </summary>
        public override ObstacleDataContainer Build()
        {
            ObstacleDataContainer container = GetDefaultContainer();

            container.moveDistancePerSecond = Random.Range(MIN_MAX_MOVEMENT_SPEED.x, MIN_MAX_MOVEMENT_SPEED.y);
            SetScale(ref container.leftSide, ref container.rightSide);

            return(container);
        }
        protected override ObstacleDataContainer GetDefaultContainer()
        {
            var container = new ObstacleDataContainer();

            container.moveDirection        = moveDirection;
            container.parentBoundsLocation = boundsLocation;
            container.parentLockedAxis     = Axis.X;

            container.leftSide.lockedScaleSide = Side.None;
            container.leftSide.boundsLocation  = BoundsLocation.Left;
            container.leftSide.lockedAxis      = Axis.None;


            container.rightSide.lockedScaleSide = Side.None;
            container.rightSide.boundsLocation  = BoundsLocation.Right;
            container.rightSide.lockedAxis      = Axis.None;

            return(container);
        }
        protected override ObstacleDataContainer GetDefaultContainer()
        {
            var container = new ObstacleDataContainer();

            container.moveDirection        = moveDirection;
            container.parentBoundsLocation = boundsLocation;
            container.parentLockedAxis     = Axis.Y;

            container.leftSide.lockedScaleSide   = Side.None;
            container.leftSide.boundsLocation    = BoundsLocation.Top;
            container.leftSide.lockedAxis        = Axis.None;
            container.leftSide.basedOnHeightOnly = true;

            container.rightSide.lockedScaleSide   = Side.None;
            container.rightSide.boundsLocation    = BoundsLocation.Bottom;
            container.rightSide.lockedAxis        = Axis.None;
            container.rightSide.basedOnHeightOnly = true;

            return(container);
        }