Exemple #1
0
    private void FixedUpdate()
    {
        var x = Input.GetAxis(verKey) * Time.deltaTime * verSpeed;
        var y = Input.GetAxis(horKey) * Time.deltaTime * horSpeed;

        transform.Translate(x, 0, 0);
        transform.Rotate(0, y, 0);

        if (Input.GetKeyDown(fireKey))
        {
            //Shoot local
            CmdFire();

            //Broadcast shoot
            online.BroadcastAction("Fire");
        }

        if (Input.GetKeyDown(bombKey) && bombs > 0)
        {
            //Shoot local
            CmdBomb();

            //Broadcast shoot
            online.BroadcastAction("Bomb");
        }
    }