if (UGameplayStatics::GetPlayerController(GetWorld(), 0)->IsInputKeyDown(EKeys::One))
KeyOnePressed();
if (UGameplayStatics::GetPlayerController(GetWorld(), 0)->IsInputKeyDown(EKeys::Two))
KeyTwoPressed();
if (UGameplayStatics::GetPlayerController(GetWorld(), 0)->IsInputKeyDown(EKeys::Three))
KeyThreePressed();
if (UGameplayStatics::GetPlayerController(GetWorld(), 0)->IsInputKeyDown(EKeys::Four))
KeyFourPressed();
}
void APlayer::KeyFourPressed()
{
// Добавьте имя следующего уровня после "ExampleLevel"
UGameplayStatics::OpenLevel(this, "ExampleLevel", false);
}
class CSharpLanguage
{
public string Version {get;set;}
}using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Player : MonoBehaviour
{
[SerializeField] KeyCode keyOne;
[SerializeField] KeyCode keyTwo;
[SerializeField] KeyCode keyFree;
[SerializeField] KeyCode keyFour;
[SerializeField] Vector3 moveDirection;