Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        float z = 0.0f;

        // Check for input
        if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.A))
        {
            z += 1.0f;
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            lvl.EHQuit();
        }
        if (Input.GetKeyDown(KeyCode.BackQuote))
        {
            lvl.EHRestart();
        }
        if (Input.GetKeyDown(KeyCode.M))
        {
            lvl.EHToggleMute();
        }

        // Update movement vector
        move.x = 0;
        move.z = z;
        move.Normalize();

        Move();
    }