45 lines
961 B
Lua
45 lines
961 B
Lua
local BattleConst = require "app/module/battle/battle_const"
|
|
|
|
local BattleUnitComp = class("BattleUnitComp", LuaComponent)
|
|
|
|
local UNIT_STATE = BattleConst.UNIT_STATE
|
|
|
|
function BattleUnitComp:ctor()
|
|
end
|
|
|
|
function BattleUnitComp:initPosition()
|
|
self.baseObject:setLocalPosition(0, 0, 0)
|
|
end
|
|
|
|
function BattleUnitComp:_initBase()
|
|
self.isClear = false
|
|
self.isDead = false
|
|
end
|
|
|
|
function BattleUnitComp:initWithEntity(modelId, entity, battleController, target)
|
|
self.modelId = modelId
|
|
self.unitEntity = entity
|
|
self.battleController = battleController
|
|
self.target = target
|
|
self:_initBase()
|
|
self:initPosition()
|
|
end
|
|
|
|
function BattleUnitComp:tick(dt)
|
|
-- if self.isClear then
|
|
-- return
|
|
-- end
|
|
-- if self.isDead then
|
|
-- self:updateDead(dt)
|
|
-- return
|
|
-- end
|
|
-- if self.currState == UNIT_STATE.IDLE then
|
|
-- self:updateIdle(dt)
|
|
-- return
|
|
-- end
|
|
-- if self.currState == UNIT_STATE.ATTACK then
|
|
-- self:updateAttack(dt)
|
|
-- end
|
|
end
|
|
|
|
return BattleUnitComp |