45 lines
1.6 KiB
TypeScript
45 lines
1.6 KiB
TypeScript
|
|
||
|
import { _decorator, Component, Node, CameraComponent, view, Vec3, AnimationComponent, ParticleSystemComponent, SkeletalAnimationComponent, Quat, clamp } from 'cc';
|
||
|
|
||
|
import { Player } from './player';
|
||
|
|
||
|
let v3_offsetWorPosSkyBox: Vec3 = new Vec3();//天空盒节点和玩家位置之间向量差
|
||
|
let v3_offsetWorPosWater: Vec3 = new Vec3();//水节点和玩家位置之间的向量差
|
||
|
let v3_offsetWorPosMainLight: Vec3 = new Vec3();//主光源节点和玩家位置之间的向量差
|
||
|
|
||
|
//游戏管理类
|
||
|
const { ccclass, property } = _decorator;
|
||
|
@ccclass('GameManager')
|
||
|
export class GameManager extends Component {
|
||
|
|
||
|
public static mainCamera: CameraComponent | null = null;
|
||
|
public static isGameStart: boolean = false;
|
||
|
public static isGamePause: boolean = false;
|
||
|
public static isGameOver: boolean = false;
|
||
|
public static scriptPlayer: Player;
|
||
|
public static ndPlayer: Node | null;
|
||
|
public static gameType: number = 1;//关卡类型
|
||
|
public static gameStatus: string = '';//关卡阶段
|
||
|
public static ndGameManager: Node;
|
||
|
public static isRevive: boolean = false;//玩家是否复活
|
||
|
public static isArriveEndLine: boolean = false;//是否达到终点线
|
||
|
public static oriPlayerWorPos: Vec3 = new Vec3(0, 1, -1);//玩家初始化位置
|
||
|
|
||
|
public static set isWin (value: boolean) {
|
||
|
this._isWin = value;
|
||
|
}
|
||
|
|
||
|
public static get isWin () {
|
||
|
return this._isWin;
|
||
|
}
|
||
|
|
||
|
public static get gameSpeed () {
|
||
|
return this._gameSpeed;
|
||
|
}
|
||
|
|
||
|
private static _gameSpeed: number = 1;//游戏速度
|
||
|
private static _isWin: boolean = false;//是否取得胜利
|
||
|
|
||
|
|
||
|
}
|