local this = class("playerManager", G_EventManagerBase)
table.merge(this, require(L_R.world.coreMgr .. "player.playerManager_debug"))
table.merge(this, require(L_R.world.coreMgr .. "player.playerManager_hero"))
table.merge(this, require(L_R.world.coreMgr .. "player.playerManager_mainControl"))
table.merge(this, require(L_R.world.coreMgr .. "player.playerManager_mount"))
table.merge(this, require(L_R.world.coreMgr .. "player.playerManager_operator"))
table.merge(this, require(L_R.world.coreMgr .. "player.playerManager_voice"))
table.merge(this, require(L_R.world.coreMgr .. "player.playerManager_interactSystem"))
table.merge(this, require(L_R.world.coreMgr .. "player.playerManager_baseInfo"))
table.merge(this, require(L_R.world.coreMgr .. "player.playerManager_shit"))
this.event = {
  setMainControl = "setMainControl",
  playMount = "playMount",
  outMount = "outMount",
  outMountEnd = "outMountEnd",
  playerUnitInit = "playerUnitInit",
  petEntityLoadFinish = "petEntityLoadFinish"
}

function this:ctor()
  this.super.ctor(self)
  self:reset()
end

function this:reset()
  self.playerUnit = require(L_EcsConst.unitType.player).new()
  self.playerUnit:addSystem(L_EcsConst.systemType.operatorSend)
  self:sendEvent(self.event.playerUnitInit)
end

function this:onUpdate(scale)
  self.playerUnit:onUpdate(scale)
end

function this:dispose()
  self.playerUnit:onDestroy()
  self:reset()
end

return this
