// Update is called once per frame
    void Update()
    {
        if (isMine == false && PhotonNetwork.connected == true)
        {
            return;
        }

        if (Input.GetKeyDown("b"))
        {
            if (BuildConfirm)
            {
                raycast.Confirm();
                BuildConfirm = false;
            }
            else
            {
                raycast.SetObjPropect(pretourelle);
                raycast.SetObj(tourelle);
                BuildConfirm = true;
            }
        }
        if (Input.GetKeyDown("r"))
        {
            if (BuildConfirm)
            {
                curretTurret = curretTurret - 1;
                if (curretTurret < 0)
                {
                    curretTurret = AvailableTurrets.Count - 1;
                }
                raycast.Cancel();
                tourelle    = (GameObject)Resources.Load(AvailableTurrets [curretTurret]);
                pretourelle = (GameObject)Resources.Load(AvailableTurrets [curretTurret] + "Preview");
                raycast.SetObjPropect(pretourelle);
                raycast.SetObj(tourelle);
            }
        }

        if (Input.GetKeyDown("t"))
        {
            if (BuildConfirm)
            {
                curretTurret = curretTurret + 1;
                if (curretTurret >= AvailableTurrets.Count)
                {
                    curretTurret = 0;
                }
                raycast.Cancel();
                tourelle    = (GameObject)Resources.Load(AvailableTurrets [curretTurret]);
                pretourelle = (GameObject)Resources.Load(AvailableTurrets [curretTurret] + "Preview");
                raycast.SetObjPropect(pretourelle);
                raycast.SetObj(tourelle);
            }
        }
        if (Input.GetKey("q"))
        {
            if (BuildConfirm)
            {
                raycast.LeftRotate();
            }
        }
        if (Input.GetKey("e"))
        {
            if (BuildConfirm)
            {
                raycast.RightRotate();
            }
        }
        if (Input.GetKey(KeyCode.Escape))
        {
            raycast.Cancel();
            BuildConfirm = false;
        }

        if (Input.GetButton("CenterCam")) //CenterCam = x
                                          //La touche L dans TLoZelda. Pas trouver d'autre examples #Thetoto.
        {
            camscript.LookPlayer(player.transform.rotation.eulerAngles.y, 15f);
        }
    }