Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        bool movement = false;

        movement = MoveAxis("Vertical", transform.forward, movement);
        movement = MoveAxis("Horizontal", transform.right, movement);
        movement = MoveAxis("Jump", transform.up, movement);
        MPE.Switch(movement);
        print(movement);
    }
Ejemplo n.º 2
0
    void Update()
    {
        if (!isLocalPlayer)
        {
            return;
        }

        if (TEAM_VIEWER_USED)
        {
            MPETimer += Time.deltaTime;
            if (Sunset.day)
            {
                speed = stats.PlayerSpeed;
                bool moved = false;
                MoveByButton('w', transform.forward, ref moved);
                MoveByButton('d', transform.right, ref moved);
                MoveByButton('a', -transform.right, ref moved);
                MoveByButton('s', -transform.forward, ref moved);
                if (moved)
                {
                    MPE.Switch(on: true);
                    MPETimer = 0;
                }
                else if (MPETimer > 0.5)
                {
                    MPE.Switch(on: false);
                }
                int   sign = Input.mousePosition.x > lastMousePos.x ? 1 : -1;
                float dx   = Vector3.Distance(Input.mousePosition, lastMousePos);
                transform.Rotate(Vector3.up, sign * dx / 10, Space.World);
                lastMousePos = Input.mousePosition;
            }
        }
        else
        {
        }
    }