// Update is called once per frame
    void Update()
    {
        if (controller.getController().GetButtonDown("Interact") && interactObj != null)
        {
            interactObj.interact(actionCode);
            interacted = true;
        }

        if (controller.getController().GetButtonDown("Accuse") && interactObj.GetComponent <infoProvider>() != null)
        {
            bool result = interactObj.GetComponent <infoProvider>().accuse();
            if (!result)
            {
                Debug.Log("u are caught");
                actionCode = -1;
                hint.hide();
                player.gameObject.SetActive(false);
            }
        }

        if (actionCode != -1 && interactObj == null)
        {
            actionCode = -1;
            hint.hide();
        }
    }
    // Update is called once per frame
    void Update()
    {
        playerCon = player.getController();

        float viewHorizontal = playerCon.GetAxis("View Horizontal");

        Vector3 factor = new Vector3(offset.x * transform.forward.x, offset.y, offset.z * transform.forward.z);

        transform.position = player.gameObject.transform.position + factor;

        this.transform.RotateAround(player.transform.position, Vector3.up, viewHorizontal * 360 * Time.deltaTime);
    }
示例#3
0
    public void Resume()
    {
        controller.getController().controllers.maps.LoadMap(ControllerType.Joystick, controller.controllerID, "PauseMenu", "default", false);
        controller.getController().controllers.maps.LoadMap(ControllerType.Joystick, controller.controllerID, "default", "default", true);
        pauseMenuUI.SetActive(false);

        Time.timeScale = 1f;
        GameIsPaused   = false;
    }
示例#4
0
 // Update is called once per frame
 void Update()
 {
     controller = GetComponent <playerMovement2>();
     if (controller.getController().GetButtonDown("Pause"))
     {
         if (GameIsPaused)
         {
             Resume();
         }
         else
         {
             Pause();
         }
     }
 }