﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MoveSwimHorizontally : BaseMoveStrategy
{
    [SerializeField]
    bool swimLeft = true;

    [SerializeField]
    bool swimRight = false;

    Vector3 currentSwimDirection;

    // Start is called before the first frame update
    void Start()
    {
        SetCurrentSwimDirection();
    }

    void SetCurrentSwimDirection()
    {
        currentSwimDirection = Vector3.left;

        if (swimLeft == false && swimRight == true)
        {
            currentSwimDirection = Vector3.right;
        }
    }

    public override void Move()
    {
        // Move forward continuously on the x-axis in the current direction
        // Based on the speed
        transform.Translate(currentSwimDirection * speed * Time.deltaTime);
    }
}
