优化若干代码

This commit is contained in:
2024-04-17 20:15:52 +08:00
parent 54580cc1b2
commit 58cc2e3b82
66 changed files with 5821 additions and 4019 deletions

View File

@@ -1,5 +1,5 @@
{
"image": {
"type": "sprite-frame"
"type": "texture"
}
}

5
.editorconfig Normal file
View File

@@ -0,0 +1,5 @@
root = true
[*]
charset = utf-8
end_of_line = lf

11
.eslintignore Normal file
View File

@@ -0,0 +1,11 @@
.creator
.idea
.vscode
.git
.DS_Store
/node_modules
/build
/temp
/library
/profiles
/settings

11
.prettierignore Normal file
View File

@@ -0,0 +1,11 @@
.creator
.idea
.vscode
.git
.DS_Store
/node_modules
/build
/temp
/library
/profiles
/settings

6
.prettierrc.json Normal file
View File

@@ -0,0 +1,6 @@
{
"printWidth": 100,
"singleQuote": true,
"semi": false,
"endOfLine": "lf"
}

View File

@@ -7,32 +7,34 @@ import {
Animation,
Vec3,
} from 'cc'
const { ccclass, property } = _decorator
const {ccclass, property} = _decorator
import FishBase from './FishBase'
import MathUtils from '../../script/engine/utils/MathUtils'
import { Logger } from '../../script/engine/utils/Logger'
import {Logger} from '../../script/engine/utils/Logger'
import TimeHelper from '../../script/game/utils/TimeHelper'
@ccclass('FishMover')
export default class FishMover extends Component {
// //鱼类型
@property({ type: CCInteger })
//鱼类型
@property({type: CCInteger})
public fishType: number = 1
// //鱼移动速度
@property({ type: CCFloat })
//鱼移动速度
@property({type: CCFloat})
public speed: number = 3
// //下个位置移动点
//下个位置移动点
private targetMoveIndex: number = 0
// //鱼移动位置
//鱼移动位置
public movePList: Array<Vec2> = []
// //贝萨尔曲线
//贝萨尔曲线
public bezierPList: Array<Vec2> = []
public isMoving: boolean = false
private minSpeed: number = 0.1
private moveCount: number = 1
private totalTimes: number = 60 * 2
private _vec3Cahce: Vec3 = new Vec3()
public startMove() {
this.targetMoveIndex = 0
this.isMoving = true

View File

@@ -1,4 +1,5 @@
import { _decorator } from 'cc'
const { ccclass, property } = _decorator
@ccclass('CommonEvent')

View File

@@ -1,4 +1,3 @@
import { _decorator } from 'cc'
import DateUtil from '../utils/DateUtil'
import NetConfig from './NetConfig'

View File

@@ -1,4 +1,4 @@
import { _decorator, AudioClip } from 'cc'
import { AudioClip } from 'cc'
import { GameConfig } from '../../game/config/GameConfig'
export default class MusicConfig {

View File

@@ -1,4 +1,3 @@
import { _decorator } from 'cc'
export default class NetConfig {
public static hotupdateUrl: string = 'http://localhost:33/hotupdate'
}

View File

@@ -1,18 +1,10 @@
import {
_decorator,
Component,
Label,
Node,
tween,
Vec3,
instantiate,
} from 'cc'
const { ccclass, property } = _decorator
import { _decorator, Component, instantiate, Label, Node, tween, Vec3 } from 'cc'
import PrefabLoader from '../utils/PrefabLoader'
import { GameConfig } from '../../game/config/GameConfig'
import DialogBase from './DialogBase'
const { ccclass, property } = _decorator
@ccclass('CommonTips')
export default class CommonTips extends Component {
public static TipsZorderIndex: number = 999

View File

@@ -1,10 +1,10 @@
import { _decorator, Component, Prefab, Widget, instantiate, Node } from 'cc'
const { ccclass, property } = _decorator
import { _decorator, Component, instantiate, Node, Prefab, Widget } from 'cc'
import PrefabLoader from '../utils/PrefabLoader'
import { GameConfig } from '../../game/config/GameConfig'
import DialogBase from './DialogBase'
const { ccclass, property } = _decorator
@ccclass('DarkLayer')
export default class DarkLayer extends Component {
private static prefab: Prefab

View File

@@ -1,9 +1,9 @@
import { _decorator, Component, Node, Widget, director } from 'cc'
const { ccclass } = _decorator
import { _decorator, Component, Node, Widget } from 'cc'
import DarkLayer from './DarkLayer'
import { UIRoot } from '../../game/utils/UIRoot'
const { ccclass } = _decorator
@ccclass('DialogBase')
export default class DialogBase extends Component {
private static LocalZOrder: number = 5

View File

@@ -1,19 +1,10 @@
import {
_decorator,
Component,
Node,
Prefab,
instantiate,
math,
Quat,
Vec3,
} from 'cc'
const { ccclass, property } = _decorator
import { _decorator, Component, instantiate, Node, Prefab, Quat, Vec3 } from 'cc'
import PrefabLoader from '../utils/PrefabLoader'
import { GameConfig } from '../../game/config/GameConfig'
import DialogBase from './DialogBase'
const { ccclass, property } = _decorator
@ccclass('LoadingPrefab')
export default class LoadingPrefab extends Component {
public static instance: Node

View File

@@ -1,11 +1,11 @@
import { _decorator, Component, Node, Prefab, instantiate } from 'cc'
const { ccclass, property } = _decorator
import { _decorator, Component, instantiate, Node, Prefab } from 'cc'
import PrefabLoader from '../utils/PrefabLoader'
import Progress from './Progress'
import { GameConfig } from '../../game/config/GameConfig'
import DialogBase from './DialogBase'
const { ccclass, property } = _decorator
@ccclass('LoadingScenePrefab')
export default class LoadingScenePrefab extends Component {
public static instance: Node

View File

@@ -1,19 +1,12 @@
import {
_decorator,
Component,
AssetManager,
AudioClip,
AudioSource,
instantiate,
Prefab,
} from 'cc'
const { ccclass, property } = _decorator
import { _decorator, AssetManager, AudioClip, AudioSource, Component, instantiate, Prefab } from 'cc'
import { Logger } from '../utils/Logger'
import PrefabLoader from '../utils/PrefabLoader'
import LocalStorage from '../utils/LocalStorage'
import MusicConfig from '../config/MusicConfig'
import { GameConfig } from '../../game/config/GameConfig'
const { ccclass, property } = _decorator
/**
* 背景音乐
*/

View File

@@ -1,7 +1,6 @@
import { _decorator, Component, Label, ProgressBar } from 'cc'
const { ccclass, property } = _decorator
import { Logger } from '../utils/Logger'
const { ccclass, property } = _decorator
@ccclass('Progress')
export default class Progress extends Component {

View File

@@ -1,16 +1,4 @@
import {
_decorator,
Component,
Prefab,
NodePool,
Node,
instantiate,
AssetManager,
AudioClip,
AudioSource,
} from 'cc'
const { ccclass, property } = _decorator
import { _decorator, AssetManager, AudioClip, AudioSource, Component, instantiate, Node, NodePool, Prefab } from 'cc'
import { Logger } from '../utils/Logger'
import PrefabLoader from '../utils/PrefabLoader'
import LocalStorage from '../utils/LocalStorage'
@@ -18,6 +6,9 @@ import EventManager from '../utils/EventManager'
import CommonEvent from '../config/CommonEvent'
import MusicConfig from '../config/MusicConfig'
import { GameConfig } from '../../game/config/GameConfig'
const { ccclass, property } = _decorator
// /**
// * 音效
// * Ios暂时有bug弃用

View File

@@ -1,4 +1,5 @@
import { _decorator, Component, SpriteFrame } from 'cc'
const { ccclass, property } = _decorator
@ccclass('TextureMgr')

View File

@@ -1,13 +1,13 @@
import { Canvas, error, log, ResolutionPolicy, sys, view, _decorator } from 'cc'
import { _decorator, Canvas, error, log, view } from 'cc'
import DialogBase from '../uicomponent/DialogBase'
const { ccclass, property } = _decorator
import { Logger } from './Logger'
const { ccclass, property } = _decorator
@ccclass('AdapterHelper')
export default class AdapterHelper {
public static winSizeWidth: number
public static winSizeHeiht: number
public static fixApdater() {
log('v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true')
return

View File

@@ -1,17 +1,13 @@
import { _decorator } from 'cc'
const { ccclass, property } = _decorator
import { Logger } from './Logger'
const { ccclass, property } = _decorator
@ccclass('BitUtil')
export default class BitUtil {
//index是二进制从右到左
public static isBitSet(value: number, index: number): boolean {
let str: string = value.toString(2)
if (parseInt(str[str.length - 1 - index]) == 1) {
return true
}
return false
return parseInt(str[str.length - 1 - index]) == 1
}
//从右到左计算

View File

@@ -1,4 +1,5 @@
import { _decorator, Color } from 'cc'
const { ccclass, property } = _decorator
@ccclass('ColorHelper')

View File

@@ -1,6 +1,3 @@
import { _decorator } from 'cc'
import { Logger } from './Logger'
export default class DateUtil {
public static formatNumStr(num: number) {
let str = '' + num

View File

@@ -1,11 +1,11 @@
import { _decorator, Node, Color, Button, Component, Slider } from 'cc'
import { Logger } from './Logger'
import { Button, Color, Component, Node, Slider } from 'cc'
import ColorHelper from './ColorHelper'
export class HaoEvent {
public callback: Function
public caller: any
public isStop: boolean
constructor(callback: Function, caller: any) {
this.callback = callback
this.caller = caller
@@ -18,7 +18,8 @@ export default class EventManager {
private callbackList = {}
public constructor() {}
public constructor() {
}
//注册事件
public addListener(eventName: string, callback: Function, caller: any) {

View File

@@ -1,8 +1,8 @@
import { _decorator } from 'cc'
export default class Grid {
public row: number
public col: number
constructor(row: number, col) {
constructor(row: number, col: number) {
this.row = row
this.col = col
}

View File

@@ -1,6 +1,3 @@
import { _decorator } from 'cc'
import { Logger } from './Logger'
export default class HaoEncrypt {
public static encode(str: string) {
let result: string = ''

View File

@@ -1,4 +1,4 @@
import { sys, _decorator, native, System } from 'cc'
import { native, sys } from 'cc'
import { Logger } from './Logger'
import EventManager from './EventManager'
import VersionManager from './VersionManager'
@@ -15,7 +15,7 @@ export default class HotUpdate {
'HotUpdate_Event_On_ALREADY_UP_TO_DATE'
public static Event_On_Fail_Update: string = 'HotUpdate_Event_On_Fail_Update'
private _am: any
private _checkListener
private _checkListener: null
private storagePath: string
private manifestUrl: string
private localBigVersion: number
@@ -26,7 +26,10 @@ export default class HotUpdate {
public isCheck: boolean
private key: string
private hotupdateIndex: number
constructor() {}
constructor() {
}
public init(
index: number,
key: string = 'Code-remote-asset',
@@ -36,16 +39,7 @@ export default class HotUpdate {
this.hotupdateIndex = index
this.key = key
this.manifestUrl = manifestUrl
if (false) {
//暂时不想修 fileUtils 这个报错
//暂时注释
// this.storagePath = jsb.fileUtils.getWritablePath() + key;
// if (!jsb.fileUtils.isDirectoryExist(this.storagePath)) {
// jsb.fileUtils.createDirectory(this.storagePath)
// }
} else {
this.storagePath = '获取this.storagePath报错了'
}
Logger.log(this, 'init removeDirectory=', this.storagePath + '_temp')
}
@@ -88,7 +82,7 @@ export default class HotUpdate {
this.showPackUpdateDialog()
}
private checkCb(event) {
private checkCb(event: any) {
Logger.log(this, 'checkCb Code: =================' + event.getEventCode())
switch (event.getEventCode()) {
case native.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST:
@@ -207,7 +201,7 @@ export default class HotUpdate {
let manifestStr: string = ManifestConfig.getManifestStr(hotupdateUrlKey)
Logger.log(this, 'checkUpdate=======manifestStr=======', manifestStr)
let manifest = new native.Manifest(manifestStr, this.storagePath)
this._am.setVerifyCallback(function (filePath, asset) {
this._am.setVerifyCallback(function(filePath, asset) {
return true
// var md5 = calculateMD5(filePath);
// if (md5 === asset.md5)
@@ -225,11 +219,10 @@ export default class HotUpdate {
/**
* @param versionA 本地版本 1.0.0
* @param versionB 服务器版本 1.0.1
* @param return -1需要更新 不用更新
*/
private versionCompareHandle(versionA, versionB) {
var vA = versionA.split('.')
var vB = versionB.split('.')
private versionCompareHandle(versionA: string, versionB: string) {
const vA = versionA.split('.')
const vB = versionB.split('.')
Logger.log(
this,
'versionCompareHandle======',
@@ -243,14 +236,10 @@ export default class HotUpdate {
}
this.localBigVersion = parseInt(vA[0])
this.remoteBigVersion = parseInt(vB[0])
for (var i = 0; i < vA.length; ++i) {
var a = parseInt(vA[i])
var b = parseInt(vB[i] || 0)
if (a === b) {
continue
} else {
return a - b
}
for (let i = 0; i < vA.length; ++i) {
const a = parseInt(vA[i])
const b = parseInt(vB[i] || '0')
if (a !== b) return a - b
}
if (vB.length > vA.length) {
return -1

View File

@@ -1,10 +1,8 @@
import { _decorator } from 'cc'
const { ccclass } = _decorator
import LoadingPrefab from '../uicomponent/LoadingPrefab'
import VersionManager from './VersionManager'
import { Logger } from './Logger'
const { ccclass } = _decorator
@ccclass('HttpClient')
export default class HttpClient {
public static instance: HttpClient //= new HttpClient();
@@ -46,7 +44,8 @@ export default class HttpClient {
this.responseType = responseType
}
public setContentType() {}
public setContentType() {
}
public request(
url: string,
@@ -156,5 +155,6 @@ export default class HttpClient {
xhr.send(params)
}
public getInfo(callback: Function = null) {}
public getInfo(callback: Function = null) {
}
}

View File

@@ -1,5 +1,4 @@
import { sys, _decorator } from 'cc'
import { Logger } from './Logger'
import { sys } from 'cc'
export default class LocalStorage {
public static GamePreFlag: string = 'fengshen-game-HaoLocalStorage'

View File

@@ -1,4 +1,3 @@
import { error, _decorator } from 'cc'
class LOG_LEVEL_TYPES {
public static DEBUG = 0
public static LOG = 1
@@ -6,6 +5,7 @@ class LOG_LEVEL_TYPES {
public static WARN = 3
public static ERROR = 4
}
const Log_Level_Names: Array<string> = ['debug', 'log', 'info', 'warn', 'error']
export class Logger {
@@ -16,9 +16,10 @@ export class Logger {
'color:#000;font-size:11px;',
'color:#09f;font-size:12px;',
'color:#f90;font-size:13px;',
'color:#f00;font-size:15px;',
'color:#f00;font-size:15px;'
]
private static Terminal_Log: boolean = false
public static formatNow() {
let date: Date = new Date() //后端返回的时间戳是秒
return (
@@ -37,17 +38,17 @@ export class Logger {
date.getMilliseconds()
)
}
private static getLogPreKey(nowLevel: number): string {
let str: string =
'[' +
return '[' +
Logger.formatNow() +
'] ' +
Logger.tag +
' [' +
Log_Level_Names[nowLevel] +
'] '
return str
}
public static debug(...params: any) {
if (Logger.LEVEL > LOG_LEVEL_TYPES.DEBUG) {
return
@@ -65,6 +66,7 @@ export class Logger {
console.info(fileStr)
}
}
public static log(...params: any) {
if (Logger.LEVEL > LOG_LEVEL_TYPES.LOG) {
return
@@ -82,6 +84,7 @@ export class Logger {
console.info(fileStr) //console.log(str, ...params)
}
}
public static info(...params: any) {
if (Logger.LEVEL > LOG_LEVEL_TYPES.INFO) {
return
@@ -98,6 +101,7 @@ export class Logger {
console.info(fileStr)
}
}
public static warn(...params: any) {
if (Logger.LEVEL > LOG_LEVEL_TYPES.WARN) {
return
@@ -114,6 +118,7 @@ export class Logger {
console.warn(fileStr)
}
}
public static error(...params: any) {
if (Logger.LEVEL > LOG_LEVEL_TYPES.ERROR) {
return

View File

@@ -1,9 +1,12 @@
import { _decorator, Vec2 } from 'cc'
import { Vec2 } from 'cc'
export default class MathUtils {
/**
* 2个点之前的直线距离
* @param p1
* @param p2
* @param x1
* @param y1
* @param x2
* @param y2
*/
public static distance(x1: number, y1: number, x2: number, y2: number) {
// 设两点AX1,Y1,BX2,Y2

View File

@@ -1,11 +1,11 @@
import { _decorator, Node, Vec3, Vec2 } from 'cc'
import { Logger } from './Logger'
import { Node, Vec2, Vec3 } from 'cc'
import MathUtils from './MathUtils'
export class MoveHelper {
public static _vec3: Vec3 = new Vec3()
public static _vec2_0: Vec2 = new Vec2()
public static _vec2_1: Vec2 = new Vec2()
public static moveNode(
moveNode: Node,
speed: number,

View File

@@ -1,8 +1,8 @@
import { AssetManager, Prefab, _decorator } from 'cc'
const { ccclass, property } = _decorator
import { _decorator, AssetManager, Prefab } from 'cc'
import { Logger } from './Logger'
const { ccclass, property } = _decorator
@ccclass('PrefabLoader')
export default class PrefabLoader {
private static isLoading: boolean = false

View File

@@ -1,4 +1,5 @@
import { Vec2, _decorator } from 'cc'
import { Vec2 } from 'cc'
export default class RandomUtil {
//随机minNum到maxNum的数字 包含maxNum
public static nextInt(minNum: number, maxNum: number) {
@@ -19,10 +20,8 @@ export default class RandomUtil {
public static nextBoolean() {
let temp = Math.random()
if (temp < 0.5) {
return true
}
return false
return temp < 0.5;
}
public static randomArr(nowArr: Array<any>, needNum: number) {

View File

@@ -1,14 +1,5 @@
import {
_decorator,
Node,
Material,
Color,
UIRenderer,
Vec2,
UITransform,
} from 'cc'
import { Color, Material, Node, UIRenderer, UITransform, Vec2 } from 'cc'
import ShaderMaterialPrefab from '../../game/prefab/ShaderMaterialPrefab'
import { Logger } from './Logger'
export default class ShaderHelper {
/**
@@ -39,8 +30,8 @@ export default class ShaderHelper {
/**
* 设置图片灰白程度
* @param showNode
* @param grayLevel
* @param material
* @param grayLevel [0.0, 1.0]
*/
public static setGrayEffect(
showNode: Node,
@@ -85,7 +76,7 @@ export default class ShaderHelper {
/**
* 设置图片老化
* @param showNode
* @param grayLevel [0.0, 1.0]
* @param grayLevel
* @param material
*/
public static setOldPhotoEffect(
@@ -173,7 +164,7 @@ export default class ShaderHelper {
this.setGlowInner(showNode, {
glowColor: color,
glowColorSize: 0.015,
glowThreshold: 0.1,
glowThreshold: 0.1
})
}
@@ -193,14 +184,14 @@ export default class ShaderHelper {
this.setGlowInner(showNode, {
glowColor: color,
glowColorSize: 0.1,
glowThreshold: 0,
glowThreshold: 0
})
} else {
flashTimes++
this.setGlowInner(showNode, {
glowColor: color,
glowColorSize: 0,
glowThreshold: 0,
glowThreshold: 0
})
if (flashTimes > totalFlashTimes) {
clearInterval(intervalId)
@@ -250,7 +241,7 @@ export default class ShaderHelper {
masaicTimes -= 2
this.setMosaic(showNode, {
xBlockCount: masaicTimes,
yBlockCount: masaicTimes,
yBlockCount: masaicTimes
})
if (masaicTimes <= 30) {
clearInterval(intervalId)
@@ -264,7 +255,8 @@ export default class ShaderHelper {
/**
* 设置圆角剪切
* @param showNode
* @param roundCornerRadius [0, 1]
* @param roundCornerRadius
* @param material
*/
public static setRoundCornerCrop(
showNode: Node,

View File

@@ -1,4 +1,4 @@
import { sys, _decorator } from 'cc'
import { sys } from 'cc'
import ManifestConfig from '../config/ManifestConfig'
import EventManager from './EventManager'
import HotUpdate from './HotUpdate'
@@ -30,6 +30,7 @@ export default class VersionManager {
public init() {
this.reInitAll()
}
public reInitAll() {
this.releaseAll()
for (let i = 0; i < VersionManager.Config_Key.length; i++) {

View File

@@ -1,4 +1,3 @@
import { _decorator } from 'cc'
import { FishInfo } from './FishInfo'
export class FishConfig {
@@ -31,8 +30,9 @@ export class FishConfig {
new FishInfo(26, '美人鱼', 14, 0.4),
new FishInfo(27, '金龙', 14, 0.3),
new FishInfo(28, '章鱼', 10, 0.5),
new FishInfo(29, '电鳗鱼', 3, 0.8),
new FishInfo(29, '电鳗鱼', 3, 0.8)
]
public static getFishInfoByType(fishType: number) {
for (let i = 0; i < this.config.length; i++) {
let fishInfo: FishInfo = this.config[i]

View File

@@ -1,9 +1,9 @@
import { _decorator } from 'cc'
export class FishInfo {
public fishType: number
public name: string
public blood: number
public wikiScale: number
constructor(
fishType: number,
name: string,

View File

@@ -1,9 +1,9 @@
import { _decorator } from 'cc'
import { FishMapInfo } from './FishMapInfo'
export class FishMap {
public mapId: number
public fishMapInfoList: Array<FishMapInfo>
constructor(mapId: number, list: Array<FishMapInfo>) {
this.mapId = mapId
this.fishMapInfoList = list

View File

@@ -1,10 +1,10 @@
import { _decorator } from 'cc'
export class FishMapInfo {
public fishType: number
public scale: number
public side: number //1: -1:
public x: number
public y: number
constructor(
fishType: number,
scale: number,

View File

@@ -1,9 +1,8 @@
import { Vec2, _decorator } from 'cc'
import { Vec2 } from 'cc'
import { FishPathInfo } from './FishPathInfo'
import RandomUtil from '../../engine/utils/RandomUtil'
import { FishMapInfo } from './FishMapInfo'
import { FishMap } from './FishMap'
import { Logger } from '../../engine/utils/Logger'
export class FishPathConfig {
private static mapConfig: Array<Array<Array<number>>> = [
@@ -91,7 +90,7 @@ export class FishPathConfig {
[1, 1, 1, 754, -7],
[1, 1, 1, 671, 26],
[1, 1, 1, 630, 59],
[1, 1, 1, 584, 80],
[1, 1, 1, 584, 80]
],
[
[2, 1, 1, -784, 353],
@@ -136,7 +135,7 @@ export class FishPathConfig {
[3, 1, 1, 523, -253],
[3, 1, 1, 172, 128],
[3, 1, 1, -357, 30],
[3, 1, 1, 582, 23],
[3, 1, 1, 582, 23]
],
[
[5, 1, 1, -888, 405],
@@ -192,7 +191,7 @@ export class FishPathConfig {
[7, 1, 1, 340, -259],
[7, 1, 1, 485, -254],
[7, 1, 1, 622, -254],
[7, 1, 1, 816, -251],
[7, 1, 1, 816, -251]
],
[
[9, 1, 1, -513, 150],
@@ -223,7 +222,7 @@ export class FishPathConfig {
[9, 1, 1, 865, 195],
[9, 1, 1, 665, 207],
[17, 1, 1, -461, 2],
[17, 1, 1, 515, -49],
[17, 1, 1, 515, -49]
],
[
[19, 1, 1, -785, 31],
@@ -235,7 +234,7 @@ export class FishPathConfig {
[20, 1, 1, 425, -301],
[20, 1, 1, 537, 265],
[20, 1, 1, -604, 317],
[20, 1, 1, -634, -285],
[20, 1, 1, -634, -285]
],
[
[21, 1, 1, -757, 94],
@@ -246,12 +245,12 @@ export class FishPathConfig {
[21, 1, 1, -437, 300],
[21, 1, 1, -434, -155],
[21, 1, 1, 314, -154],
[21, 1, 1, 435, 249],
[21, 1, 1, 435, 249]
],
[
[22, 1, 1, -548, 65],
[22, 1, 1, 747, 61],
[22, 1, 1, 95, 63],
[22, 1, 1, 95, 63]
],
[
[23, 1, 1, -431, 384],
@@ -263,7 +262,7 @@ export class FishPathConfig {
[23, 1, 1, 1025, 60],
[23, 1, 1, 677, -247],
[23, 1, 1, 104, 390],
[23, 1, 1, 84, -265],
[23, 1, 1, 84, -265]
],
[
[24, 1, 1, -429, 353],
@@ -272,7 +271,7 @@ export class FishPathConfig {
[24, 1, 1, -27, 35],
[24, 1, 1, 563, 39],
[24, 1, 1, -268, -245],
[24, 1, 1, 172, -260],
[24, 1, 1, 172, -260]
],
[
[25, 1, 1, -595, 276],
@@ -280,27 +279,27 @@ export class FishPathConfig {
[25, 1, 1, -192, -64],
[25, 1, 1, 464, -46],
[25, 1, 1, 191, -280],
[25, 1, 1, 884, -319],
[25, 1, 1, 884, -319]
],
[
[26, 1, 1, -681, 441],
[26, 1, 1, 685, 426],
[26, 1, 1, -46, 140],
[26, 1, 1, -494, -207],
[26, 1, 1, 497, -238],
[26, 1, 1, 497, -238]
],
[
[27, 1, 1, -431, 345],
[27, 1, 1, 569, 311],
[27, 1, 1, 112, -12],
[27, 1, 1, -298, -271],
[27, 1, 1, 678, -244],
[27, 1, 1, 678, -244]
],
[
[28, 1, 1, -454, 8],
[28, 1, 1, 597, 1],
[28, 1, 1, 46, 431],
[28, 1, 1, 44, -227],
[28, 1, 1, 44, -227]
],
[
[2, 1, 1, -557, 409],
@@ -346,8 +345,8 @@ export class FishPathConfig {
[5, 1, 1, 407, -178],
[5, 1, 1, 297, 8],
[5, 1, 1, 625, 48],
[5, 1, 1, 379, 92],
],
[5, 1, 1, 379, 92]
]
]
private static formatMapConfig: Array<FishMap> = []
private static config: Array<Array<Array<number>>> = [
@@ -369,7 +368,7 @@ export class FishPathConfig {
[627, -511],
[762, -578],
[885, -667],
[1068, -773],
[1068, -773]
],
[
[-1295, 534],
@@ -386,7 +385,7 @@ export class FishPathConfig {
[753, 233],
[936, 279],
[1182, 350],
[1314, 418],
[1314, 418]
],
[
[-1295, 534],
@@ -403,7 +402,7 @@ export class FishPathConfig {
[827, -42],
[1020, -131],
[1189, -170],
[1309, -198],
[1309, -198]
],
[
[-1295, 534],
@@ -420,7 +419,7 @@ export class FishPathConfig {
[835, 88],
[1013, -2],
[1212, -99],
[1309, -198],
[1309, -198]
],
[
[-1275, -118],
@@ -437,7 +436,7 @@ export class FishPathConfig {
[772, 391],
[887, 426],
[1066, 513],
[1164, 710],
[1164, 710]
],
[
[-1299, -618],
@@ -454,7 +453,7 @@ export class FishPathConfig {
[904, 176],
[1090, 273],
[1208, 355],
[1308, 435],
[1308, 435]
],
[
[-1275, -118],
@@ -471,7 +470,7 @@ export class FishPathConfig {
[784, 266],
[935, 228],
[1157, 174],
[1329, 163],
[1329, 163]
],
[
[-1288, -220],
@@ -488,7 +487,7 @@ export class FishPathConfig {
[851, 203],
[1050, 141],
[1255, 58],
[1326, 20],
[1326, 20]
],
[
[-1288, -220],
@@ -505,7 +504,7 @@ export class FishPathConfig {
[993, -283],
[1090, -319],
[1242, -341],
[1329, -396],
[1329, -396]
],
[
[-1288, -220],
@@ -522,7 +521,7 @@ export class FishPathConfig {
[1011, -407],
[1095, -418],
[1238, -539],
[1317, -663],
[1317, -663]
],
[
[-1314, -508],
@@ -541,7 +540,7 @@ export class FishPathConfig {
[1093, 280],
[1026, 371],
[868, 631],
[648, 787],
[648, 787]
],
[
[-1314, -508],
@@ -560,7 +559,7 @@ export class FishPathConfig {
[1093, 280],
[1026, 371],
[868, 631],
[648, 787],
[648, 787]
],
[
[-1314, -508],
@@ -577,7 +576,7 @@ export class FishPathConfig {
[872, -200],
[1060, -391],
[1150, -492],
[1301, -461],
[1301, -461]
],
//右边开始
[
@@ -589,7 +588,7 @@ export class FishPathConfig {
[476, 57],
[467, 300],
[408, 500],
[405, 701],
[405, 701]
],
[
[1345, 34],
@@ -600,7 +599,7 @@ export class FishPathConfig {
[267, -29],
[66, -79],
[-219, -287],
[-271, -693],
[-271, -693]
],
[
[1345, 34],
@@ -615,7 +614,7 @@ export class FishPathConfig {
[-725, -92],
[-963, -68],
[-1169, -46],
[-1325, -40],
[-1325, -40]
],
[
[1345, 34],
@@ -630,7 +629,7 @@ export class FishPathConfig {
[-719, -199],
[-981, -264],
[-1180, -291],
[-1320, -367],
[-1320, -367]
],
[
[1345, 34],
@@ -645,7 +644,7 @@ export class FishPathConfig {
[-707, -320],
[-961, -408],
[-1160, -449],
[-1309, -524],
[-1309, -524]
],
[
[1345, 34],
@@ -660,7 +659,7 @@ export class FishPathConfig {
[-596, -448],
[-847, -604],
[-1019, -589],
[-1241, -695],
[-1241, -695]
],
[
[1345, 34],
@@ -675,7 +674,7 @@ export class FishPathConfig {
[-898, 66],
[-1070, 219],
[-1181, 292],
[-1289, 558],
[-1289, 558]
],
[
[1345, 34],
@@ -690,7 +689,7 @@ export class FishPathConfig {
[-806, 84],
[-905, 246],
[-1008, 375],
[-1021, 750],
[-1021, 750]
],
[
[1297, 542],
@@ -705,7 +704,7 @@ export class FishPathConfig {
[-806, 84],
[-905, 246],
[-1008, 375],
[-1021, 750],
[-1021, 750]
],
[
[1297, 542],
@@ -720,7 +719,7 @@ export class FishPathConfig {
[-806, 84],
[-927, 189],
[-1073, 291],
[-1318, 474],
[-1318, 474]
],
[
[1297, 542],
@@ -735,7 +734,7 @@ export class FishPathConfig {
[-775, -77],
[-923, -28],
[-1133, -46],
[-1294, -10],
[-1294, -10]
],
[
[1297, 542],
@@ -750,7 +749,7 @@ export class FishPathConfig {
[-616, -254],
[-854, -240],
[-1115, -272],
[-1312, -336],
[-1312, -336]
],
[
[1297, 542],
@@ -765,7 +764,7 @@ export class FishPathConfig {
[-562, -321],
[-647, -446],
[-930, -540],
[-1073, -726],
[-1073, -726]
],
[
[1293, -558],
@@ -780,7 +779,7 @@ export class FishPathConfig {
[-562, -321],
[-647, -446],
[-930, -540],
[-1073, -726],
[-1073, -726]
],
[
[1293, -558],
@@ -795,7 +794,7 @@ export class FishPathConfig {
[-568, -262],
[-857, -301],
[-1055, -406],
[-1353, -380],
[-1353, -380]
],
[
[1293, -558],
@@ -810,7 +809,7 @@ export class FishPathConfig {
[-590, -195],
[-905, -120],
[-1100, -72],
[-1300, 225],
[-1300, 225]
],
[
[1293, -558],
@@ -825,7 +824,7 @@ export class FishPathConfig {
[-633, -130],
[-917, 33],
[-1079, 184],
[-1220, 412],
[-1220, 412]
],
[
[1293, -558],
@@ -840,7 +839,7 @@ export class FishPathConfig {
[-602, -25],
[-857, 181],
[-921, 416],
[-909, 805],
[-909, 805]
],
//下往上
[
@@ -856,7 +855,7 @@ export class FishPathConfig {
[-602, -25],
[-857, 181],
[-921, 416],
[-909, 805],
[-909, 805]
],
[
[-279, -786],
@@ -871,7 +870,7 @@ export class FishPathConfig {
[-362, 152],
[-543, 358],
[-721, 502],
[-401, 770],
[-401, 770]
],
[
[-279, -786],
@@ -886,7 +885,7 @@ export class FishPathConfig {
[60, 214],
[-85, 418],
[-140, 630],
[-401, 770],
[-401, 770]
],
[
[-279, -786],
@@ -901,7 +900,7 @@ export class FishPathConfig {
[253, 319],
[330, 465],
[544, 684],
[858, 803],
[858, 803]
],
[
[841, -837],
@@ -916,8 +915,8 @@ export class FishPathConfig {
[253, 319],
[330, 465],
[544, 684],
[858, 803],
],
[858, 803]
]
]
private static formatConfig: Array<FishPathInfo> = []

View File

@@ -1,7 +1,9 @@
import { _decorator, Vec2 } from 'cc'
import { Vec2 } from 'cc'
export class FishPathInfo {
public pathId: number
public path: Array<Vec2> = []
constructor(pathId: number, path: Array<Vec2>) {
this.pathId = pathId
this.path = path

View File

@@ -1,4 +1,3 @@
import { _decorator } from 'cc'
export class GameConfig {
public static GameName: string = 'FishSingle'
}

View File

@@ -1,2 +1,2 @@
import { _decorator } from 'cc'
export default class GameEvent {}
export default class GameEvent {
}

View File

@@ -1,21 +1,16 @@
import {
_decorator,
Component,
Prefab,
NodePool,
Event,
Node,
Vec3,
Vec2,
EventTouch,
UITransform,
instantiate,
Node,
NodePool,
Prefab,
sys,
error,
UITransform,
Vec2,
Vec3
} from 'cc'
const { ccclass, property } = _decorator
import { Logger } from '../../engine/utils/Logger'
import FishBulletBase from '../../../fish/script/FishBulletBase'
import MathUtils from '../../engine/utils/MathUtils'
import CannonManager from './CannonManager'
@@ -25,18 +20,21 @@ import GameMusicHelper from '../utils/GameMusicHelper'
import FishUI from '../../../fish/script/FishUI'
import CommonTips from '../../engine/uicomponent/CommonTips'
const { ccclass, property } = _decorator
@ccclass('BulletManager')
export default class BulletManager extends Component {
public static instance: BulletManager = null
@property({ type: [Prefab] })
private bulletPrefabList: Prefab[] = []
private bulletPrefabList: Prefab[] | [] = []
private bulletPool: Array<NodePool> = []
private bulletList: Array<FishBulletBase> = []
private bulletMoveSpeed: number = 30
private _vec3Cache
private _vec2Cache
private _vec3Cache: Vec3
private _vec2Cache: Vec2
private _fireTime: number = 0
private _fireTimeNew: number
onLoad() {
this._vec3Cache = new Vec3()
this._vec2Cache = new Vec2()
@@ -45,7 +43,8 @@ export default class BulletManager extends Component {
// this.node.on(Node.EventType.TOUCH_MOVE, this.onShootBullet, this)
}
start() {}
start() {
}
update() {
this.checkMoveBullet()

View File

@@ -1,29 +1,18 @@
import {
_decorator,
Component,
Node,
SpriteFrame,
Event,
EventMouse,
Sprite,
Vec2,
UITransform,
Vec3,
} from 'cc'
const { ccclass, property } = _decorator
import { _decorator, Component, EventMouse, Node, Sprite, SpriteFrame, UITransform, Vec2, Vec3 } from 'cc'
import MathUtils from '../../engine/utils/MathUtils'
const { ccclass, property } = _decorator
@ccclass('CannonManager')
export default class CannonManager extends Component {
public static instance: CannonManager = null
@property({ type: Node })
private view: Node | null = null
@property({ type: [SpriteFrame] })
private cannonSpriteFrame: Array<SpriteFrame> = []
private cannonSpriteFrame: Array<SpriteFrame> | [] = []
// 炮塔倍数
public cannonType: number = 1
private _vec3Cache
private _vec3Cache: Vec3
onLoad() {
this._vec3Cache = new Vec3()
@@ -31,6 +20,7 @@ export default class CannonManager extends Component {
this.node.parent.on(Node.EventType.MOUSE_MOVE, this.onMeMove.bind(this))
this.refreshCannon()
}
private onMeMove(event: EventMouse) {
this.rotateCannon(event.getUILocation())
}
@@ -57,9 +47,11 @@ export default class CannonManager extends Component {
this.view.getComponent(Sprite).spriteFrame =
this.cannonSpriteFrame[this.cannonType - 1]
}
public getCannonPosition() {
return this.view.getPosition()
}
onDestroy() {
CannonManager.instance = null
}

View File

@@ -1,21 +1,6 @@
import {
_decorator,
Component,
Node,
Prefab,
NodePool,
game,
Vec3,
sys,
instantiate,
Animation,
Vec2,
} from 'cc'
const { ccclass, property } = _decorator
import { _decorator, Animation, Component, game, instantiate, Node, NodePool, Prefab, Vec2, Vec3 } from 'cc'
import RandomUtil from '../../engine/utils/RandomUtil'
import FishBase from '../../../fish/script/FishBase'
import { FishPathInfo } from '../config/FishPathInfo'
import { FishPathConfig } from '../config/FishPathConfig'
import FishMover from '../../../fish/script/FishMover'
import { Logger } from '../../engine/utils/Logger'
@@ -28,6 +13,8 @@ import { FishMapInfo } from '../config/FishMapInfo'
import FishUI from '../../../fish/script/FishUI'
import TimeHelper from '../utils/TimeHelper'
const { ccclass, property } = _decorator
@ccclass('FishManager')
export default class FishManager extends Component {
public static instance: FishManager = null
@@ -47,7 +34,8 @@ export default class FishManager extends Component {
// // private minMapCount: number = 2 * cc.game.getFrameRate();
// // private maxMapCount: number = 5 * cc.game.getFrameRate();
private _fishPosCache
private _fishPosCache: Vec3
onLoad() {
FishManager.instance = this
this._fishPosCache = new Vec3()

View File

@@ -1,23 +1,15 @@
import {
_decorator,
Component,
Prefab,
NodePool,
Vec2,
instantiate,
Vec3,
Node,
} from 'cc'
const { ccclass, property } = _decorator
import { _decorator, Component, instantiate, Node, NodePool, Prefab, Vec2, Vec3 } from 'cc'
import FishNetBase from '../../../fish/script/FishNetBase'
const { ccclass, property } = _decorator
@ccclass('FishNetManager')
export default class FishNetManager extends Component {
public static instance: FishNetManager = null
@property({ type: [Prefab] })
private netPrefabList: Prefab[] = []
private netPrefabList: Prefab[] | [] = []
private fishNetPool: Array<NodePool> = []
onLoad() {
FishNetManager.instance = this
}

View File

@@ -1,24 +1,16 @@
import {
_decorator,
Component,
Prefab,
NodePool,
Vec2,
instantiate,
Node,
Vec3,
} from 'cc'
const { ccclass, property } = _decorator
import { _decorator, Component, instantiate, Node, NodePool, Prefab, Vec2, Vec3 } from 'cc'
import ScorePrefab from '../prefab/ScorePrefab'
import FishUI from '../../../fish/script/FishUI'
const { ccclass, property } = _decorator
@ccclass('ScoreManager')
export default class ScoreManager extends Component {
public static instance: ScoreManager = null
@property({ type: Prefab })
private scrorePrefab: Prefab | null = null
private scorePool: NodePool
onLoad() {
ScoreManager.instance = this
this.scorePool = new NodePool()
@@ -50,7 +42,9 @@ export default class ScoreManager extends Component {
this.scorePool.put(scorePrefab.node)
}
onDisable() {}
onDisable() {
}
onDestroy() {
ScoreManager.instance = null
}

View File

@@ -1,9 +1,9 @@
import { _decorator, Component, Prefab, Node, instantiate } from 'cc'
const { ccclass, property } = _decorator
import { _decorator, Component, instantiate, Node, Prefab } from 'cc'
import PrefabLoader from '../../engine/utils/PrefabLoader'
import { GameConfig } from '../config/GameConfig'
const { ccclass, property } = _decorator
@ccclass('ResourcePrefab')
export default class ResourcePrefab extends Component {
private static prefab: Prefab | null = null

View File

@@ -1,4 +1,5 @@
import { _decorator, Component, Label, Vec2, tween, Vec3, Tween } from 'cc'
import { _decorator, Component, Label, tween, Tween, Vec2, Vec3 } from 'cc'
const { ccclass, property } = _decorator
@ccclass('ScorePrefab')

View File

@@ -1,9 +1,9 @@
import { _decorator, Component, Node, Material, instantiate, Prefab } from 'cc'
const { ccclass, property } = _decorator
import { _decorator, Component, instantiate, Material, Node, Prefab } from 'cc'
import PrefabLoader from '../../engine/utils/PrefabLoader'
import { GameConfig } from '../config/GameConfig'
const { ccclass, property } = _decorator
@ccclass('ShaderMaterialPrefab')
export default class ShaderMaterialPrefab extends Component {
public static instance: Node
@@ -27,6 +27,7 @@ export default class ShaderMaterialPrefab extends Component {
public flag: Material | null = null
@property({ type: Material })
public gaussian: Material | null = null
public static preLoad(): Promise<void> {
return new Promise((resolve, reject) => {
PrefabLoader.loadPrefab(

View File

@@ -1,6 +1,4 @@
import { _decorator, Sprite, Prefab, Node, instantiate, Vec3, Tween } from 'cc'
const { ccclass, property } = _decorator
import { _decorator, instantiate, Node, Prefab, Sprite, Tween, Vec3 } from 'cc'
import SceneBase from './SceneBase'
import TextureMgr from '../../engine/uicomponent/TextureMgr'
import RandomUtil from '../../engine/utils/RandomUtil'
@@ -11,13 +9,16 @@ import { Logger } from '../../engine/utils/Logger'
import FishWiki from '../../../fish/script/FishWiki'
import GameMusicHelper from '../utils/GameMusicHelper'
const { ccclass, property } = _decorator
@ccclass('FishGameScene')
export default class FishGameScene extends SceneBase {
@property(Sprite)
private bg: Sprite | null = null
@property({ type: [Prefab] })
private fishPrefabList: Array<Prefab> = []
private fishPrefabList: Array<Prefab> | null = []
private showNode: Node | null = null
onLoadMe() {
GameMusicHelper.playBg()
FishPathConfig.init()

View File

@@ -1,13 +1,4 @@
import {
_decorator,
Node,
sys,
profiler,
DynamicAtlasManager,
PhysicsSystem2D,
} from 'cc'
const { ccclass, property } = _decorator
import { _decorator, DynamicAtlasManager, Node, PhysicsSystem2D, profiler, sys } from 'cc'
import MusicConfig from '../../engine/config/MusicConfig'
import CommonTips from '../../engine/uicomponent/CommonTips'
import Progress from '../../engine/uicomponent/Progress'
@@ -19,12 +10,15 @@ import ResourcePreload from '../utils/ResourcePreload'
import SceneBase from './SceneBase'
import SceneManager from './SceneManager'
const { ccclass, property } = _decorator
@ccclass('LoadingScene')
export default class LoadingScene extends SceneBase {
public static scriptName: string = 'LoadingScene'
@property({ type: Node })
private progressNode: Node | null = null
onLoadMe() {
async onLoadMe() {
this.baseInit()
EventManager.instance.addListener(
HotUpdate.Event_On_NeedUpdate,
@@ -54,7 +48,7 @@ export default class LoadingScene extends SceneBase {
if (sys.isNative && VersionManager.instance.isOpenHotUpdate) {
this.checkUpdate()
} else {
this.preLoadRes()
await this.preLoadRes()
}
}
@@ -95,7 +89,7 @@ export default class LoadingScene extends SceneBase {
}
}
private onUpdateProgress(event, loadedFiles, totalFiles, key) {
private onUpdateProgress(event: Function, loadedFiles: number, totalFiles: number, key: string) {
if (key == VersionManager.Config_Key[0]) {
let msg: string =
Math.min(100, (loadedFiles / totalFiles) * 100).toFixed(2) + '%'

View File

@@ -1,25 +1,31 @@
import { _decorator, Component } from 'cc'
const { ccclass, property } = _decorator
import AdapterHelper from '../../engine/utils/AdapterHelper'
import PrefabLoader from '../../engine/utils/PrefabLoader'
import { Logger } from '../../engine/utils/Logger'
import ResourcePrefab from '../prefab/ResourcePrefab'
const { ccclass, property } = _decorator
@ccclass('SceneBase')
export default class SceneBase extends Component {
public static scriptName: string = 'SceneBase'
onLoad() {
AdapterHelper.fixApdater()
this.onLoadMe()
}
onLoadMe() {}
onLoadMe() {
}
start() {
this.onStartMe()
}
onStartMe() {}
onStartMe() {
}
onDestroy() {
this.onDestroyMe()
}
onDestroyMe() {}
onDestroyMe() {
}
}

View File

@@ -1,4 +1,4 @@
import { director, SceneAsset, sys, _decorator } from 'cc'
import { director, SceneAsset, sys } from 'cc'
import { Logger } from '../../engine/utils/Logger'
import LoadingScenePrefab from '../../engine/uicomponent/LoadingScenePrefab'
import CommonTips from '../../engine/uicomponent/CommonTips'
@@ -22,7 +22,7 @@ export default class SceneManager {
}
}
public sceneSwitch(name: string, showProgress: boolean = false) {
public async sceneSwitch(name: string, showProgress: boolean = false) {
if (this.loadingSceneName == name) return
Logger.log(this, 'sceneSwitch==', name)
if (sys.isBrowser) {
@@ -31,7 +31,7 @@ export default class SceneManager {
this.initFullScreenPrefab(false)
this.loadingSceneName = name
if (showProgress) {
LoadingScenePrefab.show()
await LoadingScenePrefab.show()
director.preloadScene(
name,
(completedCount: number, totalCount: number, item: any) => {

View File

@@ -1,15 +1,18 @@
import { _decorator } from 'cc'
const { ccclass, property } = _decorator
import EventManager, { HaoEvent } from '../../engine/utils/EventManager'
import SceneBase from './SceneBase'
import SceneManager from './SceneManager'
const { ccclass, property } = _decorator
@ccclass('StartScene')
export default class StartScene extends SceneBase {
public static scriptName: string = 'StartScene'
onLoadMe() {}
update() {}
onDestroyMe() {}
onLoadMe() {
}
update() {
}
onDestroyMe() {
}
}

View File

@@ -1,7 +1,7 @@
import { _decorator, Component, Vec2 } from 'cc'
const { ccclass, property } = _decorator
import { Logger } from '../../engine/utils/Logger'
export enum AstarGridType {
Hider = 0, //不能走
Normal = 1, //能走
@@ -27,7 +27,9 @@ export class Astar extends Component {
private closeList: Array<AstarGrid> = []
private path: Array<AstarGrid> = []
private gridsList: Array<Array<AstarGrid>> = []
onLoad() {}
onLoad() {
}
/**
* @param mapW 宽格子数
@@ -89,6 +91,7 @@ export class Astar extends Component {
* 开始搜索路径
* @param startPos
* @param endPos
* @param callback
*/
public findPath(startPos: Vec2, endPos: Vec2, callback: Function = null) {
let startGrid = this.gridsList[startPos.x][startPos.y]
@@ -192,5 +195,6 @@ export class Astar extends Component {
return this.path
}
onDestroy() {}
onDestroy() {
}
}

View File

@@ -1,4 +1,3 @@
import { _decorator } from 'cc'
import SoundPrefab from '../../engine/uicomponent/SoundPrefab'
import MusicPrefab from '../../engine/uicomponent/MusicPrefab'
import RandomUtil from '../../engine/utils/RandomUtil'

View File

@@ -1,11 +1,10 @@
import { error, game, _decorator } from 'cc'
import { error, game } from 'cc'
import DarkLayer from '../../engine/uicomponent/DarkLayer'
import LoadingPrefab from '../../engine/uicomponent/LoadingPrefab'
import LoadingScenePrefab from '../../engine/uicomponent/LoadingScenePrefab'
import MusicPrefab from '../../engine/uicomponent/MusicPrefab'
import Progress from '../../engine/uicomponent/Progress'
import SoundPrefab from '../../engine/uicomponent/SoundPrefab'
import { Logger } from '../../engine/utils/Logger'
import ResourcePrefab from '../prefab/ResourcePrefab'
import ShaderMaterialPrefab from '../prefab/ShaderMaterialPrefab'
@@ -15,6 +14,7 @@ export default class ResourcePreload {
private totalNum: number = 6
private nowIndex: number = 0
private progress: Progress
public async preLoad(callback: Function, progress: Progress) {
if (this.isPreloaded) {
callback()

View File

@@ -1,4 +1,4 @@
import { tween, Node } from 'cc'
import { Node, tween } from 'cc'
export default class TimeHelper {
public static exeNextFrame(node: Node, callback: Function) {

View File

@@ -1,9 +1,10 @@
import { _decorator, Component, Node } from 'cc'
import { _decorator, Component } from 'cc'
const { ccclass, property } = _decorator
@ccclass('UIRoot')
export class UIRoot extends Component {
public static Instance
public static Instance: UIRoot
onLoad() {
UIRoot.Instance = this
}

View File

@@ -6,5 +6,19 @@
"version": "3.8.2"
},
"_sourceId": "f769f6bf-2fe4-41a7-b7ad-f38f57e2d1b9",
"_storeId": "2898572b8dca79ebffc4f4584f234c2c"
"_storeId": "2898572b8dca79ebffc4f4584f234c2c",
"devDependencies": {
"@eslint/eslintrc": "^3.0.2",
"@eslint/js": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"acorn": "^8.11.3",
"eslint": "^9.0.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"globals": "^15.0.0",
"prettier": "^3.2.5",
"typescript": "^5.4.5"
}
}

1832
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"__version__": "3.0.5",
"game": {
"name": "未知游戏",
"name": "UNKNOW GAME",
"app_id": "UNKNOW",
"c_id": "0"
},

View File

@@ -4,19 +4,19 @@
"customSplash": {
"id": "customSplash",
"label": "customSplash",
"enable": true,
"enable": false,
"customSplash": {
"complete": false,
"form": "https://creator-api.cocos.com/api/form/show?sid=5d73e8c847732207609c34c0adf271fb"
"form": "https://creator-api.cocos.com/api/form/show?"
}
},
"removeSplash": {
"id": "removeSplash",
"label": "removeSplash",
"enable": true,
"enable": false,
"removeSplash": {
"complete": true,
"form": "https://creator-api.cocos.com/api/form/show?sid=5d73e8c847732207609c34c0adf271fb"
"complete": false,
"form": "https://creator-api.cocos.com/api/form/show?"
}
}
}