コード例 #1
0
ファイル: KeyDoor.cs プロジェクト: nolamus/Killer-Among-Us
 // Update is called once per frame
 void Update()
 {
     //Debug.Log("Lvl2Tracker = " + je_Door.Lvl2KeyTracker.ToString());
     if (Input.GetButtonDown("Submit") && NoKeyDoor.IsTouching(playerCollider))
     {
         //Debug.Log("GameObject2 collided with " + playerCollider.name);
         OpenLevelDoor();
     }
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: ThatVoidUpdate/QuickRush
    // Update is called once per frame
    void FixedUpdate()
    {
        //rb.MovePosition(transform.position + new Vector3(Input.GetAxis("Horizontal") * Speed, 0));
        float HorizontalMovement = Input.GetAxis("Horizontal");
        float VerticalMovement   = rb.velocity.y + Time.deltaTime * -9.81f;

        if (Input.GetAxis("Jump") == 1 && collider.IsTouching(collision))
        {
            VerticalMovement = JumpForce;
        }
        rb.velocity = new Vector2(HorizontalMovement * Speed, VerticalMovement);
    }