update
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import { _decorator, Node, Vec2, UITransform } from 'cc'
|
||||
import { EntityManager } from '../../Base/EntityManager'
|
||||
import { EntityTypeEnum, EntityStateEnum, EventEnum, InputType } from '../../Enum'
|
||||
import DataManager, { IPlayer } from '../../Global/DataManager'
|
||||
import { ApiMsgEnum, EntityTypeEnum, InputTypeEnum } from '../../Common'
|
||||
import { EntityStateEnum, EventEnum } from '../../Enum'
|
||||
import DataManager from '../../Global/DataManager'
|
||||
import EventManager from '../../Global/EventManager'
|
||||
import NetworkManager from '../../Global/NetworkManager'
|
||||
import { WeaponStateMachine } from './WeaponStateMachine'
|
||||
const { ccclass } = _decorator
|
||||
|
||||
@@ -19,7 +21,7 @@ export class WeaponManager extends EntityManager {
|
||||
return DataManager.Instance.myPlayerId === this.owner
|
||||
}
|
||||
|
||||
init({ id, weaponType }: IPlayer) {
|
||||
init({ id, weaponType }: { id: number, weaponType: EntityTypeEnum }) {
|
||||
this.owner = id
|
||||
this.type = weaponType
|
||||
|
||||
@@ -58,8 +60,8 @@ export class WeaponManager extends EntityManager {
|
||||
const anchorWorldPos = this.anchor.getWorldPosition()
|
||||
const directionVec2 = new Vec2(pointWorldPos.x - anchorWorldPos.x, pointWorldPos.y - anchorWorldPos.y).normalize()
|
||||
|
||||
DataManager.Instance.applyInput({
|
||||
type: InputType.WeaponShoot,
|
||||
NetworkManager.Instance.sendMsg(ApiMsgEnum.MsgClientSync, {
|
||||
type: InputTypeEnum.WeaponShoot,
|
||||
owner: this.owner,
|
||||
position: {
|
||||
x: pointStagePos.x,
|
||||
|
@@ -1,7 +1,8 @@
|
||||
import { _decorator, Animation, AnimationClip } from 'cc'
|
||||
import State from '../../Base/State'
|
||||
import StateMachine, { getInitParamsTrigger } from '../../Base/StateMachine'
|
||||
import { EntityStateEnum, EntityTypeEnum, ParamsNameEnum } from '../../Enum'
|
||||
import { EntityTypeEnum } from '../../Common'
|
||||
import { EntityStateEnum, ParamsNameEnum } from '../../Enum'
|
||||
import { WeaponManager } from './WeaponManager'
|
||||
const { ccclass } = _decorator
|
||||
|
||||
|
Reference in New Issue
Block a user