diff --git a/examples/cocos-creator-airplane/backend/package.json b/examples/cocos-creator-airplane/backend/package.json index f08fb27..f7c0918 100644 --- a/examples/cocos-creator-airplane/backend/package.json +++ b/examples/cocos-creator-airplane/backend/package.json @@ -12,7 +12,6 @@ "devDependencies": { "@types/mocha": "^8.2.3", "@types/node": "^15.14.9", - "@types/seedrandom": "^3.0.1", "mocha": "^9.1.3", "onchange": "^7.1.0", "ts-node": "^10.4.0", @@ -20,7 +19,6 @@ "typescript": "^4.5.4" }, "dependencies": { - "seedrandom": "^3.0.5", "tsrpc": "^3.1.4" } } diff --git a/examples/cocos-creator-airplane/backend/src/api/ApiLogin.ts b/examples/cocos-creator-airplane/backend/src/api/ApiLogin.ts index 0da7d98..cb887ab 100644 --- a/examples/cocos-creator-airplane/backend/src/api/ApiLogin.ts +++ b/examples/cocos-creator-airplane/backend/src/api/ApiLogin.ts @@ -1,9 +1,9 @@ -import { ApiCallWs } from "tsrpc"; +import { ApiCall } from "tsrpc"; import { ReqLogin, ResLogin } from "../shared/protocols/PtlLogin"; let nextPlayerId = 1; -export async function ApiLogin(call: ApiCallWs) { +export async function ApiLogin(call: ApiCall) { let playerId = nextPlayerId++; call.conn.currentUser = { diff --git a/examples/cocos-creator-airplane/backend/src/index.ts b/examples/cocos-creator-airplane/backend/src/index.ts index 2199909..619c35a 100644 --- a/examples/cocos-creator-airplane/backend/src/index.ts +++ b/examples/cocos-creator-airplane/backend/src/index.ts @@ -1,7 +1,9 @@ import 'k8w-extend-native'; import * as path from "path"; import { WsServer } from "tsrpc"; +import { Room } from './models/Room'; import { serviceProto } from './shared/protocols/serviceProto'; +import { CurrentUser } from './shared/types/CurrentUser'; // Create the Server export const server = new WsServer(serviceProto, { @@ -23,4 +25,12 @@ async function main() { await init(); await server.start(); } -main(); \ No newline at end of file +main(); + +// 扩展 Connection 字段 +declare module 'tsrpc' { + export interface BaseConnection { + currentUser: CurrentUser, + room?: Room, + } +} \ No newline at end of file diff --git a/examples/cocos-creator-airplane/backend/src/models/Room.ts b/examples/cocos-creator-airplane/backend/src/models/Room.ts index 33172fa..644e9db 100644 --- a/examples/cocos-creator-airplane/backend/src/models/Room.ts +++ b/examples/cocos-creator-airplane/backend/src/models/Room.ts @@ -1,4 +1,3 @@ -import seedrandom from "seedrandom"; import { MsgCallWs, uint, WsConnection } from "tsrpc"; import { server } from ".."; import { gameConfig } from "../shared/game/gameConfig"; @@ -6,7 +5,6 @@ import { GameSystemInput } from "../shared/game/GameSystemInput"; import { GameSystemState } from "../shared/game/GameSystemState"; import { MsgGameInput } from "../shared/protocols/game/client/MsgGameInput"; import { ServiceType } from "../shared/protocols/serviceProto"; -import { CurrentUser } from "../shared/types/CurrentUser"; import { RoomState } from "../shared/types/RoomState"; const MAX_ROOM_USER = 2; @@ -111,8 +109,6 @@ export class Room { this._syncRoomState(); // 生成游戏初始状态 - let seed = '' + Math.random(); - let prng = seedrandom(seed, { state: true }); let initGameState: GameSystemState = { now: 0, players: this.conns.map(v => ({ @@ -137,13 +133,7 @@ export class Room { }, // 上次创建敌机的时间 - lastCreateEnemyTime: 3000, - - // 伪随机数发生器状态 - random: { - seed: '' + Math.random(), - state: prng.state() - } + lastCreateEnemyTime: 3000 }; this._lastSn = {}; this._lastSyncTime = Date.now(); @@ -195,11 +185,4 @@ export class Room { } // #endregion -} - -declare module 'tsrpc' { - export interface BaseConnection { - currentUser: CurrentUser, - room?: Room, - } } \ No newline at end of file diff --git a/examples/cocos-creator-airplane/backend/src/shared/game/GameSystem.ts b/examples/cocos-creator-airplane/backend/src/shared/game/GameSystem.ts index 55f6f2f..72cf437 100644 --- a/examples/cocos-creator-airplane/backend/src/shared/game/GameSystem.ts +++ b/examples/cocos-creator-airplane/backend/src/shared/game/GameSystem.ts @@ -1,4 +1,3 @@ -import seedrandom from "seedrandom"; import { gameConfig } from "./gameConfig"; import { GameSystemEvent } from "./GameSystemEvent"; import { GameSystemInput } from "./GameSystemInput"; @@ -16,12 +15,8 @@ export class GameSystem { } set state(state: GameSystemState) { this._state = state; - this._seedRandom = seedrandom(state.random.seed, state.random.state); } - // 伪随机数发生器 - private _seedRandom!: ReturnType; - constructor(state: GameSystemState) { this.state = state; } @@ -135,11 +130,11 @@ export class GameSystem { } let time = this.state.now - (this.state.now % gameConfig.enemy.bornGapTime); - let pos = { x: this._random() * 750 - 375, y: gameConfig.enemy.bornY }; + let pos = { x: 0, y: gameConfig.enemy.bornY }; let enemy: EnemyState = { id: this.state.nextId.enemy++, // 敌机类型 - type: this._random() > 0.5 ? EnemyType.E1 : EnemyType.E2, + type: EnemyType.E1, pos: { ...pos }, init: { time: time, @@ -156,12 +151,6 @@ export class GameSystem { this.state.enemies.push(enemy); } - private _random(): number { - let rand = this._seedRandom(); - this.state.random.state = this._seedRandom.state(); - return rand; - } - // 简易的事件侦听器 private _eventHandlers: { [key: string]: Function[] } = {}; on(eventName: T, handler: (e: GameSystemEvent[T]) => void): (e: GameSystemEvent[T]) => void { diff --git a/examples/cocos-creator-airplane/backend/src/shared/game/GameSystemEvent.ts b/examples/cocos-creator-airplane/backend/src/shared/game/GameSystemEvent.ts index eb76ec4..3bd5630 100644 --- a/examples/cocos-creator-airplane/backend/src/shared/game/GameSystemEvent.ts +++ b/examples/cocos-creator-airplane/backend/src/shared/game/GameSystemEvent.ts @@ -1,4 +1,4 @@ -import { uint } from "tsrpc"; +import { uint } from "tsrpc-proto"; export interface GameSystemEvent { playerDie: { diff --git a/examples/cocos-creator-airplane/backend/src/shared/game/GameSystemState.ts b/examples/cocos-creator-airplane/backend/src/shared/game/GameSystemState.ts index 1aaa73c..ac367f6 100644 --- a/examples/cocos-creator-airplane/backend/src/shared/game/GameSystemState.ts +++ b/examples/cocos-creator-airplane/backend/src/shared/game/GameSystemState.ts @@ -1,4 +1,4 @@ -import { uint } from "tsrpc"; +import { uint } from "tsrpc-proto"; // 坐标系:X-Y 原点在中间下方 /* @@ -26,12 +26,6 @@ export interface GameSystemState { // 上次创建敌机的时间 lastCreateEnemyTime: number, - - // 伪随机数发生器状态 - random: { - seed: string, - state: object - } } diff --git a/examples/cocos-creator-airplane/backend/src/shared/protocols/game/server/MsgGameStart.ts b/examples/cocos-creator-airplane/backend/src/shared/protocols/game/server/MsgGameStart.ts index 6986fda..df76c7f 100644 --- a/examples/cocos-creator-airplane/backend/src/shared/protocols/game/server/MsgGameStart.ts +++ b/examples/cocos-creator-airplane/backend/src/shared/protocols/game/server/MsgGameStart.ts @@ -1,4 +1,4 @@ -import { uint } from "tsrpc"; +import { uint } from "tsrpc-proto"; import { GameSystemState } from "../../../game/GameSystemState"; export interface MsgGameStart { diff --git a/examples/cocos-creator-airplane/backend/src/shared/protocols/game/server/MsgServerFrame.ts b/examples/cocos-creator-airplane/backend/src/shared/protocols/game/server/MsgServerFrame.ts index ecbd37a..bc1fcb5 100644 --- a/examples/cocos-creator-airplane/backend/src/shared/protocols/game/server/MsgServerFrame.ts +++ b/examples/cocos-creator-airplane/backend/src/shared/protocols/game/server/MsgServerFrame.ts @@ -1,4 +1,4 @@ -import { uint } from "tsrpc"; +import { uint } from "tsrpc-proto"; import { GameSystemInput } from "../../../game/GameSystemInput"; /** diff --git a/examples/cocos-creator-airplane/backend/src/shared/protocols/serviceProto.ts b/examples/cocos-creator-airplane/backend/src/shared/protocols/serviceProto.ts index e3d0261..49c7e06 100644 --- a/examples/cocos-creator-airplane/backend/src/shared/protocols/serviceProto.ts +++ b/examples/cocos-creator-airplane/backend/src/shared/protocols/serviceProto.ts @@ -43,7 +43,7 @@ export interface ServiceType { } export const serviceProto: ServiceProto = { - "version": 3, + "version": 4, "services": [ { "id": 11, @@ -701,29 +701,6 @@ export const serviceProto: ServiceProto = { "type": { "type": "Number" } - }, - { - "id": 6, - "name": "random", - "type": { - "type": "Interface", - "properties": [ - { - "id": 0, - "name": "seed", - "type": { - "type": "String" - } - }, - { - "id": 1, - "name": "state", - "type": { - "type": "Object" - } - } - ] - } } ] }, diff --git a/examples/cocos-creator-airplane/backend/src/shared/types/CurrentUser.ts b/examples/cocos-creator-airplane/backend/src/shared/types/CurrentUser.ts index 77a977f..bc234af 100644 --- a/examples/cocos-creator-airplane/backend/src/shared/types/CurrentUser.ts +++ b/examples/cocos-creator-airplane/backend/src/shared/types/CurrentUser.ts @@ -1,4 +1,4 @@ -import { uint } from "tsrpc"; +import { uint } from "tsrpc-proto"; export interface CurrentUser { id: uint, diff --git a/examples/cocos-creator-airplane/backend/tsrpc.config.ts b/examples/cocos-creator-airplane/backend/tsrpc.config.ts index efc1c8f..8dd0aa0 100644 --- a/examples/cocos-creator-airplane/backend/tsrpc.config.ts +++ b/examples/cocos-creator-airplane/backend/tsrpc.config.ts @@ -16,7 +16,7 @@ const tsrpcConf: TsrpcConfig = { sync: [ { from: 'src/shared', - to: '../frontend/assets/scripts/shared', + to: '../frontend/assets/script/shared', type: 'symlink' // Change this to 'copy' if your environment not support symlink } ], diff --git a/examples/cocos-creator-airplane/frontend/assets/env.ts.meta b/examples/cocos-creator-airplane/frontend/assets/env.ts.meta new file mode 100644 index 0000000..d4aecf0 --- /dev/null +++ b/examples/cocos-creator-airplane/frontend/assets/env.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "462c5922-0190-42df-a20e-963ccd552d2f", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/examples/cocos-creator-airplane/frontend/assets/script/GameStateManager.ts b/examples/cocos-creator-airplane/frontend/assets/script/GameStateManager.ts index 2ee72d1..310d174 100644 --- a/examples/cocos-creator-airplane/frontend/assets/script/GameStateManager.ts +++ b/examples/cocos-creator-airplane/frontend/assets/script/GameStateManager.ts @@ -1,12 +1,12 @@ import { WsClient } from "tsrpc-browser"; -import { GameSystem } from "../scripts/shared/game/GameSystem"; -import { GameSystemState } from "../scripts/shared/game/GameSystemState"; -import { ClientInput, MsgGameInput } from "../scripts/shared/protocols/game/client/MsgGameInput"; -import { MsgGameStart } from "../scripts/shared/protocols/game/server/MsgGameStart"; -import { MsgServerFrame } from "../scripts/shared/protocols/game/server/MsgServerFrame"; -import { serviceProto, ServiceType } from "../scripts/shared/protocols/serviceProto"; -import { CurrentUser } from "../scripts/shared/types/CurrentUser"; -import { RoomState } from "../scripts/shared/types/RoomState"; +import { GameSystem } from "../script/shared/game/GameSystem"; +import { GameSystemState } from "../script/shared/game/GameSystemState"; +import { ClientInput, MsgGameInput } from "../script/shared/protocols/game/client/MsgGameInput"; +import { MsgGameStart } from "../script/shared/protocols/game/server/MsgGameStart"; +import { MsgServerFrame } from "../script/shared/protocols/game/server/MsgServerFrame"; +import { serviceProto, ServiceType } from "../script/shared/protocols/serviceProto"; +import { CurrentUser } from "../script/shared/types/CurrentUser"; +import { RoomState } from "../script/shared/types/RoomState"; /** * 前端游戏状态管理 diff --git a/examples/cocos-creator-airplane/frontend/assets/script/GameStateManager.ts.meta b/examples/cocos-creator-airplane/frontend/assets/script/GameStateManager.ts.meta new file mode 100644 index 0000000..348e95f --- /dev/null +++ b/examples/cocos-creator-airplane/frontend/assets/script/GameStateManager.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "3a083653-ef15-4e15-a5a4-12b96b55a050", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/examples/cocos-creator-airplane/frontend/assets/script/bullet/bulletManager.ts b/examples/cocos-creator-airplane/frontend/assets/script/bullet/bulletManager.ts index c0d8cf5..ef43a38 100644 --- a/examples/cocos-creator-airplane/frontend/assets/script/bullet/bulletManager.ts +++ b/examples/cocos-creator-airplane/frontend/assets/script/bullet/bulletManager.ts @@ -1,7 +1,7 @@ -import { _decorator, Component, Node, Collider, find, ITriggerEvent, Script } from 'cc'; +import { Collider, Component, ITriggerEvent, _decorator } from 'cc'; import { Constant } from '../framework/constant'; -import { GameManager } from '../GameController'; +import { GameManager } from '../gameManager'; const { ccclass, property } = _decorator; @@ -55,7 +55,7 @@ export class bulletManager extends Component { //console.log("敌人子弹的位置",this.node.getPosition()); this.node.setPosition(this.node.position.x, this.node.position.y, this.node.position.z + 1); - + //地图边界值为100,即子弹到达屏幕外以后 if (this.node.position.z >= 100) { if (this._bullet1) { diff --git a/examples/cocos-creator-airplane/frontend/assets/script/bullet/fightIconBullet.ts b/examples/cocos-creator-airplane/frontend/assets/script/bullet/fightIconBullet.ts index 39c8890..ad9150d 100644 --- a/examples/cocos-creator-airplane/frontend/assets/script/bullet/fightIconBullet.ts +++ b/examples/cocos-creator-airplane/frontend/assets/script/bullet/fightIconBullet.ts @@ -1,7 +1,7 @@ -import { _decorator, Component, Node, Collider, ITriggerEvent } from 'cc'; +import { Collider, Component, ITriggerEvent, _decorator } from 'cc'; import { Constant } from '../framework/constant'; -import { GameManager } from '../GameController'; +import { GameManager } from '../gameManager'; const { ccclass, property } = _decorator; diff --git a/examples/cocos-creator-airplane/frontend/assets/script/framework/storageManager.ts b/examples/cocos-creator-airplane/frontend/assets/script/framework/storageManager.ts index 1bd36ef..cee4b26 100644 --- a/examples/cocos-creator-airplane/frontend/assets/script/framework/storageManager.ts +++ b/examples/cocos-creator-airplane/frontend/assets/script/framework/storageManager.ts @@ -1,4 +1,4 @@ -import { _decorator, sys, log } from "cc"; +import { log, sys, _decorator } from "cc"; import { Util } from './util'; const { ccclass, property } = _decorator; @@ -7,7 +7,7 @@ const { ccclass, property } = _decorator; export class StorageManager { private static _instance: StorageManager; - public static get instance () { + public static get instance() { if (this._instance) { return this._instance; } @@ -17,13 +17,13 @@ export class StorageManager { return this._instance; } - private _jsonData: {[key: string]: any} = {}; + private _jsonData: { [key: string]: any } = {}; private _path: any = null; private KEY_CONFIG: string = 'template'; private _markSave: boolean = false; private _saveTimer: number = -1; - start () { + start() { this._jsonData = { "userId": "", }; @@ -49,14 +49,14 @@ export class StorageManager { if (content && content.length) { if (content.startsWith('@')) { content = content.substring(1); - content = util.decrypt(content); + content = Util.decrypt(content); } try { //初始化操作 var jsonData = JSON.parse(content); this._jsonData = jsonData; - }catch (excepaiton) { + } catch (excepaiton) { } @@ -68,7 +68,7 @@ export class StorageManager { // }, 500); //每隔5秒保存一次数据,主要是为了保存最新在线时间,方便离线奖励时间判定 - this._saveTimer = setInterval(() =>{ + this._saveTimer = setInterval(() => { this.scheduleSave(); }, 5000); } @@ -78,8 +78,8 @@ export class StorageManager { * @param {string}key 关键字 * @param {any}value 存储值 */ - setConfigDataWithoutSave (key: string, value: any) { - let account: string= this._jsonData.userId; + setConfigDataWithoutSave(key: string, value: any) { + let account: string = this._jsonData.userId; if (this._jsonData[account]) { this._jsonData[account][key] = value; } else { @@ -87,12 +87,12 @@ export class StorageManager { } } - /** - * 存储配置文件,保存到本地 - * @param {string}key 关键字 - * @param {any}value 存储值 - */ - setConfigData (key: string, value: any) { + /** + * 存储配置文件,保存到本地 + * @param {string}key 关键字 + * @param {any}value 存储值 + */ + setConfigData(key: string, value: any) { this.setConfigDataWithoutSave(key, value); this._markSave = true; //标记为需要存储,避免一直在写入,而是每隔一段时间进行写入 } @@ -102,7 +102,7 @@ export class StorageManager { * @param {string} key 关键字 * @returns */ - getConfigData (key: string) { + getConfigData(key: string) { let account: string = this._jsonData.userId; if (this._jsonData[account]) { var value = this._jsonData[account][key]; @@ -119,7 +119,7 @@ export class StorageManager { * @param {any}value 存储值 * @returns */ - public setGlobalData (key:string, value: any) { + public setGlobalData(key: string, value: any) { this._jsonData[key] = value; this.save(); } @@ -129,7 +129,7 @@ export class StorageManager { * @param {string} key 关键字 * @returns */ - public getGlobalData (key:string) { + public getGlobalData(key: string) { return this._jsonData[key]; } @@ -139,7 +139,7 @@ export class StorageManager { * @param {any}value 存储值 * @returns */ - public setUserId (userId:string) { + public setUserId(userId: string) { this._jsonData.userId = userId; if (!this._jsonData[userId]) { this._jsonData[userId] = {}; @@ -152,7 +152,7 @@ export class StorageManager { * 获取用户唯一标示符 * @returns {string} */ - public getUserId () { + public getUserId() { return this._jsonData.userId; } @@ -160,7 +160,7 @@ export class StorageManager { * 定时存储 * @returns */ - public scheduleSave () { + public scheduleSave() { if (!this._markSave) { return; } @@ -171,7 +171,7 @@ export class StorageManager { /** * 标记为已修改 */ - public markModified () { + public markModified() { this._markSave = true; } @@ -179,7 +179,7 @@ export class StorageManager { * 保存配置文件 * @returns */ - public save () { + public save() { // 写入文件 var str = JSON.stringify(this._jsonData); @@ -192,7 +192,7 @@ export class StorageManager { // let zipStr = str; this._markSave = false; - + if (!sys.isNative) { var ls = sys.localStorage; ls.setItem(this.KEY_CONFIG, zipStr); @@ -201,6 +201,7 @@ export class StorageManager { var valueObj: any = {}; valueObj[this.KEY_CONFIG] = zipStr; + // @ts-ignore jsb.fileUtils.writeToFile(valueObj, this._path); // jsb.fileUtils.writeToFile(valueObj); } @@ -209,9 +210,9 @@ export class StorageManager { * 获取配置文件路径 * @returns 获取配置文件路径 */ - private _getConfigPath () { + private _getConfigPath() { - let platform: any= sys.platform; + let platform: any = sys.platform; let path: string = ""; diff --git a/examples/cocos-creator-airplane/frontend/assets/script/framework/util.ts b/examples/cocos-creator-airplane/frontend/assets/script/framework/util.ts index fab0488..a7aa6c8 100644 --- a/examples/cocos-creator-airplane/frontend/assets/script/framework/util.ts +++ b/examples/cocos-creator-airplane/frontend/assets/script/framework/util.ts @@ -761,11 +761,11 @@ export class Util { * 获取当前机型性能是否为低端机 */ public static checkIsLowPhone(): Boolean { - if (window.wx) { + if ((window as any).wx) { //微信性能数值参考:https://developers.weixin.qq.com/minigame/dev/guide/performance/perf-benchmarkLevel.html let nowBenchmarkLevel: number = -1; //nowBenchmarkLevel = -1性能未知 - const sys = window.wx.getSystemInfoSync(); + const sys = (window as any).wx.getSystemInfoSync(); const isIOS = sys.system.indexOf('iOS') >= 0; if (isIOS) { //微信不支持IO性能等级 diff --git a/examples/cocos-creator-airplane/frontend/assets/script/GameController.ts b/examples/cocos-creator-airplane/frontend/assets/script/gameManager.ts similarity index 99% rename from examples/cocos-creator-airplane/frontend/assets/script/GameController.ts rename to examples/cocos-creator-airplane/frontend/assets/script/gameManager.ts index 5f1121f..11a9bb1 100644 --- a/examples/cocos-creator-airplane/frontend/assets/script/GameController.ts +++ b/examples/cocos-creator-airplane/frontend/assets/script/gameManager.ts @@ -16,8 +16,8 @@ let _temp_quat = new Quat; -@ccclass('GameController') -export class GameController extends Component { +@ccclass('GameManager') +export class GameManager extends Component { @property(Node) public playerPlane: Node = null; //玩家飞机节点 diff --git a/examples/cocos-creator-airplane/frontend/assets/script/GameController.ts.meta b/examples/cocos-creator-airplane/frontend/assets/script/gameManager.ts.meta similarity index 100% rename from examples/cocos-creator-airplane/frontend/assets/script/GameController.ts.meta rename to examples/cocos-creator-airplane/frontend/assets/script/gameManager.ts.meta diff --git a/examples/cocos-creator-airplane/frontend/assets/script/plane/enemyPlane.ts b/examples/cocos-creator-airplane/frontend/assets/script/plane/enemyPlane.ts index 05585c2..e057b69 100644 --- a/examples/cocos-creator-airplane/frontend/assets/script/plane/enemyPlane.ts +++ b/examples/cocos-creator-airplane/frontend/assets/script/plane/enemyPlane.ts @@ -1,8 +1,7 @@ -import { _decorator, Component, Node, Collider, ITriggerEvent, physics, PhysicsSystem, find, Game, Prefab, NodePool, instantiate, Vec2, Vec3, AudioSource } from 'cc'; -import { bulletManager } from '../bullet/bulletManager'; +import { AudioSource, Collider, Component, ITriggerEvent, Node, Vec3, _decorator } from 'cc'; import { Constant } from '../framework/constant'; -import { GameManager } from '../GameController'; +import { GameManager } from '../gameManager'; const { ccclass, property } = _decorator; @@ -18,7 +17,7 @@ export class enemyPlane extends Component { @property public enemyBulletSpeed: number = 60; @property(AudioSource) - public audio:AudioSource = null! + public audio: AudioSource = null! private _enemyplane; private _isDie: boolean = false; diff --git a/examples/cocos-creator-airplane/frontend/assets/script/plane/selfPlane.ts b/examples/cocos-creator-airplane/frontend/assets/script/plane/selfPlane.ts index e4b29e0..ed3aeb9 100644 --- a/examples/cocos-creator-airplane/frontend/assets/script/plane/selfPlane.ts +++ b/examples/cocos-creator-airplane/frontend/assets/script/plane/selfPlane.ts @@ -1,7 +1,7 @@ import { _decorator, Component, Node, Collider, ITriggerEvent } from 'cc'; import { Constant } from '../framework/constant'; -import { GameManager } from '../GameController'; +import { GameManager } from '../gameManager'; const { ccclass, property } = _decorator; diff --git a/examples/cocos-creator-airplane/frontend/assets/scripts/shared b/examples/cocos-creator-airplane/frontend/assets/script/shared similarity index 100% rename from examples/cocos-creator-airplane/frontend/assets/scripts/shared rename to examples/cocos-creator-airplane/frontend/assets/script/shared diff --git a/examples/cocos-creator-airplane/frontend/assets/scripts/shared.meta b/examples/cocos-creator-airplane/frontend/assets/script/shared.meta similarity index 77% rename from examples/cocos-creator-airplane/frontend/assets/scripts/shared.meta rename to examples/cocos-creator-airplane/frontend/assets/script/shared.meta index 1c089e7..5bc8c8c 100644 --- a/examples/cocos-creator-airplane/frontend/assets/scripts/shared.meta +++ b/examples/cocos-creator-airplane/frontend/assets/script/shared.meta @@ -2,7 +2,7 @@ "ver": "1.1.0", "importer": "directory", "imported": true, - "uuid": "5fd42ea5-0316-4e48-86e1-1bcdba894b1c", + "uuid": "f2949899-5bbd-4e1e-b02a-f763b5978ef9", "files": [], "subMetas": {}, "userData": { diff --git a/examples/cocos-creator-airplane/frontend/assets/script/ui/uiMain.ts b/examples/cocos-creator-airplane/frontend/assets/script/ui/uiMain.ts index 46119fb..16cde19 100644 --- a/examples/cocos-creator-airplane/frontend/assets/script/ui/uiMain.ts +++ b/examples/cocos-creator-airplane/frontend/assets/script/ui/uiMain.ts @@ -1,6 +1,6 @@ import { _decorator, Component, Node, UITransform, Vec2, Vec3, find, Script, game, Label, CameraComponent, Camera, EventTouch, v3 } from 'cc'; -import { GameManager } from '../GameController'; +import { GameManager } from '../gameManager'; import { MovingSceneBg } from './common/movingSceneBg'; import { Tips } from './common/tips'; diff --git a/examples/cocos-creator-airplane/frontend/package.json b/examples/cocos-creator-airplane/frontend/package.json index 1308f7b..bc4a62b 100755 --- a/examples/cocos-creator-airplane/frontend/package.json +++ b/examples/cocos-creator-airplane/frontend/package.json @@ -7,10 +7,6 @@ "uuid": "c794458c-05f6-4c9f-909b-20d54897d219", "version": "3.4.0", "dependencies": { - "seedrandom": "^3.0.5", "tsrpc-browser": "^3.1.4" - }, - "devDependencies": { - "@types/seedrandom": "^3.0.1" } } diff --git a/examples/cocos-creator-airplane/frontend/tsconfig.json b/examples/cocos-creator-airplane/frontend/tsconfig.json index f94a2af..01dd261 100644 --- a/examples/cocos-creator-airplane/frontend/tsconfig.json +++ b/examples/cocos-creator-airplane/frontend/tsconfig.json @@ -4,6 +4,7 @@ /* Add your custom configuration here. */ "compilerOptions": { "strict": false, - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "skipLibCheck": true } } \ No newline at end of file