<commit_before>﻿using UnityEngine;
using System.Collections;

public class Camera1D : MonoBehaviour {

    private GameObject[] computers;
    private Transform start;
    private Transform end;
    private float speed = 0.5f;
    private float startTime;
    private float journeyLength;
    private StateManager stateManager;
    private Vector3 targetOffset = new Vector3(-0.05f, 0.3f, 0f);

	// Use this for initialization
	void Start () {
        computers = GameObject.FindGameObjectsWithTag("Computer");
        stateManager = GameObject.FindGameObjectWithTag("StateManager").GetComponent<StateManager>();
	}
	
	// Update is called once per frame
	void Update () {
	    if (stateManager.IsEntering())
        {
            float distCovered = (Time.time - startTime) * speed;
            float fracJourney = distCovered / journeyLength;
            transform.position = Vector3.Lerp(start.position, (end.position + targetOffset), fracJourney);

            if (transform.position == end.position)
            {
                Application.LoadLevel(3);
            }
        }
	}

    public void EnterTheMatrix()
    {

        foreach(GameObject computer in computers)
        {
            computer.transform.renderer.material.color = Color.black;
        }

        stateManager.EnterTheMatrix();
        int random = Random.Range(0, computers.Length);

        start = transform;
        end = computers[random].transform;

        startTime = Time.time;
        journeyLength = Vector3.Distance(start.position, end.position);
    }
}<commit_msg>D1 Updated camera.<commit_after>﻿using UnityEngine;
using System.Collections;

public class Camera1D : MonoBehaviour {

    private GameObject[] computers;
    private Transform start;
    private Transform end;
    private float speed = 0.5f;
    private float startTime;
    private float journeyLength;
    private StateManager stateManager;
    private Vector3 targetOffset = new Vector3(-0.05f, 0.3f, 0f);

	// Use this for initialization
	void Start () {
        computers = GameObject.FindGameObjectsWithTag("Computer");
        stateManager = GameObject.FindGameObjectWithTag("StateManager").GetComponent<StateManager>();
	}
	
	// Update is called once per frame
	void Update () {
	    if (stateManager.IsEntering())
        {
            float distCovered = (Time.time - startTime) * speed;
            float fracJourney = distCovered / journeyLength;
            transform.position = Vector3.Lerp(start.position, (end.position + targetOffset), fracJourney);

            if (((end.position + targetOffset) - transform.position).sqrMagnitude < 0.05)
            {
                Application.LoadLevel(3);
            }
        }
	}

    public void EnterTheMatrix()
    {

        foreach(GameObject computer in computers)
        {
            computer.transform.renderer.material.color = Color.black;
        }

        stateManager.EnterTheMatrix();
        int random = Random.Range(0, computers.Length);

        start = transform;
        end = computers[random].transform;

        startTime = Time.time;
        journeyLength = Vector3.Distance(start.position, end.position);
    }
}
{'fraction_non_alphanumeric': 0.09559987337765116, 'fraction_numerical': 0.010762899651788541, 'mean_word_length': 2.546576879910213, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, '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': '2101862', 'n_tokens_mistral': 872, 'n_tokens_neox': 829, 'n_words': 200}