PGRData/Script/matrix/xentity/xrpgmakergame/object/XRpgMakerGameMonsterPatrolLine.lua

20 lines
No EOL
737 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local XRpgMakerGameObject = require("XEntity/XRpgMakerGame/Object/XRpgMakerGameObject")
local type = type
local pairs = pairs
local Vector3 = CS.UnityEngine.Vector3
--巡逻路线
local XRpgMakerGameMonsterPatrolLine = XClass(XRpgMakerGameObject, "XRpgMakerGameMonsterPatrolLine")
function XRpgMakerGameMonsterPatrolLine:LoadPatrolLine(modelPath, x, y, direction, modelKey)
local cubeObj = self:GetCubeTransform(y, x)
self:LoadModel(modelPath, cubeObj, nil, modelKey) --特效绑定在cube上绑定在怪物上会被改变旋转角度
local objPos = self:GetCubeUpCenterPosition(y, x)
self:SetGameObjectPosition(objPos)
self:SetGameObjectLookRotation(direction)
end
return XRpgMakerGameMonsterPatrolLine