-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotes_0
26 lines (22 loc) · 1.43 KB
/
Notes_0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Configurar el componente Sensor como RootComponent
Sensor = CreateDefaultSubobject<UBoxComponent>(TEXT("Sensor"));
RootComponent = Sensor;
Sensor->InitBoxExtent(FVector(50.0f, 50.0f, 50.0f)); // Configurar tamaño del sensor
// Añadir delegado para el evento de colisión
Sensor->OnComponentBeginOverlap.AddDynamic(this, &AWeaponBase::OnOverlapBegin);
// Crear el componente Skeletal Mesh y adjuntarlo al sensor
WeaponMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("WeaponMesh"));
WeaponMesh->SetupAttachment(Sensor);
// Crear el componente Arrow para el punto de inicio del disparo
FirePoint = CreateDefaultSubobject<UArrowComponent>(TEXT("FirePoint"));
FirePoint->SetupAttachment(WeaponMesh);
FirePoint->SetRelativeLocation(FVector(0.0f, 80.0f, 10.0f)); // Ajustar la posición del Arrow
FirePoint->SetRelativeRotation(FRotator(0.0f, 90.f, 0.0f)); // Ajustar la rotación del arrow
// Crear el componente Arrow para el punto de salida de casquillos
ShellCasingPoint = CreateDefaultSubobject<UArrowComponent>(TEXT("ShellCasingPoint"));
ShellCasingPoint->SetupAttachment(WeaponMesh);
ShellCasingPoint->SetRelativeLocation(FVector(3.0f, 30.0f, 10.0f)); // Ajustar la posición del Arrow
ShellCasingPoint->SetRelativeRotation(FRotator(20.0f, 180.f, 0.0f)); // Ajustar la rotación del arrow
// Inicializar las variables
WeaponType = EWeaponTypeEnum::EWT_None;
CurrentAmmo = 0;