void SetInput()
    {
        if (cubeIsLocked)
        {
            bool successful = false;

            if (Input.GetKeyDown(KeyCode.D))
            {
                simulator.SetInput(Int32.Parse(markedCube.name), ControlInput.Forward);
                successful = true;
            }
            else if (Input.GetKeyDown(KeyCode.A))
            {
                simulator.SetInput(Int32.Parse(markedCube.name), ControlInput.Backward);
                successful = true;
            }
            else if (Input.GetKeyDown(KeyCode.Space))
            {
                simulator.SetInput(Int32.Parse(markedCube.name), ControlInput.Jump);
                successful = true;
            }

            if (successful)
            {
                markedCube.unhover();
                markedCube   = null;
                cubeIsLocked = false;
            }
        }
    }
    void SendRay()
    {
        if (!cubeIsLocked)
        {
            Ray        ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0));
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit, 2))
            {
                TimeFrameController controller = hit.collider.gameObject.GetComponent <TimeFrameController>();

                if (controller != null && !controller.locked)
                {
                    if (markedCube != controller)
                    {
                        if (markedCube != null)
                        {
                            markedCube.unhover();
                        }
                        controller.hover();
                        markedCube = controller;
                    }
                    return;
                }
            }

            if (markedCube != null)
            {
                markedCube.unhover();
                markedCube = null;
            }
        }
    }
 // Use this for initialization
 void Start()
 {
     movementController = new MovementController(GetComponent <Rigidbody>(), transform.GetChild(0));
     markedCube         = null;
     cubeIsLocked       = false;
     movementActive     = true;
     simulator          = gameController.GetComponent <GameController>().simulator;
 }
 void CubeSelection()
 {
     if (Input.GetMouseButtonDown(0) && markedCube != null)
     {
         if (cubeIsLocked)
         {
             markedCube.unhover();
             markedCube   = null;
             cubeIsLocked = false;
         }
         else
         {
             markedCube.mark();
             cubeIsLocked   = true;
             movementActive = false;
         }
     }
 }