Implemented Vision Links UI Animations
This commit is contained in:
parent
aca63055f3
commit
91052ed5ac
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/RG_VisionLink.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WBP_VisionLinkViewPort.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Gadgets/ReconGadgets/VisionLink/WBP_VisionLinkViewPort.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap
(Stored with Git LFS)
BIN
EndlessVendetta/Content/Levels/GadgetSystemTestLevel.umap
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Architecture/Floor_400x400.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
(Stored with Git LFS)
Binary file not shown.
@ -9,13 +9,9 @@ void AVisionLink::BeginPlay()
|
||||
SetActorTickEnabled(false);
|
||||
CooldownLength = CooldownTime;
|
||||
InUseDuration = GadgetMaxUptime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AVisionLink::Tick(float DeltaSeconds)
|
||||
{
|
||||
Super::Tick(DeltaSeconds);
|
||||
if (NumberOfPingPulses <= 0 ) NumberOfPingPulses = 1;
|
||||
TimeInbetweenPingPulses = GadgetMaxUptime / (float)NumberOfPingPulses;
|
||||
}
|
||||
|
||||
void AVisionLink::Activate()
|
||||
@ -23,16 +19,30 @@ void AVisionLink::Activate()
|
||||
if (GadgetCantBeUsed()) return;
|
||||
|
||||
Super::Activate();
|
||||
SetActorTickEnabled(true);
|
||||
|
||||
NumOfPingPulsesLeftInThisCycle = NumberOfPingPulses;
|
||||
VisionLinkActivated();
|
||||
SendOutPingPulse();
|
||||
}
|
||||
|
||||
void AVisionLink::FinishedUsing()
|
||||
{
|
||||
SetActorTickEnabled(false);
|
||||
VisionLinkRecharging();
|
||||
|
||||
Super::FinishedUsing();
|
||||
}
|
||||
|
||||
void AVisionLink::SendOutPingPulse()
|
||||
{
|
||||
NumOfPingPulsesLeftInThisCycle--;
|
||||
UpdatePulsesRemaining(NumOfPingPulsesLeftInThisCycle);
|
||||
if (NumOfPingPulsesLeftInThisCycle < 0) return;
|
||||
|
||||
// THIS IS WHERE I"LL PUT PING PULSE LOGIC
|
||||
UE_LOG(LogTemp, Warning, TEXT("Ping Pulse!"));
|
||||
GetWorld()->GetTimerManager().SetTimer(PulseHandle, this, &AVisionLink::SendOutPingPulse, TimeInbetweenPingPulses, false);
|
||||
PlayPingPulseAnim(TimeInbetweenPingPulses);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -14,21 +14,38 @@ class ENDLESSVENDETTA_API AVisionLink : public AReconGadget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
virtual void BeginPlay() override;
|
||||
int NumOfPingPulsesLeftInThisCycle;
|
||||
|
||||
virtual void Tick(float DeltaSeconds) override;
|
||||
float TimeInbetweenPingPulses;
|
||||
|
||||
FTimerHandle PulseHandle;
|
||||
|
||||
void SendOutPingPulse();
|
||||
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
virtual void Activate() override;
|
||||
|
||||
virtual void FinishedUsing() override;
|
||||
|
||||
protected:
|
||||
UPROPERTY(EditDefaultsOnly, Category = "Vision Link")
|
||||
int NumberOfPingPulses = 1;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Vision Link")
|
||||
float CooldownLength;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Vision Link")
|
||||
float InUseDuration;
|
||||
|
||||
// Updates UI with time to next Pulse
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Vision Link")
|
||||
void PlayPingPulseAnim(float PulseDuration);
|
||||
|
||||
// Updates UI with pulses remaining
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Vision Link")
|
||||
void UpdatePulsesRemaining(int PulsesRemaining);
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "Vision Link")
|
||||
void VisionLinkActivated();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user