---@class BP_MakeDamageActor_C:AActor ---@field StaticMesh UStaticMeshComponent ---@field Capsule UCapsuleComponent ---@field DefaultSceneRoot USceneComponent --Edit Below-- ---@type BP_MakeDamageActor_C local BP_MakeDamageActor = {}; BP_MakeDamageActor.HealthValue = 10; ---@type int32 当前的索引 BP_MakeDamageActor.Index = 0; function BP_MakeDamageActor:ReceiveBeginPlay() self.SuperClass.ReceiveBeginPlay(self); if self:HasAuthority() then self.Capsule.OnComponentBeginOverlap:Add(self.OnBeginOverlap, self) self.Capsule.OnComponentEndOverlap:Add(self.OnEndOverlap, self) end self:SetActorHiddenInGame(true); end function BP_MakeDamageActor:OnBeginOverlap(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex, bFromSweep, SweepResult) if UE.IsA(OtherActor, ObjectPathTable.PlayerPawnClass) then local MaxHealth = UGCPawnAttrSystem.GetHealth(OtherActor) local Health = math.clamp(MaxHealth - self.HealthValue, 0, MaxHealth); UGCPawnAttrSystem.SetHealth(OtherActor, Health); UGCLogSystem.Log("[BP_MakeDamageActor:ReceiveBeginPlay] 执行") end end function BP_MakeDamageActor:OnEndOverlap(OverlappedComponent, OtherActor, OtherComp, OtherBodyIndex) UGCLogSystem.Log("[BP_MakeDamageActor:ReceiveBeginPlay] 玩家出去了"); end --[[ function BP_MakeDamageActor:ReceiveTick(DeltaTime) self.SuperClass.ReceiveTick(self, DeltaTime); end --]] --[[ function BP_MakeDamageActor:ReceiveEndPlay() self.SuperClass.ReceiveEndPlay(self); end --]] --[[ function BP_MakeDamageActor:GetReplicatedProperties() return end --]] --[[ function BP_MakeDamageActor:GetAvailableServerRPCs() return end --]] return BP_MakeDamageActor;