Пример #1
0
    new void Start()
    {
        //rb = GetComponent<Rigidbody>();
        controller        = GetComponent <CharacterController>();
        playerCurrentRoom = "";
        playerRoomCheck   = "";

        /*horizontalAxis = "POnHorizontal";
         * verticalAxis = "POnVertical";
         * jump = "POnJump";
         * interact = "Button On";*/
        horizontalAxis = PlayerInputTranslator.GetHorizontalAxis(Player.ON);
        verticalAxis   = PlayerInputTranslator.GetVerticalAxis(Player.ON);
        jump           = PlayerInputTranslator.GetJump(Player.ON);
        interact       = PlayerInputTranslator.GetLeftInteract(Player.ON);
        reset          = PlayerInputTranslator.GetReset(Player.ON);
        pickUp         = PlayerInputTranslator.GetPickup(Player.ON);
        base.Start();
    }
Пример #2
0
    new void Start()
    {
        //rb = GetComponent<Rigidbody>();
        controller        = GetComponent <CharacterController>();
        playerCurrentRoom = "";
        playerRoomCheck   = "";

        /*horizontalAxis = "POffHorizontal";
         * verticalAxis = "POffVertical";
         * jump = "POffJump";
         * interact = "Button Off";*/
        horizontalAxis = PlayerInputTranslator.GetHorizontalAxis(Player.OFF);
        verticalAxis   = PlayerInputTranslator.GetVerticalAxis(Player.OFF);
        jump           = PlayerInputTranslator.GetJump(Player.OFF);
        interact       = PlayerInputTranslator.GetRightInteract(Player.OFF);
        reset          = PlayerInputTranslator.GetReset(Player.OFF);
        pickUp         = PlayerInputTranslator.GetPickup(Player.OFF);

        base.Start();

        //animator.SetBool("PlayerOff", true);
    }
Пример #3
0
    // Update is called once per frame
    void Update()
    {
        //if (!LevelController.gameGoing()) return;

        try
        {
            if (Input.GetButton(PlayerInputTranslator.GetLeftInteract(Player.ON)))
            {
                if (Time.time - lastPressedOn > pressThreshold)
                {
                    OnInteract(Parameters.OnPlayer);
                    lastPressedOn = Time.time;
                }
            }
            if (Input.GetButton(PlayerInputTranslator.GetLeftInteract(Player.OFF)))
            {
                if (Time.time - lastPressedOn > pressThreshold)
                {
                    Parameters.OffPlayer.GetComponent <Animator>().SetTrigger("Use Wrong Arm");
                }
            }
            if (Input.GetButton(PlayerInputTranslator.GetRightInteract(Player.OFF)))
            {
                if (Time.time - lastPressedOff > pressThreshold)
                {
                    OnInteract(Parameters.OffPlayer);
                    lastPressedOff = Time.time;
                }
            }
            if (Input.GetButton(PlayerInputTranslator.GetRightInteract(Player.ON)))
            {
                if (Time.time - lastPressedOn > pressThreshold)
                {
                    Parameters.OnPlayer.GetComponent <Animator>().SetTrigger("Use Wrong Arm");
                }
            }

            if ((Input.GetButton(PlayerInputTranslator.GetMenu(Player.ON)) || Input.GetButton(PlayerInputTranslator.GetMenu(Player.OFF))) ||
                (LevelController.InMenue && (Input.GetButton(PlayerInputTranslator.GetPickup(Player.ON)) || Input.GetButton(PlayerInputTranslator.GetPickup(Player.OFF))))
                )
            {
                if ((DateTime.Now - lastPressedOnMenue).TotalSeconds > pressThresholdMenue)
                {
                    LevelController.ToggleMenue();
                    lastPressedOnMenue = DateTime.Now;
                }
            }


            if (Input.GetButtonUp(PlayerInputTranslator.GetDismiss(Player.ON)) || Input.GetButtonUp(PlayerInputTranslator.GetDismiss(Player.OFF)))
            {
                print("y");
                hudController.DismissDialogue();
                npc.Dismiss();
            }

            /*
             *          if (Input.GetButton(PlayerInputTranslator.GetMenu(Player.OFF)))
             *          {
             *                  if (Time.time - lastPressedOffMenue > pressThresholdMenue)
             *                  {
             *                          LevelController.ToggleMenue();
             *                          lastPressedOffMenue = Time.time;
             *                  }
             *          }*/
        }
        catch (System.NullReferenceException)
        {
            ;
        }
    }