|
@@ -36,8 +36,6 @@ export class Player extends BaseExp {
|
|
|
public player_skeletal: SkeletalAnimation = null!;
|
|
|
@autoBind({type: PlayerCamera,tooltip: "玩家摄像机抖动控制"})
|
|
|
public mainCamera: PlayerCamera = null!;
|
|
|
- @autoBind({type: Node,tooltip: "玩家摄像机抖动控制"})
|
|
|
- public GGGGGGG: Node = null!;
|
|
|
|
|
|
/**玩家的位置节点*/
|
|
|
public playPosNodes: Node[] = []!;
|
|
@@ -47,8 +45,6 @@ export class Player extends BaseExp {
|
|
|
public isDead: boolean = false;
|
|
|
/**玩家拥有的枪*/
|
|
|
public gun: GunBase = null;
|
|
|
- //玩家数据
|
|
|
- public pData:any = null
|
|
|
//是否去设置gunfightShootUI的基础信息
|
|
|
public isCutShoot:boolean = false;
|
|
|
//射击ui类
|
|
@@ -64,18 +60,29 @@ export class Player extends BaseExp {
|
|
|
public isReloadMagazine: boolean = false;
|
|
|
//玩家打敌人爆头的个数
|
|
|
public headShotNum:number = 0;
|
|
|
-
|
|
|
- start() {
|
|
|
+ //玩家数据改为私有属性
|
|
|
+ private _pData: any = null;
|
|
|
+ public get pData(): any {
|
|
|
+ if (!this._pData) {
|
|
|
+ this._pData = userIns.getCurUseGun();
|
|
|
+ }
|
|
|
+ return this._pData;
|
|
|
+ }
|
|
|
+ public set pData(value: any) {
|
|
|
+ this._pData = value;
|
|
|
+ }
|
|
|
+
|
|
|
+ onEnable() {
|
|
|
//隐藏玩家设置的位置坐标节点
|
|
|
(this.playPosNodes = this.node.parent.getChildByName('player_points').children)
|
|
|
- .forEach(e => e.active = false);
|
|
|
+ .forEach(e => e.active = false);
|
|
|
//隐藏的枪的位置节点
|
|
|
this.gun_pos.children.forEach(e => e.active = false);
|
|
|
- this.pData = userIns.getCurUseGun();
|
|
|
//创建玩家拥有的枪
|
|
|
this.loadGunName(this.pData.prb_name);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 加载枪
|
|
|
* @param name 枪的名字
|
|
@@ -227,6 +234,7 @@ export class Player extends BaseExp {
|
|
|
const safeIndex = Math.min(data.point -1, length - 1);
|
|
|
const n: Node = this.playPosNodes[safeIndex];
|
|
|
this.node.worldPosition = n.worldPosition.clone();
|
|
|
+ this.node.eulerAngles = n.eulerAngles.clone();
|
|
|
}
|
|
|
|
|
|
/**
|