PRU212_-_SP_2025_-_FE_3546.webp
M

PRU212_-_SP_2025_-_FE_3546.webp

  • Media owner myhong87
  • Ngày thêm
Kizspy | Question: 39
(Choose 1 answer)
Given the following C# code in Unity, what action is performed when the Space key is pressed (the lines of
code are in Update method)?
if (Input.GetKeyDown(KeyCode. Space))
{
Debug.Log("Jump");
else if (Input.GetKeyDown(KeyCode.LeftShift))
Debug.Log("Run");
else
Debug.Log("Idle");
A. Prints "Jump" when the Space key is pressed, "Run" when the LeftShift key is pressed, and "Idle" when
nothing is pressed.
B. Only prints "Jump" when the Space key is pressed and does nothing for other keys.
C. Prints "Idle" regardless of which key is pressed.
D. Prints "Jump" when the Space key is pressed and "Idle" in all other cases.

Thông tin

Category
PRU212
Thêm bởi
myhong87
Ngày thêm
Lượt xem
4,890
Lượt bình luận
28
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom