2023-07-14 19:35:33 +00:00
|
|
|
local XRpgMakerGameObject = require("XEntity/XRpgMakerGame/Object/XRpgMakerGameObject")
|
|
|
|
|
|
|
|
local type = type
|
|
|
|
local pairs = pairs
|
|
|
|
local Vector3 = CS.UnityEngine.Vector3
|
|
|
|
|
2024-09-01 20:49:41 +00:00
|
|
|
---地图格子对象
|
|
|
|
---@class XRpgMakerGameCube:XRpgMakerGameObject
|
2023-07-14 19:35:33 +00:00
|
|
|
local XRpgMakerGameCube = XClass(XRpgMakerGameObject, "XRpgMakerGameCube")
|
|
|
|
|
|
|
|
function XRpgMakerGameCube:Ctor(id, gameObject)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
--获得格子对象上方中心的坐标
|
|
|
|
function XRpgMakerGameCube:GetGameObjUpCenterPosition()
|
|
|
|
local transform = self:GetTransform()
|
|
|
|
local centerPoint = XUiHelper.TryGetComponent(transform, "CenterPoint")
|
|
|
|
if not centerPoint then
|
|
|
|
XLog.Error("未找到地面节点下名为CenterPoint的节点")
|
|
|
|
end
|
|
|
|
return centerPoint and centerPoint.transform.position
|
|
|
|
end
|
|
|
|
|
|
|
|
return XRpgMakerGameCube
|