54 lines
1.3 KiB
Lua
Raw Normal View History

2025-01-18 21:26:02 +08:00
---@class BP_PlaceableArea_C:AActor
---@field Box UBoxComponent
---@field DefaultSceneRoot USceneComponent
--Edit Below--
local BP_PlaceableArea = {};
--[[
function BP_PlaceableArea:ReceiveBeginPlay()
self.SuperClass.ReceiveBeginPlay(self);
end
--]]
--[[
function BP_PlaceableArea:ReceiveTick(DeltaTime)
self.SuperClass.ReceiveTick(self, DeltaTime);
end
--]]
--[[
function BP_PlaceableArea:ReceiveEndPlay()
self.SuperClass.ReceiveEndPlay(self);
end
--]]
--[[
function BP_PlaceableArea:GetReplicatedProperties()
return
end
--]]
--[[
function BP_PlaceableArea:GetAvailableServerRPCs()
return
end
--]]
function BP_PlaceableArea:InitOnce()
if self.bInitOnce then return end
self.bInitOnce = true
self.Origin, self.BoxExtent = self:GetActorBounds()
UGCLogSystem.Log("[BP_PlaceableArea_InitOnce] Origin:%s, BoxExtent:%s", VectorHelper.ToString(self.Origin), VectorHelper.ToString(self.BoxExtent))
end
function BP_PlaceableArea:InPlaceableArea(Pos)
self:InitOnce()
if Pos.X >= self.Origin.X - self.BoxExtent.X and Pos.X <= self.Origin.X + self.BoxExtent.X
and Pos.Y >= self.Origin.Y - self.BoxExtent.Y and Pos.Y <= self.Origin.Y + self.BoxExtent.Y
and Pos.Z >= self.Origin.Z - self.BoxExtent.Z and Pos.Z <= self.Origin.Z + self.BoxExtent.Z then
return true
end
return false
end
return BP_PlaceableArea;