Esempio n. 1
0
    private void Update()
    {
        if (photonView.IsMine == false && PhotonNetwork.IsConnected == true)
        {
            return;
        }
        if (IsSomethingCarryUp && !PickupObject)
        {
            PickUpLost();
        }
        if (IsSomethingCarryUp && (Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown("joystick button 2")))
        {
            PutDown();
        }
        else if (!IsSomethingCarryUp && (Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown("joystick button 2")))
        {
            PickUp(GetNearestInteractable(pickUpManager.GetListInteractable()));
        }
        if (!IsSomethingCarryUp && (Input.GetKeyDown(KeyCode.R) || Input.GetKeyDown("joystick button 3")))
        {
            GameObject closer = GetNearestInteractable(pickUpManager.GetListSwitch());

            closer.GetComponent <RunePillar>().SetIsActive();
            Debug.Log("Switch");
        }
    }