<commit_before>﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
public class UIAnimation : MonoBehaviour {
    public GameObject player;
    public float speed;

    public List<GameObject> menuElements;
    public Vector3[] positions;
    public GameObject firstObject;
    public Vector3 temp;
    float time;
    public bool isRunning;
    // Use this for initialization
    void Start()
    {

    }
	// Update is called once per frame
	void Update () {
        time += Time.deltaTime;

        //player.transform.Rotate(player.transform.up, speed * Time.deltaTime);

       if(Input.GetKeyDown(KeyCode.A))
        {
           
            StartCoroutine("MoveUI");
            isRunning = true;
        }
        if (Input.GetKeyDown(KeyCode.D))
        {


        }
    }

    IEnumerator MoveUI()
    {
        if (!isRunning)
        {
          
            time = 0;
            positions[0] = menuElements[0].transform.position;
            positions[1] = menuElements[1].transform.position;
            positions[2] = menuElements[2].transform.position;
            positions[3] = menuElements[3].transform.position;


            //while (Vector3.Distance(menuElements[0].transform.position, menuElements[1].transform.position) != 0)
            while (Vector3.Distance(menuElements[0].transform.position, positions[1]) > 0.1)
            {
                for (int i = 0; i < 4; i++)
                {
                    menuElements[i % 4].transform.position = Vector3.Lerp(menuElements[i % 4].transform.position, positions[(i + 1) % 4], 10*time * Time.deltaTime);
                }

                yield return null;  
            }
            isRunning = false;
        }
    }
}
<commit_msg>Menu works both ways. Press A or D<commit_after>﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
public class UIAnimation : MonoBehaviour {
    public GameObject player;
    public float speed;

    public List<GameObject> menuElements;
    public Vector3[] positions;
    public GameObject firstObject;
    public Vector3 temp;
    float time;
    public bool isRunning;
    // Use this for initialization
    void Start()
    {

    }
	// Update is called once per frame
	void Update () {
        time += Time.deltaTime;

       if(Input.GetKeyDown(KeyCode.A))
        {
           
            StartCoroutine("MoveUILeft");
            isRunning = true;
        }
        if (Input.GetKeyDown(KeyCode.D))
        {

            StartCoroutine("MoveUIRight");
            isRunning = true;
        }
    }

    IEnumerator MoveUILeft()
    {
        if (!isRunning)
        {
          
            time = 0;
            positions[0] = menuElements[0].transform.position;
            positions[1] = menuElements[1].transform.position;
            positions[2] = menuElements[2].transform.position;
            positions[3] = menuElements[3].transform.position;

            while (Vector3.Distance(menuElements[0].transform.position, positions[1]) > 0.1)
            {
                for (int i = 0; i < 4; i++)
                {
                    menuElements[i % 4].transform.position = Vector3.Lerp(menuElements[i % 4].transform.position, positions[(i + 1) % 4], 10*time * Time.deltaTime);
                }

                yield return null;  
            }
            isRunning = false;
        }
    }
    IEnumerator MoveUIRight()
    {
        if (!isRunning)
        {

            time = 0;
            positions[0] = menuElements[0].transform.position;
            positions[1] = menuElements[1].transform.position;
            positions[2] = menuElements[2].transform.position;
            positions[3] = menuElements[3].transform.position;

            while (Vector3.Distance(menuElements[1].transform.position, positions[0]) > 0.1)
            {
                for (int i = 4; i >0; i--)
                {
                    menuElements[i % 4].transform.position = Vector3.Lerp(menuElements[i % 4].transform.position, positions[(i - 1) % 4], 10 * time * Time.deltaTime);
                }

                yield return null;
            }
            isRunning = false;
        }
    }
}

{'fraction_non_alphanumeric': 0.10961493030947318, 'fraction_numerical': 0.01819040869359792, 'mean_word_length': 1.7928759894459103, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1341564', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1157, 'n_words': 249}