优化若干代码
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"image": {
|
"image": {
|
||||||
"type": "sprite-frame"
|
"type": "texture"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
5
.editorconfig
Normal file
5
.editorconfig
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
11
.eslintignore
Normal file
11
.eslintignore
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
.creator
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
.git
|
||||||
|
.DS_Store
|
||||||
|
/node_modules
|
||||||
|
/build
|
||||||
|
/temp
|
||||||
|
/library
|
||||||
|
/profiles
|
||||||
|
/settings
|
||||||
11
.prettierignore
Normal file
11
.prettierignore
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
.creator
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
.git
|
||||||
|
.DS_Store
|
||||||
|
/node_modules
|
||||||
|
/build
|
||||||
|
/temp
|
||||||
|
/library
|
||||||
|
/profiles
|
||||||
|
/settings
|
||||||
6
.prettierrc.json
Normal file
6
.prettierrc.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 100,
|
||||||
|
"singleQuote": true,
|
||||||
|
"semi": false,
|
||||||
|
"endOfLine": "lf"
|
||||||
|
}
|
||||||
@@ -7,32 +7,34 @@ import {
|
|||||||
Animation,
|
Animation,
|
||||||
Vec3,
|
Vec3,
|
||||||
} from 'cc'
|
} from 'cc'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
const {ccclass, property} = _decorator
|
||||||
|
|
||||||
import FishBase from './FishBase'
|
import FishBase from './FishBase'
|
||||||
import MathUtils from '../../script/engine/utils/MathUtils'
|
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'
|
import TimeHelper from '../../script/game/utils/TimeHelper'
|
||||||
|
|
||||||
@ccclass('FishMover')
|
@ccclass('FishMover')
|
||||||
export default class FishMover extends Component {
|
export default class FishMover extends Component {
|
||||||
// //鱼类型
|
//鱼类型
|
||||||
@property({ type: CCInteger })
|
@property({type: CCInteger})
|
||||||
public fishType: number = 1
|
public fishType: number = 1
|
||||||
// //鱼移动速度
|
//鱼移动速度
|
||||||
@property({ type: CCFloat })
|
@property({type: CCFloat})
|
||||||
public speed: number = 3
|
public speed: number = 3
|
||||||
// //下个位置移动点
|
//下个位置移动点
|
||||||
private targetMoveIndex: number = 0
|
private targetMoveIndex: number = 0
|
||||||
// //鱼移动位置
|
//鱼移动位置
|
||||||
public movePList: Array<Vec2> = []
|
public movePList: Array<Vec2> = []
|
||||||
// //贝萨尔曲线
|
//贝萨尔曲线
|
||||||
public bezierPList: Array<Vec2> = []
|
public bezierPList: Array<Vec2> = []
|
||||||
public isMoving: boolean = false
|
public isMoving: boolean = false
|
||||||
private minSpeed: number = 0.1
|
private minSpeed: number = 0.1
|
||||||
private moveCount: number = 1
|
private moveCount: number = 1
|
||||||
private totalTimes: number = 60 * 2
|
private totalTimes: number = 60 * 2
|
||||||
private _vec3Cahce: Vec3 = new Vec3()
|
private _vec3Cahce: Vec3 = new Vec3()
|
||||||
|
|
||||||
public startMove() {
|
public startMove() {
|
||||||
this.targetMoveIndex = 0
|
this.targetMoveIndex = 0
|
||||||
this.isMoving = true
|
this.isMoving = true
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { _decorator } from 'cc'
|
import { _decorator } from 'cc'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('CommonEvent')
|
@ccclass('CommonEvent')
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { _decorator } from 'cc'
|
|
||||||
import DateUtil from '../utils/DateUtil'
|
import DateUtil from '../utils/DateUtil'
|
||||||
import NetConfig from './NetConfig'
|
import NetConfig from './NetConfig'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { _decorator, AudioClip } from 'cc'
|
import { AudioClip } from 'cc'
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
|
|
||||||
export default class MusicConfig {
|
export default class MusicConfig {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { _decorator } from 'cc'
|
|
||||||
export default class NetConfig {
|
export default class NetConfig {
|
||||||
public static hotupdateUrl: string = 'http://localhost:33/hotupdate'
|
public static hotupdateUrl: string = 'http://localhost:33/hotupdate'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,10 @@
|
|||||||
import {
|
import { _decorator, Component, instantiate, Label, Node, tween, Vec3 } from 'cc'
|
||||||
_decorator,
|
|
||||||
Component,
|
|
||||||
Label,
|
|
||||||
Node,
|
|
||||||
tween,
|
|
||||||
Vec3,
|
|
||||||
instantiate,
|
|
||||||
} from 'cc'
|
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import PrefabLoader from '../utils/PrefabLoader'
|
import PrefabLoader from '../utils/PrefabLoader'
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
import DialogBase from './DialogBase'
|
import DialogBase from './DialogBase'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('CommonTips')
|
@ccclass('CommonTips')
|
||||||
export default class CommonTips extends Component {
|
export default class CommonTips extends Component {
|
||||||
public static TipsZorderIndex: number = 999
|
public static TipsZorderIndex: number = 999
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { _decorator, Component, Prefab, Widget, instantiate, Node } from 'cc'
|
import { _decorator, Component, instantiate, Node, Prefab, Widget } from 'cc'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import PrefabLoader from '../utils/PrefabLoader'
|
import PrefabLoader from '../utils/PrefabLoader'
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
import DialogBase from './DialogBase'
|
import DialogBase from './DialogBase'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('DarkLayer')
|
@ccclass('DarkLayer')
|
||||||
export default class DarkLayer extends Component {
|
export default class DarkLayer extends Component {
|
||||||
private static prefab: Prefab
|
private static prefab: Prefab
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { _decorator, Component, Node, Widget, director } from 'cc'
|
import { _decorator, Component, Node, Widget } from 'cc'
|
||||||
const { ccclass } = _decorator
|
|
||||||
|
|
||||||
import DarkLayer from './DarkLayer'
|
import DarkLayer from './DarkLayer'
|
||||||
import { UIRoot } from '../../game/utils/UIRoot'
|
import { UIRoot } from '../../game/utils/UIRoot'
|
||||||
|
|
||||||
|
const { ccclass } = _decorator
|
||||||
|
|
||||||
@ccclass('DialogBase')
|
@ccclass('DialogBase')
|
||||||
export default class DialogBase extends Component {
|
export default class DialogBase extends Component {
|
||||||
private static LocalZOrder: number = 5
|
private static LocalZOrder: number = 5
|
||||||
|
|||||||
@@ -1,19 +1,10 @@
|
|||||||
import {
|
import { _decorator, Component, instantiate, Node, Prefab, Quat, Vec3 } from 'cc'
|
||||||
_decorator,
|
|
||||||
Component,
|
|
||||||
Node,
|
|
||||||
Prefab,
|
|
||||||
instantiate,
|
|
||||||
math,
|
|
||||||
Quat,
|
|
||||||
Vec3,
|
|
||||||
} from 'cc'
|
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import PrefabLoader from '../utils/PrefabLoader'
|
import PrefabLoader from '../utils/PrefabLoader'
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
import DialogBase from './DialogBase'
|
import DialogBase from './DialogBase'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('LoadingPrefab')
|
@ccclass('LoadingPrefab')
|
||||||
export default class LoadingPrefab extends Component {
|
export default class LoadingPrefab extends Component {
|
||||||
public static instance: Node
|
public static instance: Node
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { _decorator, Component, Node, Prefab, instantiate } from 'cc'
|
import { _decorator, Component, instantiate, Node, Prefab } from 'cc'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import PrefabLoader from '../utils/PrefabLoader'
|
import PrefabLoader from '../utils/PrefabLoader'
|
||||||
import Progress from './Progress'
|
import Progress from './Progress'
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
import DialogBase from './DialogBase'
|
import DialogBase from './DialogBase'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('LoadingScenePrefab')
|
@ccclass('LoadingScenePrefab')
|
||||||
export default class LoadingScenePrefab extends Component {
|
export default class LoadingScenePrefab extends Component {
|
||||||
public static instance: Node
|
public static instance: Node
|
||||||
|
|||||||
@@ -1,19 +1,12 @@
|
|||||||
import {
|
import { _decorator, AssetManager, AudioClip, AudioSource, Component, instantiate, Prefab } from 'cc'
|
||||||
_decorator,
|
|
||||||
Component,
|
|
||||||
AssetManager,
|
|
||||||
AudioClip,
|
|
||||||
AudioSource,
|
|
||||||
instantiate,
|
|
||||||
Prefab,
|
|
||||||
} from 'cc'
|
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import { Logger } from '../utils/Logger'
|
import { Logger } from '../utils/Logger'
|
||||||
import PrefabLoader from '../utils/PrefabLoader'
|
import PrefabLoader from '../utils/PrefabLoader'
|
||||||
import LocalStorage from '../utils/LocalStorage'
|
import LocalStorage from '../utils/LocalStorage'
|
||||||
import MusicConfig from '../config/MusicConfig'
|
import MusicConfig from '../config/MusicConfig'
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 背景音乐
|
* 背景音乐
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { _decorator, Component, Label, ProgressBar } from 'cc'
|
import { _decorator, Component, Label, ProgressBar } from 'cc'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import { Logger } from '../utils/Logger'
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('Progress')
|
@ccclass('Progress')
|
||||||
export default class Progress extends Component {
|
export default class Progress extends Component {
|
||||||
|
|||||||
@@ -1,16 +1,4 @@
|
|||||||
import {
|
import { _decorator, AssetManager, AudioClip, AudioSource, Component, instantiate, Node, NodePool, Prefab } from 'cc'
|
||||||
_decorator,
|
|
||||||
Component,
|
|
||||||
Prefab,
|
|
||||||
NodePool,
|
|
||||||
Node,
|
|
||||||
instantiate,
|
|
||||||
AssetManager,
|
|
||||||
AudioClip,
|
|
||||||
AudioSource,
|
|
||||||
} from 'cc'
|
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import { Logger } from '../utils/Logger'
|
import { Logger } from '../utils/Logger'
|
||||||
import PrefabLoader from '../utils/PrefabLoader'
|
import PrefabLoader from '../utils/PrefabLoader'
|
||||||
import LocalStorage from '../utils/LocalStorage'
|
import LocalStorage from '../utils/LocalStorage'
|
||||||
@@ -18,6 +6,9 @@ import EventManager from '../utils/EventManager'
|
|||||||
import CommonEvent from '../config/CommonEvent'
|
import CommonEvent from '../config/CommonEvent'
|
||||||
import MusicConfig from '../config/MusicConfig'
|
import MusicConfig from '../config/MusicConfig'
|
||||||
import { GameConfig } from '../../game/config/GameConfig'
|
import { GameConfig } from '../../game/config/GameConfig'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 音效
|
// * 音效
|
||||||
// * Ios暂时有bug,弃用
|
// * Ios暂时有bug,弃用
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { _decorator, Component, SpriteFrame } from 'cc'
|
import { _decorator, Component, SpriteFrame } from 'cc'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('TextureMgr')
|
@ccclass('TextureMgr')
|
||||||
|
|||||||
@@ -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'
|
import DialogBase from '../uicomponent/DialogBase'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import { Logger } from './Logger'
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('AdapterHelper')
|
@ccclass('AdapterHelper')
|
||||||
export default class AdapterHelper {
|
export default class AdapterHelper {
|
||||||
public static winSizeWidth: number
|
public static winSizeWidth: number
|
||||||
public static winSizeHeiht: number
|
public static winSizeHeiht: number
|
||||||
|
|
||||||
public static fixApdater() {
|
public static fixApdater() {
|
||||||
log('v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true')
|
log('v3.6没找到接口修改 fitHeight、fitWidth, 先在项目里写死fitHeight=true')
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,17 +1,13 @@
|
|||||||
import { _decorator } from 'cc'
|
import { _decorator } from 'cc'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import { Logger } from './Logger'
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('BitUtil')
|
@ccclass('BitUtil')
|
||||||
export default class BitUtil {
|
export default class BitUtil {
|
||||||
//index是二进制从右到左
|
//index是二进制从右到左
|
||||||
public static isBitSet(value: number, index: number): boolean {
|
public static isBitSet(value: number, index: number): boolean {
|
||||||
let str: string = value.toString(2)
|
let str: string = value.toString(2)
|
||||||
if (parseInt(str[str.length - 1 - index]) == 1) {
|
return parseInt(str[str.length - 1 - index]) == 1
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//从右到左计算
|
//从右到左计算
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { _decorator, Color } from 'cc'
|
import { _decorator, Color } from 'cc'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('ColorHelper')
|
@ccclass('ColorHelper')
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
import { _decorator } from 'cc'
|
|
||||||
import { Logger } from './Logger'
|
|
||||||
|
|
||||||
export default class DateUtil {
|
export default class DateUtil {
|
||||||
public static formatNumStr(num: number) {
|
public static formatNumStr(num: number) {
|
||||||
let str = '' + num
|
let str = '' + num
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { _decorator, Node, Color, Button, Component, Slider } from 'cc'
|
import { Button, Color, Component, Node, Slider } from 'cc'
|
||||||
import { Logger } from './Logger'
|
|
||||||
import ColorHelper from './ColorHelper'
|
import ColorHelper from './ColorHelper'
|
||||||
|
|
||||||
export class HaoEvent {
|
export class HaoEvent {
|
||||||
public callback: Function
|
public callback: Function
|
||||||
public caller: any
|
public caller: any
|
||||||
public isStop: boolean
|
public isStop: boolean
|
||||||
|
|
||||||
constructor(callback: Function, caller: any) {
|
constructor(callback: Function, caller: any) {
|
||||||
this.callback = callback
|
this.callback = callback
|
||||||
this.caller = caller
|
this.caller = caller
|
||||||
@@ -18,7 +18,8 @@ export default class EventManager {
|
|||||||
|
|
||||||
private callbackList = {}
|
private callbackList = {}
|
||||||
|
|
||||||
public constructor() {}
|
public constructor() {
|
||||||
|
}
|
||||||
|
|
||||||
//注册事件
|
//注册事件
|
||||||
public addListener(eventName: string, callback: Function, caller: any) {
|
public addListener(eventName: string, callback: Function, caller: any) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { _decorator } from 'cc'
|
|
||||||
export default class Grid {
|
export default class Grid {
|
||||||
public row: number
|
public row: number
|
||||||
public col: number
|
public col: number
|
||||||
constructor(row: number, col) {
|
|
||||||
|
constructor(row: number, col: number) {
|
||||||
this.row = row
|
this.row = row
|
||||||
this.col = col
|
this.col = col
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
import { _decorator } from 'cc'
|
|
||||||
import { Logger } from './Logger'
|
|
||||||
|
|
||||||
export default class HaoEncrypt {
|
export default class HaoEncrypt {
|
||||||
public static encode(str: string) {
|
public static encode(str: string) {
|
||||||
let result: string = ''
|
let result: string = ''
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { sys, _decorator, native, System } from 'cc'
|
import { native, sys } from 'cc'
|
||||||
import { Logger } from './Logger'
|
import { Logger } from './Logger'
|
||||||
import EventManager from './EventManager'
|
import EventManager from './EventManager'
|
||||||
import VersionManager from './VersionManager'
|
import VersionManager from './VersionManager'
|
||||||
@@ -15,7 +15,7 @@ export default class HotUpdate {
|
|||||||
'HotUpdate_Event_On_ALREADY_UP_TO_DATE'
|
'HotUpdate_Event_On_ALREADY_UP_TO_DATE'
|
||||||
public static Event_On_Fail_Update: string = 'HotUpdate_Event_On_Fail_Update'
|
public static Event_On_Fail_Update: string = 'HotUpdate_Event_On_Fail_Update'
|
||||||
private _am: any
|
private _am: any
|
||||||
private _checkListener
|
private _checkListener: null
|
||||||
private storagePath: string
|
private storagePath: string
|
||||||
private manifestUrl: string
|
private manifestUrl: string
|
||||||
private localBigVersion: number
|
private localBigVersion: number
|
||||||
@@ -26,7 +26,10 @@ export default class HotUpdate {
|
|||||||
public isCheck: boolean
|
public isCheck: boolean
|
||||||
private key: string
|
private key: string
|
||||||
private hotupdateIndex: number
|
private hotupdateIndex: number
|
||||||
constructor() {}
|
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
|
||||||
public init(
|
public init(
|
||||||
index: number,
|
index: number,
|
||||||
key: string = 'Code-remote-asset',
|
key: string = 'Code-remote-asset',
|
||||||
@@ -36,16 +39,7 @@ export default class HotUpdate {
|
|||||||
this.hotupdateIndex = index
|
this.hotupdateIndex = index
|
||||||
this.key = key
|
this.key = key
|
||||||
this.manifestUrl = manifestUrl
|
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报错了'
|
this.storagePath = '获取this.storagePath报错了'
|
||||||
}
|
|
||||||
|
|
||||||
Logger.log(this, 'init removeDirectory=', this.storagePath + '_temp')
|
Logger.log(this, 'init removeDirectory=', this.storagePath + '_temp')
|
||||||
}
|
}
|
||||||
@@ -88,7 +82,7 @@ export default class HotUpdate {
|
|||||||
this.showPackUpdateDialog()
|
this.showPackUpdateDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
private checkCb(event) {
|
private checkCb(event: any) {
|
||||||
Logger.log(this, 'checkCb Code: =================' + event.getEventCode())
|
Logger.log(this, 'checkCb Code: =================' + event.getEventCode())
|
||||||
switch (event.getEventCode()) {
|
switch (event.getEventCode()) {
|
||||||
case native.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST:
|
case native.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST:
|
||||||
@@ -207,7 +201,7 @@ export default class HotUpdate {
|
|||||||
let manifestStr: string = ManifestConfig.getManifestStr(hotupdateUrlKey)
|
let manifestStr: string = ManifestConfig.getManifestStr(hotupdateUrlKey)
|
||||||
Logger.log(this, 'checkUpdate=======manifestStr=======', manifestStr)
|
Logger.log(this, 'checkUpdate=======manifestStr=======', manifestStr)
|
||||||
let manifest = new native.Manifest(manifestStr, this.storagePath)
|
let manifest = new native.Manifest(manifestStr, this.storagePath)
|
||||||
this._am.setVerifyCallback(function (filePath, asset) {
|
this._am.setVerifyCallback(function(filePath, asset) {
|
||||||
return true
|
return true
|
||||||
// var md5 = calculateMD5(filePath);
|
// var md5 = calculateMD5(filePath);
|
||||||
// if (md5 === asset.md5)
|
// if (md5 === asset.md5)
|
||||||
@@ -225,11 +219,10 @@ export default class HotUpdate {
|
|||||||
/**
|
/**
|
||||||
* @param versionA 本地版本 1.0.0
|
* @param versionA 本地版本 1.0.0
|
||||||
* @param versionB 服务器版本 1.0.1
|
* @param versionB 服务器版本 1.0.1
|
||||||
* @param return -1需要更新 不用更新
|
|
||||||
*/
|
*/
|
||||||
private versionCompareHandle(versionA, versionB) {
|
private versionCompareHandle(versionA: string, versionB: string) {
|
||||||
var vA = versionA.split('.')
|
const vA = versionA.split('.')
|
||||||
var vB = versionB.split('.')
|
const vB = versionB.split('.')
|
||||||
Logger.log(
|
Logger.log(
|
||||||
this,
|
this,
|
||||||
'versionCompareHandle======',
|
'versionCompareHandle======',
|
||||||
@@ -243,14 +236,10 @@ export default class HotUpdate {
|
|||||||
}
|
}
|
||||||
this.localBigVersion = parseInt(vA[0])
|
this.localBigVersion = parseInt(vA[0])
|
||||||
this.remoteBigVersion = parseInt(vB[0])
|
this.remoteBigVersion = parseInt(vB[0])
|
||||||
for (var i = 0; i < vA.length; ++i) {
|
for (let i = 0; i < vA.length; ++i) {
|
||||||
var a = parseInt(vA[i])
|
const a = parseInt(vA[i])
|
||||||
var b = parseInt(vB[i] || 0)
|
const b = parseInt(vB[i] || '0')
|
||||||
if (a === b) {
|
if (a !== b) return a - b
|
||||||
continue
|
|
||||||
} else {
|
|
||||||
return a - b
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (vB.length > vA.length) {
|
if (vB.length > vA.length) {
|
||||||
return -1
|
return -1
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import { _decorator } from 'cc'
|
import { _decorator } from 'cc'
|
||||||
const { ccclass } = _decorator
|
|
||||||
|
|
||||||
import LoadingPrefab from '../uicomponent/LoadingPrefab'
|
|
||||||
import VersionManager from './VersionManager'
|
|
||||||
import { Logger } from './Logger'
|
import { Logger } from './Logger'
|
||||||
|
|
||||||
|
const { ccclass } = _decorator
|
||||||
|
|
||||||
@ccclass('HttpClient')
|
@ccclass('HttpClient')
|
||||||
export default class HttpClient {
|
export default class HttpClient {
|
||||||
public static instance: HttpClient //= new HttpClient();
|
public static instance: HttpClient //= new HttpClient();
|
||||||
@@ -46,7 +44,8 @@ export default class HttpClient {
|
|||||||
this.responseType = responseType
|
this.responseType = responseType
|
||||||
}
|
}
|
||||||
|
|
||||||
public setContentType() {}
|
public setContentType() {
|
||||||
|
}
|
||||||
|
|
||||||
public request(
|
public request(
|
||||||
url: string,
|
url: string,
|
||||||
@@ -156,5 +155,6 @@ export default class HttpClient {
|
|||||||
xhr.send(params)
|
xhr.send(params)
|
||||||
}
|
}
|
||||||
|
|
||||||
public getInfo(callback: Function = null) {}
|
public getInfo(callback: Function = null) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { sys, _decorator } from 'cc'
|
import { sys } from 'cc'
|
||||||
import { Logger } from './Logger'
|
|
||||||
|
|
||||||
export default class LocalStorage {
|
export default class LocalStorage {
|
||||||
public static GamePreFlag: string = 'fengshen-game-HaoLocalStorage'
|
public static GamePreFlag: string = 'fengshen-game-HaoLocalStorage'
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { error, _decorator } from 'cc'
|
|
||||||
class LOG_LEVEL_TYPES {
|
class LOG_LEVEL_TYPES {
|
||||||
public static DEBUG = 0
|
public static DEBUG = 0
|
||||||
public static LOG = 1
|
public static LOG = 1
|
||||||
@@ -6,6 +5,7 @@ class LOG_LEVEL_TYPES {
|
|||||||
public static WARN = 3
|
public static WARN = 3
|
||||||
public static ERROR = 4
|
public static ERROR = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
const Log_Level_Names: Array<string> = ['debug', 'log', 'info', 'warn', 'error']
|
const Log_Level_Names: Array<string> = ['debug', 'log', 'info', 'warn', 'error']
|
||||||
|
|
||||||
export class Logger {
|
export class Logger {
|
||||||
@@ -16,9 +16,10 @@ export class Logger {
|
|||||||
'color:#000;font-size:11px;',
|
'color:#000;font-size:11px;',
|
||||||
'color:#09f;font-size:12px;',
|
'color:#09f;font-size:12px;',
|
||||||
'color:#f90;font-size:13px;',
|
'color:#f90;font-size:13px;',
|
||||||
'color:#f00;font-size:15px;',
|
'color:#f00;font-size:15px;'
|
||||||
]
|
]
|
||||||
private static Terminal_Log: boolean = false
|
private static Terminal_Log: boolean = false
|
||||||
|
|
||||||
public static formatNow() {
|
public static formatNow() {
|
||||||
let date: Date = new Date() //后端返回的时间戳是秒
|
let date: Date = new Date() //后端返回的时间戳是秒
|
||||||
return (
|
return (
|
||||||
@@ -37,17 +38,17 @@ export class Logger {
|
|||||||
date.getMilliseconds()
|
date.getMilliseconds()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private static getLogPreKey(nowLevel: number): string {
|
private static getLogPreKey(nowLevel: number): string {
|
||||||
let str: string =
|
return '[' +
|
||||||
'[' +
|
|
||||||
Logger.formatNow() +
|
Logger.formatNow() +
|
||||||
'] ' +
|
'] ' +
|
||||||
Logger.tag +
|
Logger.tag +
|
||||||
' [' +
|
' [' +
|
||||||
Log_Level_Names[nowLevel] +
|
Log_Level_Names[nowLevel] +
|
||||||
'] '
|
'] '
|
||||||
return str
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static debug(...params: any) {
|
public static debug(...params: any) {
|
||||||
if (Logger.LEVEL > LOG_LEVEL_TYPES.DEBUG) {
|
if (Logger.LEVEL > LOG_LEVEL_TYPES.DEBUG) {
|
||||||
return
|
return
|
||||||
@@ -65,6 +66,7 @@ export class Logger {
|
|||||||
console.info(fileStr)
|
console.info(fileStr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static log(...params: any) {
|
public static log(...params: any) {
|
||||||
if (Logger.LEVEL > LOG_LEVEL_TYPES.LOG) {
|
if (Logger.LEVEL > LOG_LEVEL_TYPES.LOG) {
|
||||||
return
|
return
|
||||||
@@ -82,6 +84,7 @@ export class Logger {
|
|||||||
console.info(fileStr) //console.log(str, ...params)
|
console.info(fileStr) //console.log(str, ...params)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static info(...params: any) {
|
public static info(...params: any) {
|
||||||
if (Logger.LEVEL > LOG_LEVEL_TYPES.INFO) {
|
if (Logger.LEVEL > LOG_LEVEL_TYPES.INFO) {
|
||||||
return
|
return
|
||||||
@@ -98,6 +101,7 @@ export class Logger {
|
|||||||
console.info(fileStr)
|
console.info(fileStr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static warn(...params: any) {
|
public static warn(...params: any) {
|
||||||
if (Logger.LEVEL > LOG_LEVEL_TYPES.WARN) {
|
if (Logger.LEVEL > LOG_LEVEL_TYPES.WARN) {
|
||||||
return
|
return
|
||||||
@@ -114,6 +118,7 @@ export class Logger {
|
|||||||
console.warn(fileStr)
|
console.warn(fileStr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static error(...params: any) {
|
public static error(...params: any) {
|
||||||
if (Logger.LEVEL > LOG_LEVEL_TYPES.ERROR) {
|
if (Logger.LEVEL > LOG_LEVEL_TYPES.ERROR) {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import { _decorator, Vec2 } from 'cc'
|
import { Vec2 } from 'cc'
|
||||||
|
|
||||||
export default class MathUtils {
|
export default class MathUtils {
|
||||||
/**
|
/**
|
||||||
* 2个点之前的直线距离
|
* 2个点之前的直线距离
|
||||||
* @param p1
|
* @param x1
|
||||||
* @param p2
|
* @param y1
|
||||||
|
* @param x2
|
||||||
|
* @param y2
|
||||||
*/
|
*/
|
||||||
public static distance(x1: number, y1: number, x2: number, y2: number) {
|
public static distance(x1: number, y1: number, x2: number, y2: number) {
|
||||||
// 设两点A(X1,Y1),B(X2,Y2)
|
// 设两点A(X1,Y1),B(X2,Y2)
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { _decorator, Node, Vec3, Vec2 } from 'cc'
|
import { Node, Vec2, Vec3 } from 'cc'
|
||||||
import { Logger } from './Logger'
|
|
||||||
import MathUtils from './MathUtils'
|
import MathUtils from './MathUtils'
|
||||||
|
|
||||||
export class MoveHelper {
|
export class MoveHelper {
|
||||||
public static _vec3: Vec3 = new Vec3()
|
public static _vec3: Vec3 = new Vec3()
|
||||||
public static _vec2_0: Vec2 = new Vec2()
|
public static _vec2_0: Vec2 = new Vec2()
|
||||||
public static _vec2_1: Vec2 = new Vec2()
|
public static _vec2_1: Vec2 = new Vec2()
|
||||||
|
|
||||||
public static moveNode(
|
public static moveNode(
|
||||||
moveNode: Node,
|
moveNode: Node,
|
||||||
speed: number,
|
speed: number,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { AssetManager, Prefab, _decorator } from 'cc'
|
import { _decorator, AssetManager, Prefab } from 'cc'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import { Logger } from './Logger'
|
import { Logger } from './Logger'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('PrefabLoader')
|
@ccclass('PrefabLoader')
|
||||||
export default class PrefabLoader {
|
export default class PrefabLoader {
|
||||||
private static isLoading: boolean = false
|
private static isLoading: boolean = false
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Vec2, _decorator } from 'cc'
|
import { Vec2 } from 'cc'
|
||||||
|
|
||||||
export default class RandomUtil {
|
export default class RandomUtil {
|
||||||
//随机minNum到maxNum的数字 (包含maxNum)
|
//随机minNum到maxNum的数字 (包含maxNum)
|
||||||
public static nextInt(minNum: number, maxNum: number) {
|
public static nextInt(minNum: number, maxNum: number) {
|
||||||
@@ -19,10 +20,8 @@ export default class RandomUtil {
|
|||||||
|
|
||||||
public static nextBoolean() {
|
public static nextBoolean() {
|
||||||
let temp = Math.random()
|
let temp = Math.random()
|
||||||
if (temp < 0.5) {
|
return temp < 0.5;
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static randomArr(nowArr: Array<any>, needNum: number) {
|
public static randomArr(nowArr: Array<any>, needNum: number) {
|
||||||
|
|||||||
@@ -1,14 +1,5 @@
|
|||||||
import {
|
import { Color, Material, Node, UIRenderer, UITransform, Vec2 } from 'cc'
|
||||||
_decorator,
|
|
||||||
Node,
|
|
||||||
Material,
|
|
||||||
Color,
|
|
||||||
UIRenderer,
|
|
||||||
Vec2,
|
|
||||||
UITransform,
|
|
||||||
} from 'cc'
|
|
||||||
import ShaderMaterialPrefab from '../../game/prefab/ShaderMaterialPrefab'
|
import ShaderMaterialPrefab from '../../game/prefab/ShaderMaterialPrefab'
|
||||||
import { Logger } from './Logger'
|
|
||||||
|
|
||||||
export default class ShaderHelper {
|
export default class ShaderHelper {
|
||||||
/**
|
/**
|
||||||
@@ -39,8 +30,8 @@ export default class ShaderHelper {
|
|||||||
/**
|
/**
|
||||||
* 设置图片灰白程度
|
* 设置图片灰白程度
|
||||||
* @param showNode
|
* @param showNode
|
||||||
|
* @param grayLevel
|
||||||
* @param material
|
* @param material
|
||||||
* @param grayLevel [0.0, 1.0]
|
|
||||||
*/
|
*/
|
||||||
public static setGrayEffect(
|
public static setGrayEffect(
|
||||||
showNode: Node,
|
showNode: Node,
|
||||||
@@ -85,7 +76,7 @@ export default class ShaderHelper {
|
|||||||
/**
|
/**
|
||||||
* 设置图片老化
|
* 设置图片老化
|
||||||
* @param showNode
|
* @param showNode
|
||||||
* @param grayLevel [0.0, 1.0]
|
* @param grayLevel
|
||||||
* @param material
|
* @param material
|
||||||
*/
|
*/
|
||||||
public static setOldPhotoEffect(
|
public static setOldPhotoEffect(
|
||||||
@@ -173,7 +164,7 @@ export default class ShaderHelper {
|
|||||||
this.setGlowInner(showNode, {
|
this.setGlowInner(showNode, {
|
||||||
glowColor: color,
|
glowColor: color,
|
||||||
glowColorSize: 0.015,
|
glowColorSize: 0.015,
|
||||||
glowThreshold: 0.1,
|
glowThreshold: 0.1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,14 +184,14 @@ export default class ShaderHelper {
|
|||||||
this.setGlowInner(showNode, {
|
this.setGlowInner(showNode, {
|
||||||
glowColor: color,
|
glowColor: color,
|
||||||
glowColorSize: 0.1,
|
glowColorSize: 0.1,
|
||||||
glowThreshold: 0,
|
glowThreshold: 0
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
flashTimes++
|
flashTimes++
|
||||||
this.setGlowInner(showNode, {
|
this.setGlowInner(showNode, {
|
||||||
glowColor: color,
|
glowColor: color,
|
||||||
glowColorSize: 0,
|
glowColorSize: 0,
|
||||||
glowThreshold: 0,
|
glowThreshold: 0
|
||||||
})
|
})
|
||||||
if (flashTimes > totalFlashTimes) {
|
if (flashTimes > totalFlashTimes) {
|
||||||
clearInterval(intervalId)
|
clearInterval(intervalId)
|
||||||
@@ -250,7 +241,7 @@ export default class ShaderHelper {
|
|||||||
masaicTimes -= 2
|
masaicTimes -= 2
|
||||||
this.setMosaic(showNode, {
|
this.setMosaic(showNode, {
|
||||||
xBlockCount: masaicTimes,
|
xBlockCount: masaicTimes,
|
||||||
yBlockCount: masaicTimes,
|
yBlockCount: masaicTimes
|
||||||
})
|
})
|
||||||
if (masaicTimes <= 30) {
|
if (masaicTimes <= 30) {
|
||||||
clearInterval(intervalId)
|
clearInterval(intervalId)
|
||||||
@@ -264,7 +255,8 @@ export default class ShaderHelper {
|
|||||||
/**
|
/**
|
||||||
* 设置圆角剪切
|
* 设置圆角剪切
|
||||||
* @param showNode
|
* @param showNode
|
||||||
* @param roundCornerRadius [0, 1]
|
* @param roundCornerRadius
|
||||||
|
* @param material
|
||||||
*/
|
*/
|
||||||
public static setRoundCornerCrop(
|
public static setRoundCornerCrop(
|
||||||
showNode: Node,
|
showNode: Node,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { sys, _decorator } from 'cc'
|
import { sys } from 'cc'
|
||||||
import ManifestConfig from '../config/ManifestConfig'
|
import ManifestConfig from '../config/ManifestConfig'
|
||||||
import EventManager from './EventManager'
|
import EventManager from './EventManager'
|
||||||
import HotUpdate from './HotUpdate'
|
import HotUpdate from './HotUpdate'
|
||||||
@@ -30,6 +30,7 @@ export default class VersionManager {
|
|||||||
public init() {
|
public init() {
|
||||||
this.reInitAll()
|
this.reInitAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
public reInitAll() {
|
public reInitAll() {
|
||||||
this.releaseAll()
|
this.releaseAll()
|
||||||
for (let i = 0; i < VersionManager.Config_Key.length; i++) {
|
for (let i = 0; i < VersionManager.Config_Key.length; i++) {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { _decorator } from 'cc'
|
|
||||||
import { FishInfo } from './FishInfo'
|
import { FishInfo } from './FishInfo'
|
||||||
|
|
||||||
export class FishConfig {
|
export class FishConfig {
|
||||||
@@ -31,8 +30,9 @@ export class FishConfig {
|
|||||||
new FishInfo(26, '美人鱼', 14, 0.4),
|
new FishInfo(26, '美人鱼', 14, 0.4),
|
||||||
new FishInfo(27, '金龙', 14, 0.3),
|
new FishInfo(27, '金龙', 14, 0.3),
|
||||||
new FishInfo(28, '章鱼', 10, 0.5),
|
new FishInfo(28, '章鱼', 10, 0.5),
|
||||||
new FishInfo(29, '电鳗鱼', 3, 0.8),
|
new FishInfo(29, '电鳗鱼', 3, 0.8)
|
||||||
]
|
]
|
||||||
|
|
||||||
public static getFishInfoByType(fishType: number) {
|
public static getFishInfoByType(fishType: number) {
|
||||||
for (let i = 0; i < this.config.length; i++) {
|
for (let i = 0; i < this.config.length; i++) {
|
||||||
let fishInfo: FishInfo = this.config[i]
|
let fishInfo: FishInfo = this.config[i]
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { _decorator } from 'cc'
|
|
||||||
export class FishInfo {
|
export class FishInfo {
|
||||||
public fishType: number
|
public fishType: number
|
||||||
public name: string
|
public name: string
|
||||||
public blood: number
|
public blood: number
|
||||||
public wikiScale: number
|
public wikiScale: number
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
fishType: number,
|
fishType: number,
|
||||||
name: string,
|
name: string,
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { _decorator } from 'cc'
|
|
||||||
import { FishMapInfo } from './FishMapInfo'
|
import { FishMapInfo } from './FishMapInfo'
|
||||||
|
|
||||||
export class FishMap {
|
export class FishMap {
|
||||||
public mapId: number
|
public mapId: number
|
||||||
public fishMapInfoList: Array<FishMapInfo>
|
public fishMapInfoList: Array<FishMapInfo>
|
||||||
|
|
||||||
constructor(mapId: number, list: Array<FishMapInfo>) {
|
constructor(mapId: number, list: Array<FishMapInfo>) {
|
||||||
this.mapId = mapId
|
this.mapId = mapId
|
||||||
this.fishMapInfoList = list
|
this.fishMapInfoList = list
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { _decorator } from 'cc'
|
|
||||||
export class FishMapInfo {
|
export class FishMapInfo {
|
||||||
public fishType: number
|
public fishType: number
|
||||||
public scale: number
|
public scale: number
|
||||||
public side: number //1: -1:
|
public side: number //1: -1:
|
||||||
public x: number
|
public x: number
|
||||||
public y: number
|
public y: number
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
fishType: number,
|
fishType: number,
|
||||||
scale: number,
|
scale: number,
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import { Vec2, _decorator } from 'cc'
|
import { Vec2 } from 'cc'
|
||||||
import { FishPathInfo } from './FishPathInfo'
|
import { FishPathInfo } from './FishPathInfo'
|
||||||
import RandomUtil from '../../engine/utils/RandomUtil'
|
import RandomUtil from '../../engine/utils/RandomUtil'
|
||||||
import { FishMapInfo } from './FishMapInfo'
|
import { FishMapInfo } from './FishMapInfo'
|
||||||
import { FishMap } from './FishMap'
|
import { FishMap } from './FishMap'
|
||||||
import { Logger } from '../../engine/utils/Logger'
|
|
||||||
|
|
||||||
export class FishPathConfig {
|
export class FishPathConfig {
|
||||||
private static mapConfig: Array<Array<Array<number>>> = [
|
private static mapConfig: Array<Array<Array<number>>> = [
|
||||||
@@ -91,7 +90,7 @@ export class FishPathConfig {
|
|||||||
[1, 1, 1, 754, -7],
|
[1, 1, 1, 754, -7],
|
||||||
[1, 1, 1, 671, 26],
|
[1, 1, 1, 671, 26],
|
||||||
[1, 1, 1, 630, 59],
|
[1, 1, 1, 630, 59],
|
||||||
[1, 1, 1, 584, 80],
|
[1, 1, 1, 584, 80]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[2, 1, 1, -784, 353],
|
[2, 1, 1, -784, 353],
|
||||||
@@ -136,7 +135,7 @@ export class FishPathConfig {
|
|||||||
[3, 1, 1, 523, -253],
|
[3, 1, 1, 523, -253],
|
||||||
[3, 1, 1, 172, 128],
|
[3, 1, 1, 172, 128],
|
||||||
[3, 1, 1, -357, 30],
|
[3, 1, 1, -357, 30],
|
||||||
[3, 1, 1, 582, 23],
|
[3, 1, 1, 582, 23]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[5, 1, 1, -888, 405],
|
[5, 1, 1, -888, 405],
|
||||||
@@ -192,7 +191,7 @@ export class FishPathConfig {
|
|||||||
[7, 1, 1, 340, -259],
|
[7, 1, 1, 340, -259],
|
||||||
[7, 1, 1, 485, -254],
|
[7, 1, 1, 485, -254],
|
||||||
[7, 1, 1, 622, -254],
|
[7, 1, 1, 622, -254],
|
||||||
[7, 1, 1, 816, -251],
|
[7, 1, 1, 816, -251]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[9, 1, 1, -513, 150],
|
[9, 1, 1, -513, 150],
|
||||||
@@ -223,7 +222,7 @@ export class FishPathConfig {
|
|||||||
[9, 1, 1, 865, 195],
|
[9, 1, 1, 865, 195],
|
||||||
[9, 1, 1, 665, 207],
|
[9, 1, 1, 665, 207],
|
||||||
[17, 1, 1, -461, 2],
|
[17, 1, 1, -461, 2],
|
||||||
[17, 1, 1, 515, -49],
|
[17, 1, 1, 515, -49]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[19, 1, 1, -785, 31],
|
[19, 1, 1, -785, 31],
|
||||||
@@ -235,7 +234,7 @@ export class FishPathConfig {
|
|||||||
[20, 1, 1, 425, -301],
|
[20, 1, 1, 425, -301],
|
||||||
[20, 1, 1, 537, 265],
|
[20, 1, 1, 537, 265],
|
||||||
[20, 1, 1, -604, 317],
|
[20, 1, 1, -604, 317],
|
||||||
[20, 1, 1, -634, -285],
|
[20, 1, 1, -634, -285]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[21, 1, 1, -757, 94],
|
[21, 1, 1, -757, 94],
|
||||||
@@ -246,12 +245,12 @@ export class FishPathConfig {
|
|||||||
[21, 1, 1, -437, 300],
|
[21, 1, 1, -437, 300],
|
||||||
[21, 1, 1, -434, -155],
|
[21, 1, 1, -434, -155],
|
||||||
[21, 1, 1, 314, -154],
|
[21, 1, 1, 314, -154],
|
||||||
[21, 1, 1, 435, 249],
|
[21, 1, 1, 435, 249]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[22, 1, 1, -548, 65],
|
[22, 1, 1, -548, 65],
|
||||||
[22, 1, 1, 747, 61],
|
[22, 1, 1, 747, 61],
|
||||||
[22, 1, 1, 95, 63],
|
[22, 1, 1, 95, 63]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[23, 1, 1, -431, 384],
|
[23, 1, 1, -431, 384],
|
||||||
@@ -263,7 +262,7 @@ export class FishPathConfig {
|
|||||||
[23, 1, 1, 1025, 60],
|
[23, 1, 1, 1025, 60],
|
||||||
[23, 1, 1, 677, -247],
|
[23, 1, 1, 677, -247],
|
||||||
[23, 1, 1, 104, 390],
|
[23, 1, 1, 104, 390],
|
||||||
[23, 1, 1, 84, -265],
|
[23, 1, 1, 84, -265]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[24, 1, 1, -429, 353],
|
[24, 1, 1, -429, 353],
|
||||||
@@ -272,7 +271,7 @@ export class FishPathConfig {
|
|||||||
[24, 1, 1, -27, 35],
|
[24, 1, 1, -27, 35],
|
||||||
[24, 1, 1, 563, 39],
|
[24, 1, 1, 563, 39],
|
||||||
[24, 1, 1, -268, -245],
|
[24, 1, 1, -268, -245],
|
||||||
[24, 1, 1, 172, -260],
|
[24, 1, 1, 172, -260]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[25, 1, 1, -595, 276],
|
[25, 1, 1, -595, 276],
|
||||||
@@ -280,27 +279,27 @@ export class FishPathConfig {
|
|||||||
[25, 1, 1, -192, -64],
|
[25, 1, 1, -192, -64],
|
||||||
[25, 1, 1, 464, -46],
|
[25, 1, 1, 464, -46],
|
||||||
[25, 1, 1, 191, -280],
|
[25, 1, 1, 191, -280],
|
||||||
[25, 1, 1, 884, -319],
|
[25, 1, 1, 884, -319]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[26, 1, 1, -681, 441],
|
[26, 1, 1, -681, 441],
|
||||||
[26, 1, 1, 685, 426],
|
[26, 1, 1, 685, 426],
|
||||||
[26, 1, 1, -46, 140],
|
[26, 1, 1, -46, 140],
|
||||||
[26, 1, 1, -494, -207],
|
[26, 1, 1, -494, -207],
|
||||||
[26, 1, 1, 497, -238],
|
[26, 1, 1, 497, -238]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[27, 1, 1, -431, 345],
|
[27, 1, 1, -431, 345],
|
||||||
[27, 1, 1, 569, 311],
|
[27, 1, 1, 569, 311],
|
||||||
[27, 1, 1, 112, -12],
|
[27, 1, 1, 112, -12],
|
||||||
[27, 1, 1, -298, -271],
|
[27, 1, 1, -298, -271],
|
||||||
[27, 1, 1, 678, -244],
|
[27, 1, 1, 678, -244]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[28, 1, 1, -454, 8],
|
[28, 1, 1, -454, 8],
|
||||||
[28, 1, 1, 597, 1],
|
[28, 1, 1, 597, 1],
|
||||||
[28, 1, 1, 46, 431],
|
[28, 1, 1, 46, 431],
|
||||||
[28, 1, 1, 44, -227],
|
[28, 1, 1, 44, -227]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[2, 1, 1, -557, 409],
|
[2, 1, 1, -557, 409],
|
||||||
@@ -346,8 +345,8 @@ export class FishPathConfig {
|
|||||||
[5, 1, 1, 407, -178],
|
[5, 1, 1, 407, -178],
|
||||||
[5, 1, 1, 297, 8],
|
[5, 1, 1, 297, 8],
|
||||||
[5, 1, 1, 625, 48],
|
[5, 1, 1, 625, 48],
|
||||||
[5, 1, 1, 379, 92],
|
[5, 1, 1, 379, 92]
|
||||||
],
|
]
|
||||||
]
|
]
|
||||||
private static formatMapConfig: Array<FishMap> = []
|
private static formatMapConfig: Array<FishMap> = []
|
||||||
private static config: Array<Array<Array<number>>> = [
|
private static config: Array<Array<Array<number>>> = [
|
||||||
@@ -369,7 +368,7 @@ export class FishPathConfig {
|
|||||||
[627, -511],
|
[627, -511],
|
||||||
[762, -578],
|
[762, -578],
|
||||||
[885, -667],
|
[885, -667],
|
||||||
[1068, -773],
|
[1068, -773]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-1295, 534],
|
[-1295, 534],
|
||||||
@@ -386,7 +385,7 @@ export class FishPathConfig {
|
|||||||
[753, 233],
|
[753, 233],
|
||||||
[936, 279],
|
[936, 279],
|
||||||
[1182, 350],
|
[1182, 350],
|
||||||
[1314, 418],
|
[1314, 418]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-1295, 534],
|
[-1295, 534],
|
||||||
@@ -403,7 +402,7 @@ export class FishPathConfig {
|
|||||||
[827, -42],
|
[827, -42],
|
||||||
[1020, -131],
|
[1020, -131],
|
||||||
[1189, -170],
|
[1189, -170],
|
||||||
[1309, -198],
|
[1309, -198]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-1295, 534],
|
[-1295, 534],
|
||||||
@@ -420,7 +419,7 @@ export class FishPathConfig {
|
|||||||
[835, 88],
|
[835, 88],
|
||||||
[1013, -2],
|
[1013, -2],
|
||||||
[1212, -99],
|
[1212, -99],
|
||||||
[1309, -198],
|
[1309, -198]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-1275, -118],
|
[-1275, -118],
|
||||||
@@ -437,7 +436,7 @@ export class FishPathConfig {
|
|||||||
[772, 391],
|
[772, 391],
|
||||||
[887, 426],
|
[887, 426],
|
||||||
[1066, 513],
|
[1066, 513],
|
||||||
[1164, 710],
|
[1164, 710]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-1299, -618],
|
[-1299, -618],
|
||||||
@@ -454,7 +453,7 @@ export class FishPathConfig {
|
|||||||
[904, 176],
|
[904, 176],
|
||||||
[1090, 273],
|
[1090, 273],
|
||||||
[1208, 355],
|
[1208, 355],
|
||||||
[1308, 435],
|
[1308, 435]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-1275, -118],
|
[-1275, -118],
|
||||||
@@ -471,7 +470,7 @@ export class FishPathConfig {
|
|||||||
[784, 266],
|
[784, 266],
|
||||||
[935, 228],
|
[935, 228],
|
||||||
[1157, 174],
|
[1157, 174],
|
||||||
[1329, 163],
|
[1329, 163]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-1288, -220],
|
[-1288, -220],
|
||||||
@@ -488,7 +487,7 @@ export class FishPathConfig {
|
|||||||
[851, 203],
|
[851, 203],
|
||||||
[1050, 141],
|
[1050, 141],
|
||||||
[1255, 58],
|
[1255, 58],
|
||||||
[1326, 20],
|
[1326, 20]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-1288, -220],
|
[-1288, -220],
|
||||||
@@ -505,7 +504,7 @@ export class FishPathConfig {
|
|||||||
[993, -283],
|
[993, -283],
|
||||||
[1090, -319],
|
[1090, -319],
|
||||||
[1242, -341],
|
[1242, -341],
|
||||||
[1329, -396],
|
[1329, -396]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-1288, -220],
|
[-1288, -220],
|
||||||
@@ -522,7 +521,7 @@ export class FishPathConfig {
|
|||||||
[1011, -407],
|
[1011, -407],
|
||||||
[1095, -418],
|
[1095, -418],
|
||||||
[1238, -539],
|
[1238, -539],
|
||||||
[1317, -663],
|
[1317, -663]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-1314, -508],
|
[-1314, -508],
|
||||||
@@ -541,7 +540,7 @@ export class FishPathConfig {
|
|||||||
[1093, 280],
|
[1093, 280],
|
||||||
[1026, 371],
|
[1026, 371],
|
||||||
[868, 631],
|
[868, 631],
|
||||||
[648, 787],
|
[648, 787]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-1314, -508],
|
[-1314, -508],
|
||||||
@@ -560,7 +559,7 @@ export class FishPathConfig {
|
|||||||
[1093, 280],
|
[1093, 280],
|
||||||
[1026, 371],
|
[1026, 371],
|
||||||
[868, 631],
|
[868, 631],
|
||||||
[648, 787],
|
[648, 787]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-1314, -508],
|
[-1314, -508],
|
||||||
@@ -577,7 +576,7 @@ export class FishPathConfig {
|
|||||||
[872, -200],
|
[872, -200],
|
||||||
[1060, -391],
|
[1060, -391],
|
||||||
[1150, -492],
|
[1150, -492],
|
||||||
[1301, -461],
|
[1301, -461]
|
||||||
],
|
],
|
||||||
//右边开始
|
//右边开始
|
||||||
[
|
[
|
||||||
@@ -589,7 +588,7 @@ export class FishPathConfig {
|
|||||||
[476, 57],
|
[476, 57],
|
||||||
[467, 300],
|
[467, 300],
|
||||||
[408, 500],
|
[408, 500],
|
||||||
[405, 701],
|
[405, 701]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1345, 34],
|
[1345, 34],
|
||||||
@@ -600,7 +599,7 @@ export class FishPathConfig {
|
|||||||
[267, -29],
|
[267, -29],
|
||||||
[66, -79],
|
[66, -79],
|
||||||
[-219, -287],
|
[-219, -287],
|
||||||
[-271, -693],
|
[-271, -693]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1345, 34],
|
[1345, 34],
|
||||||
@@ -615,7 +614,7 @@ export class FishPathConfig {
|
|||||||
[-725, -92],
|
[-725, -92],
|
||||||
[-963, -68],
|
[-963, -68],
|
||||||
[-1169, -46],
|
[-1169, -46],
|
||||||
[-1325, -40],
|
[-1325, -40]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1345, 34],
|
[1345, 34],
|
||||||
@@ -630,7 +629,7 @@ export class FishPathConfig {
|
|||||||
[-719, -199],
|
[-719, -199],
|
||||||
[-981, -264],
|
[-981, -264],
|
||||||
[-1180, -291],
|
[-1180, -291],
|
||||||
[-1320, -367],
|
[-1320, -367]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1345, 34],
|
[1345, 34],
|
||||||
@@ -645,7 +644,7 @@ export class FishPathConfig {
|
|||||||
[-707, -320],
|
[-707, -320],
|
||||||
[-961, -408],
|
[-961, -408],
|
||||||
[-1160, -449],
|
[-1160, -449],
|
||||||
[-1309, -524],
|
[-1309, -524]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1345, 34],
|
[1345, 34],
|
||||||
@@ -660,7 +659,7 @@ export class FishPathConfig {
|
|||||||
[-596, -448],
|
[-596, -448],
|
||||||
[-847, -604],
|
[-847, -604],
|
||||||
[-1019, -589],
|
[-1019, -589],
|
||||||
[-1241, -695],
|
[-1241, -695]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1345, 34],
|
[1345, 34],
|
||||||
@@ -675,7 +674,7 @@ export class FishPathConfig {
|
|||||||
[-898, 66],
|
[-898, 66],
|
||||||
[-1070, 219],
|
[-1070, 219],
|
||||||
[-1181, 292],
|
[-1181, 292],
|
||||||
[-1289, 558],
|
[-1289, 558]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1345, 34],
|
[1345, 34],
|
||||||
@@ -690,7 +689,7 @@ export class FishPathConfig {
|
|||||||
[-806, 84],
|
[-806, 84],
|
||||||
[-905, 246],
|
[-905, 246],
|
||||||
[-1008, 375],
|
[-1008, 375],
|
||||||
[-1021, 750],
|
[-1021, 750]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1297, 542],
|
[1297, 542],
|
||||||
@@ -705,7 +704,7 @@ export class FishPathConfig {
|
|||||||
[-806, 84],
|
[-806, 84],
|
||||||
[-905, 246],
|
[-905, 246],
|
||||||
[-1008, 375],
|
[-1008, 375],
|
||||||
[-1021, 750],
|
[-1021, 750]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1297, 542],
|
[1297, 542],
|
||||||
@@ -720,7 +719,7 @@ export class FishPathConfig {
|
|||||||
[-806, 84],
|
[-806, 84],
|
||||||
[-927, 189],
|
[-927, 189],
|
||||||
[-1073, 291],
|
[-1073, 291],
|
||||||
[-1318, 474],
|
[-1318, 474]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1297, 542],
|
[1297, 542],
|
||||||
@@ -735,7 +734,7 @@ export class FishPathConfig {
|
|||||||
[-775, -77],
|
[-775, -77],
|
||||||
[-923, -28],
|
[-923, -28],
|
||||||
[-1133, -46],
|
[-1133, -46],
|
||||||
[-1294, -10],
|
[-1294, -10]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1297, 542],
|
[1297, 542],
|
||||||
@@ -750,7 +749,7 @@ export class FishPathConfig {
|
|||||||
[-616, -254],
|
[-616, -254],
|
||||||
[-854, -240],
|
[-854, -240],
|
||||||
[-1115, -272],
|
[-1115, -272],
|
||||||
[-1312, -336],
|
[-1312, -336]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1297, 542],
|
[1297, 542],
|
||||||
@@ -765,7 +764,7 @@ export class FishPathConfig {
|
|||||||
[-562, -321],
|
[-562, -321],
|
||||||
[-647, -446],
|
[-647, -446],
|
||||||
[-930, -540],
|
[-930, -540],
|
||||||
[-1073, -726],
|
[-1073, -726]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1293, -558],
|
[1293, -558],
|
||||||
@@ -780,7 +779,7 @@ export class FishPathConfig {
|
|||||||
[-562, -321],
|
[-562, -321],
|
||||||
[-647, -446],
|
[-647, -446],
|
||||||
[-930, -540],
|
[-930, -540],
|
||||||
[-1073, -726],
|
[-1073, -726]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1293, -558],
|
[1293, -558],
|
||||||
@@ -795,7 +794,7 @@ export class FishPathConfig {
|
|||||||
[-568, -262],
|
[-568, -262],
|
||||||
[-857, -301],
|
[-857, -301],
|
||||||
[-1055, -406],
|
[-1055, -406],
|
||||||
[-1353, -380],
|
[-1353, -380]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1293, -558],
|
[1293, -558],
|
||||||
@@ -810,7 +809,7 @@ export class FishPathConfig {
|
|||||||
[-590, -195],
|
[-590, -195],
|
||||||
[-905, -120],
|
[-905, -120],
|
||||||
[-1100, -72],
|
[-1100, -72],
|
||||||
[-1300, 225],
|
[-1300, 225]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1293, -558],
|
[1293, -558],
|
||||||
@@ -825,7 +824,7 @@ export class FishPathConfig {
|
|||||||
[-633, -130],
|
[-633, -130],
|
||||||
[-917, 33],
|
[-917, 33],
|
||||||
[-1079, 184],
|
[-1079, 184],
|
||||||
[-1220, 412],
|
[-1220, 412]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[1293, -558],
|
[1293, -558],
|
||||||
@@ -840,7 +839,7 @@ export class FishPathConfig {
|
|||||||
[-602, -25],
|
[-602, -25],
|
||||||
[-857, 181],
|
[-857, 181],
|
||||||
[-921, 416],
|
[-921, 416],
|
||||||
[-909, 805],
|
[-909, 805]
|
||||||
],
|
],
|
||||||
//下往上
|
//下往上
|
||||||
[
|
[
|
||||||
@@ -856,7 +855,7 @@ export class FishPathConfig {
|
|||||||
[-602, -25],
|
[-602, -25],
|
||||||
[-857, 181],
|
[-857, 181],
|
||||||
[-921, 416],
|
[-921, 416],
|
||||||
[-909, 805],
|
[-909, 805]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-279, -786],
|
[-279, -786],
|
||||||
@@ -871,7 +870,7 @@ export class FishPathConfig {
|
|||||||
[-362, 152],
|
[-362, 152],
|
||||||
[-543, 358],
|
[-543, 358],
|
||||||
[-721, 502],
|
[-721, 502],
|
||||||
[-401, 770],
|
[-401, 770]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-279, -786],
|
[-279, -786],
|
||||||
@@ -886,7 +885,7 @@ export class FishPathConfig {
|
|||||||
[60, 214],
|
[60, 214],
|
||||||
[-85, 418],
|
[-85, 418],
|
||||||
[-140, 630],
|
[-140, 630],
|
||||||
[-401, 770],
|
[-401, 770]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[-279, -786],
|
[-279, -786],
|
||||||
@@ -901,7 +900,7 @@ export class FishPathConfig {
|
|||||||
[253, 319],
|
[253, 319],
|
||||||
[330, 465],
|
[330, 465],
|
||||||
[544, 684],
|
[544, 684],
|
||||||
[858, 803],
|
[858, 803]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[841, -837],
|
[841, -837],
|
||||||
@@ -916,8 +915,8 @@ export class FishPathConfig {
|
|||||||
[253, 319],
|
[253, 319],
|
||||||
[330, 465],
|
[330, 465],
|
||||||
[544, 684],
|
[544, 684],
|
||||||
[858, 803],
|
[858, 803]
|
||||||
],
|
]
|
||||||
]
|
]
|
||||||
private static formatConfig: Array<FishPathInfo> = []
|
private static formatConfig: Array<FishPathInfo> = []
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { _decorator, Vec2 } from 'cc'
|
import { Vec2 } from 'cc'
|
||||||
|
|
||||||
export class FishPathInfo {
|
export class FishPathInfo {
|
||||||
public pathId: number
|
public pathId: number
|
||||||
public path: Array<Vec2> = []
|
public path: Array<Vec2> = []
|
||||||
|
|
||||||
constructor(pathId: number, path: Array<Vec2>) {
|
constructor(pathId: number, path: Array<Vec2>) {
|
||||||
this.pathId = pathId
|
this.pathId = pathId
|
||||||
this.path = path
|
this.path = path
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { _decorator } from 'cc'
|
|
||||||
export class GameConfig {
|
export class GameConfig {
|
||||||
public static GameName: string = 'FishSingle'
|
public static GameName: string = 'FishSingle'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
import { _decorator } from 'cc'
|
export default class GameEvent {
|
||||||
export default class GameEvent {}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
import {
|
import {
|
||||||
_decorator,
|
_decorator,
|
||||||
Component,
|
Component,
|
||||||
Prefab,
|
|
||||||
NodePool,
|
|
||||||
Event,
|
|
||||||
Node,
|
|
||||||
Vec3,
|
|
||||||
Vec2,
|
|
||||||
EventTouch,
|
EventTouch,
|
||||||
UITransform,
|
|
||||||
instantiate,
|
instantiate,
|
||||||
|
Node,
|
||||||
|
NodePool,
|
||||||
|
Prefab,
|
||||||
sys,
|
sys,
|
||||||
error,
|
UITransform,
|
||||||
|
Vec2,
|
||||||
|
Vec3
|
||||||
} from 'cc'
|
} from 'cc'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import { Logger } from '../../engine/utils/Logger'
|
|
||||||
import FishBulletBase from '../../../fish/script/FishBulletBase'
|
import FishBulletBase from '../../../fish/script/FishBulletBase'
|
||||||
import MathUtils from '../../engine/utils/MathUtils'
|
import MathUtils from '../../engine/utils/MathUtils'
|
||||||
import CannonManager from './CannonManager'
|
import CannonManager from './CannonManager'
|
||||||
@@ -25,18 +20,21 @@ import GameMusicHelper from '../utils/GameMusicHelper'
|
|||||||
import FishUI from '../../../fish/script/FishUI'
|
import FishUI from '../../../fish/script/FishUI'
|
||||||
import CommonTips from '../../engine/uicomponent/CommonTips'
|
import CommonTips from '../../engine/uicomponent/CommonTips'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('BulletManager')
|
@ccclass('BulletManager')
|
||||||
export default class BulletManager extends Component {
|
export default class BulletManager extends Component {
|
||||||
public static instance: BulletManager = null
|
public static instance: BulletManager = null
|
||||||
@property({ type: [Prefab] })
|
@property({ type: [Prefab] })
|
||||||
private bulletPrefabList: Prefab[] = []
|
private bulletPrefabList: Prefab[] | [] = []
|
||||||
private bulletPool: Array<NodePool> = []
|
private bulletPool: Array<NodePool> = []
|
||||||
private bulletList: Array<FishBulletBase> = []
|
private bulletList: Array<FishBulletBase> = []
|
||||||
private bulletMoveSpeed: number = 30
|
private bulletMoveSpeed: number = 30
|
||||||
private _vec3Cache
|
private _vec3Cache: Vec3
|
||||||
private _vec2Cache
|
private _vec2Cache: Vec2
|
||||||
private _fireTime: number = 0
|
private _fireTime: number = 0
|
||||||
private _fireTimeNew: number
|
private _fireTimeNew: number
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this._vec3Cache = new Vec3()
|
this._vec3Cache = new Vec3()
|
||||||
this._vec2Cache = new Vec2()
|
this._vec2Cache = new Vec2()
|
||||||
@@ -45,7 +43,8 @@ export default class BulletManager extends Component {
|
|||||||
// this.node.on(Node.EventType.TOUCH_MOVE, this.onShootBullet, this)
|
// this.node.on(Node.EventType.TOUCH_MOVE, this.onShootBullet, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {}
|
start() {
|
||||||
|
}
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
this.checkMoveBullet()
|
this.checkMoveBullet()
|
||||||
|
|||||||
@@ -1,29 +1,18 @@
|
|||||||
import {
|
import { _decorator, Component, EventMouse, Node, Sprite, SpriteFrame, UITransform, Vec2, Vec3 } from 'cc'
|
||||||
_decorator,
|
|
||||||
Component,
|
|
||||||
Node,
|
|
||||||
SpriteFrame,
|
|
||||||
Event,
|
|
||||||
EventMouse,
|
|
||||||
Sprite,
|
|
||||||
Vec2,
|
|
||||||
UITransform,
|
|
||||||
Vec3,
|
|
||||||
} from 'cc'
|
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import MathUtils from '../../engine/utils/MathUtils'
|
import MathUtils from '../../engine/utils/MathUtils'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('CannonManager')
|
@ccclass('CannonManager')
|
||||||
export default class CannonManager extends Component {
|
export default class CannonManager extends Component {
|
||||||
public static instance: CannonManager = null
|
public static instance: CannonManager = null
|
||||||
@property({ type: Node })
|
@property({ type: Node })
|
||||||
private view: Node | null = null
|
private view: Node | null = null
|
||||||
@property({ type: [SpriteFrame] })
|
@property({ type: [SpriteFrame] })
|
||||||
private cannonSpriteFrame: Array<SpriteFrame> = []
|
private cannonSpriteFrame: Array<SpriteFrame> | [] = []
|
||||||
// 炮塔倍数
|
// 炮塔倍数
|
||||||
public cannonType: number = 1
|
public cannonType: number = 1
|
||||||
private _vec3Cache
|
private _vec3Cache: Vec3
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this._vec3Cache = new Vec3()
|
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.node.parent.on(Node.EventType.MOUSE_MOVE, this.onMeMove.bind(this))
|
||||||
this.refreshCannon()
|
this.refreshCannon()
|
||||||
}
|
}
|
||||||
|
|
||||||
private onMeMove(event: EventMouse) {
|
private onMeMove(event: EventMouse) {
|
||||||
this.rotateCannon(event.getUILocation())
|
this.rotateCannon(event.getUILocation())
|
||||||
}
|
}
|
||||||
@@ -57,9 +47,11 @@ export default class CannonManager extends Component {
|
|||||||
this.view.getComponent(Sprite).spriteFrame =
|
this.view.getComponent(Sprite).spriteFrame =
|
||||||
this.cannonSpriteFrame[this.cannonType - 1]
|
this.cannonSpriteFrame[this.cannonType - 1]
|
||||||
}
|
}
|
||||||
|
|
||||||
public getCannonPosition() {
|
public getCannonPosition() {
|
||||||
return this.view.getPosition()
|
return this.view.getPosition()
|
||||||
}
|
}
|
||||||
|
|
||||||
onDestroy() {
|
onDestroy() {
|
||||||
CannonManager.instance = null
|
CannonManager.instance = null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,6 @@
|
|||||||
import {
|
import { _decorator, Animation, Component, game, instantiate, Node, NodePool, Prefab, Vec2, Vec3 } from 'cc'
|
||||||
_decorator,
|
|
||||||
Component,
|
|
||||||
Node,
|
|
||||||
Prefab,
|
|
||||||
NodePool,
|
|
||||||
game,
|
|
||||||
Vec3,
|
|
||||||
sys,
|
|
||||||
instantiate,
|
|
||||||
Animation,
|
|
||||||
Vec2,
|
|
||||||
} from 'cc'
|
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import RandomUtil from '../../engine/utils/RandomUtil'
|
import RandomUtil from '../../engine/utils/RandomUtil'
|
||||||
import FishBase from '../../../fish/script/FishBase'
|
import FishBase from '../../../fish/script/FishBase'
|
||||||
import { FishPathInfo } from '../config/FishPathInfo'
|
|
||||||
import { FishPathConfig } from '../config/FishPathConfig'
|
import { FishPathConfig } from '../config/FishPathConfig'
|
||||||
import FishMover from '../../../fish/script/FishMover'
|
import FishMover from '../../../fish/script/FishMover'
|
||||||
import { Logger } from '../../engine/utils/Logger'
|
import { Logger } from '../../engine/utils/Logger'
|
||||||
@@ -28,6 +13,8 @@ import { FishMapInfo } from '../config/FishMapInfo'
|
|||||||
import FishUI from '../../../fish/script/FishUI'
|
import FishUI from '../../../fish/script/FishUI'
|
||||||
import TimeHelper from '../utils/TimeHelper'
|
import TimeHelper from '../utils/TimeHelper'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('FishManager')
|
@ccclass('FishManager')
|
||||||
export default class FishManager extends Component {
|
export default class FishManager extends Component {
|
||||||
public static instance: FishManager = null
|
public static instance: FishManager = null
|
||||||
@@ -47,7 +34,8 @@ export default class FishManager extends Component {
|
|||||||
// // private minMapCount: number = 2 * cc.game.getFrameRate();
|
// // private minMapCount: number = 2 * cc.game.getFrameRate();
|
||||||
// // private maxMapCount: number = 5 * cc.game.getFrameRate();
|
// // private maxMapCount: number = 5 * cc.game.getFrameRate();
|
||||||
|
|
||||||
private _fishPosCache
|
private _fishPosCache: Vec3
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
FishManager.instance = this
|
FishManager.instance = this
|
||||||
this._fishPosCache = new Vec3()
|
this._fishPosCache = new Vec3()
|
||||||
|
|||||||
@@ -1,23 +1,15 @@
|
|||||||
import {
|
import { _decorator, Component, instantiate, Node, NodePool, Prefab, Vec2, Vec3 } from 'cc'
|
||||||
_decorator,
|
|
||||||
Component,
|
|
||||||
Prefab,
|
|
||||||
NodePool,
|
|
||||||
Vec2,
|
|
||||||
instantiate,
|
|
||||||
Vec3,
|
|
||||||
Node,
|
|
||||||
} from 'cc'
|
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import FishNetBase from '../../../fish/script/FishNetBase'
|
import FishNetBase from '../../../fish/script/FishNetBase'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('FishNetManager')
|
@ccclass('FishNetManager')
|
||||||
export default class FishNetManager extends Component {
|
export default class FishNetManager extends Component {
|
||||||
public static instance: FishNetManager = null
|
public static instance: FishNetManager = null
|
||||||
@property({ type: [Prefab] })
|
@property({ type: [Prefab] })
|
||||||
private netPrefabList: Prefab[] = []
|
private netPrefabList: Prefab[] | [] = []
|
||||||
private fishNetPool: Array<NodePool> = []
|
private fishNetPool: Array<NodePool> = []
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
FishNetManager.instance = this
|
FishNetManager.instance = this
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,16 @@
|
|||||||
import {
|
import { _decorator, Component, instantiate, Node, NodePool, Prefab, Vec2, Vec3 } from 'cc'
|
||||||
_decorator,
|
|
||||||
Component,
|
|
||||||
Prefab,
|
|
||||||
NodePool,
|
|
||||||
Vec2,
|
|
||||||
instantiate,
|
|
||||||
Node,
|
|
||||||
Vec3,
|
|
||||||
} from 'cc'
|
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import ScorePrefab from '../prefab/ScorePrefab'
|
import ScorePrefab from '../prefab/ScorePrefab'
|
||||||
import FishUI from '../../../fish/script/FishUI'
|
import FishUI from '../../../fish/script/FishUI'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('ScoreManager')
|
@ccclass('ScoreManager')
|
||||||
export default class ScoreManager extends Component {
|
export default class ScoreManager extends Component {
|
||||||
public static instance: ScoreManager = null
|
public static instance: ScoreManager = null
|
||||||
@property({ type: Prefab })
|
@property({ type: Prefab })
|
||||||
private scrorePrefab: Prefab | null = null
|
private scrorePrefab: Prefab | null = null
|
||||||
private scorePool: NodePool
|
private scorePool: NodePool
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
ScoreManager.instance = this
|
ScoreManager.instance = this
|
||||||
this.scorePool = new NodePool()
|
this.scorePool = new NodePool()
|
||||||
@@ -50,7 +42,9 @@ export default class ScoreManager extends Component {
|
|||||||
this.scorePool.put(scorePrefab.node)
|
this.scorePool.put(scorePrefab.node)
|
||||||
}
|
}
|
||||||
|
|
||||||
onDisable() {}
|
onDisable() {
|
||||||
|
}
|
||||||
|
|
||||||
onDestroy() {
|
onDestroy() {
|
||||||
ScoreManager.instance = null
|
ScoreManager.instance = null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { _decorator, Component, Prefab, Node, instantiate } from 'cc'
|
import { _decorator, Component, instantiate, Node, Prefab } from 'cc'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import PrefabLoader from '../../engine/utils/PrefabLoader'
|
import PrefabLoader from '../../engine/utils/PrefabLoader'
|
||||||
import { GameConfig } from '../config/GameConfig'
|
import { GameConfig } from '../config/GameConfig'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('ResourcePrefab')
|
@ccclass('ResourcePrefab')
|
||||||
export default class ResourcePrefab extends Component {
|
export default class ResourcePrefab extends Component {
|
||||||
private static prefab: Prefab | null = null
|
private static prefab: Prefab | null = null
|
||||||
|
|||||||
@@ -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
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('ScorePrefab')
|
@ccclass('ScorePrefab')
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { _decorator, Component, Node, Material, instantiate, Prefab } from 'cc'
|
import { _decorator, Component, instantiate, Material, Node, Prefab } from 'cc'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import PrefabLoader from '../../engine/utils/PrefabLoader'
|
import PrefabLoader from '../../engine/utils/PrefabLoader'
|
||||||
import { GameConfig } from '../config/GameConfig'
|
import { GameConfig } from '../config/GameConfig'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('ShaderMaterialPrefab')
|
@ccclass('ShaderMaterialPrefab')
|
||||||
export default class ShaderMaterialPrefab extends Component {
|
export default class ShaderMaterialPrefab extends Component {
|
||||||
public static instance: Node
|
public static instance: Node
|
||||||
@@ -27,6 +27,7 @@ export default class ShaderMaterialPrefab extends Component {
|
|||||||
public flag: Material | null = null
|
public flag: Material | null = null
|
||||||
@property({ type: Material })
|
@property({ type: Material })
|
||||||
public gaussian: Material | null = null
|
public gaussian: Material | null = null
|
||||||
|
|
||||||
public static preLoad(): Promise<void> {
|
public static preLoad(): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
PrefabLoader.loadPrefab(
|
PrefabLoader.loadPrefab(
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import { _decorator, Sprite, Prefab, Node, instantiate, Vec3, Tween } from 'cc'
|
import { _decorator, instantiate, Node, Prefab, Sprite, Tween, Vec3 } from 'cc'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import SceneBase from './SceneBase'
|
import SceneBase from './SceneBase'
|
||||||
import TextureMgr from '../../engine/uicomponent/TextureMgr'
|
import TextureMgr from '../../engine/uicomponent/TextureMgr'
|
||||||
import RandomUtil from '../../engine/utils/RandomUtil'
|
import RandomUtil from '../../engine/utils/RandomUtil'
|
||||||
@@ -11,13 +9,16 @@ import { Logger } from '../../engine/utils/Logger'
|
|||||||
import FishWiki from '../../../fish/script/FishWiki'
|
import FishWiki from '../../../fish/script/FishWiki'
|
||||||
import GameMusicHelper from '../utils/GameMusicHelper'
|
import GameMusicHelper from '../utils/GameMusicHelper'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('FishGameScene')
|
@ccclass('FishGameScene')
|
||||||
export default class FishGameScene extends SceneBase {
|
export default class FishGameScene extends SceneBase {
|
||||||
@property(Sprite)
|
@property(Sprite)
|
||||||
private bg: Sprite | null = null
|
private bg: Sprite | null = null
|
||||||
@property({ type: [Prefab] })
|
@property({ type: [Prefab] })
|
||||||
private fishPrefabList: Array<Prefab> = []
|
private fishPrefabList: Array<Prefab> | null = []
|
||||||
private showNode: Node | null = null
|
private showNode: Node | null = null
|
||||||
|
|
||||||
onLoadMe() {
|
onLoadMe() {
|
||||||
GameMusicHelper.playBg()
|
GameMusicHelper.playBg()
|
||||||
FishPathConfig.init()
|
FishPathConfig.init()
|
||||||
|
|||||||
@@ -1,13 +1,4 @@
|
|||||||
import {
|
import { _decorator, DynamicAtlasManager, Node, PhysicsSystem2D, profiler, sys } from 'cc'
|
||||||
_decorator,
|
|
||||||
Node,
|
|
||||||
sys,
|
|
||||||
profiler,
|
|
||||||
DynamicAtlasManager,
|
|
||||||
PhysicsSystem2D,
|
|
||||||
} from 'cc'
|
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import MusicConfig from '../../engine/config/MusicConfig'
|
import MusicConfig from '../../engine/config/MusicConfig'
|
||||||
import CommonTips from '../../engine/uicomponent/CommonTips'
|
import CommonTips from '../../engine/uicomponent/CommonTips'
|
||||||
import Progress from '../../engine/uicomponent/Progress'
|
import Progress from '../../engine/uicomponent/Progress'
|
||||||
@@ -19,12 +10,15 @@ import ResourcePreload from '../utils/ResourcePreload'
|
|||||||
import SceneBase from './SceneBase'
|
import SceneBase from './SceneBase'
|
||||||
import SceneManager from './SceneManager'
|
import SceneManager from './SceneManager'
|
||||||
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('LoadingScene')
|
@ccclass('LoadingScene')
|
||||||
export default class LoadingScene extends SceneBase {
|
export default class LoadingScene extends SceneBase {
|
||||||
public static scriptName: string = 'LoadingScene'
|
public static scriptName: string = 'LoadingScene'
|
||||||
@property({ type: Node })
|
@property({ type: Node })
|
||||||
private progressNode: Node | null = null
|
private progressNode: Node | null = null
|
||||||
onLoadMe() {
|
|
||||||
|
async onLoadMe() {
|
||||||
this.baseInit()
|
this.baseInit()
|
||||||
EventManager.instance.addListener(
|
EventManager.instance.addListener(
|
||||||
HotUpdate.Event_On_NeedUpdate,
|
HotUpdate.Event_On_NeedUpdate,
|
||||||
@@ -54,7 +48,7 @@ export default class LoadingScene extends SceneBase {
|
|||||||
if (sys.isNative && VersionManager.instance.isOpenHotUpdate) {
|
if (sys.isNative && VersionManager.instance.isOpenHotUpdate) {
|
||||||
this.checkUpdate()
|
this.checkUpdate()
|
||||||
} else {
|
} 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]) {
|
if (key == VersionManager.Config_Key[0]) {
|
||||||
let msg: string =
|
let msg: string =
|
||||||
Math.min(100, (loadedFiles / totalFiles) * 100).toFixed(2) + '%'
|
Math.min(100, (loadedFiles / totalFiles) * 100).toFixed(2) + '%'
|
||||||
|
|||||||
@@ -1,25 +1,31 @@
|
|||||||
import { _decorator, Component } from 'cc'
|
import { _decorator, Component } from 'cc'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import AdapterHelper from '../../engine/utils/AdapterHelper'
|
import AdapterHelper from '../../engine/utils/AdapterHelper'
|
||||||
import PrefabLoader from '../../engine/utils/PrefabLoader'
|
|
||||||
import { Logger } from '../../engine/utils/Logger'
|
const { ccclass, property } = _decorator
|
||||||
import ResourcePrefab from '../prefab/ResourcePrefab'
|
|
||||||
|
|
||||||
@ccclass('SceneBase')
|
@ccclass('SceneBase')
|
||||||
export default class SceneBase extends Component {
|
export default class SceneBase extends Component {
|
||||||
public static scriptName: string = 'SceneBase'
|
public static scriptName: string = 'SceneBase'
|
||||||
|
|
||||||
onLoad() {
|
onLoad() {
|
||||||
AdapterHelper.fixApdater()
|
AdapterHelper.fixApdater()
|
||||||
this.onLoadMe()
|
this.onLoadMe()
|
||||||
}
|
}
|
||||||
onLoadMe() {}
|
|
||||||
|
onLoadMe() {
|
||||||
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
this.onStartMe()
|
this.onStartMe()
|
||||||
}
|
}
|
||||||
onStartMe() {}
|
|
||||||
|
onStartMe() {
|
||||||
|
}
|
||||||
|
|
||||||
onDestroy() {
|
onDestroy() {
|
||||||
this.onDestroyMe()
|
this.onDestroyMe()
|
||||||
}
|
}
|
||||||
onDestroyMe() {}
|
|
||||||
|
onDestroyMe() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { director, SceneAsset, sys, _decorator } from 'cc'
|
import { director, SceneAsset, sys } from 'cc'
|
||||||
import { Logger } from '../../engine/utils/Logger'
|
import { Logger } from '../../engine/utils/Logger'
|
||||||
import LoadingScenePrefab from '../../engine/uicomponent/LoadingScenePrefab'
|
import LoadingScenePrefab from '../../engine/uicomponent/LoadingScenePrefab'
|
||||||
import CommonTips from '../../engine/uicomponent/CommonTips'
|
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
|
if (this.loadingSceneName == name) return
|
||||||
Logger.log(this, 'sceneSwitch==', name)
|
Logger.log(this, 'sceneSwitch==', name)
|
||||||
if (sys.isBrowser) {
|
if (sys.isBrowser) {
|
||||||
@@ -31,7 +31,7 @@ export default class SceneManager {
|
|||||||
this.initFullScreenPrefab(false)
|
this.initFullScreenPrefab(false)
|
||||||
this.loadingSceneName = name
|
this.loadingSceneName = name
|
||||||
if (showProgress) {
|
if (showProgress) {
|
||||||
LoadingScenePrefab.show()
|
await LoadingScenePrefab.show()
|
||||||
director.preloadScene(
|
director.preloadScene(
|
||||||
name,
|
name,
|
||||||
(completedCount: number, totalCount: number, item: any) => {
|
(completedCount: number, totalCount: number, item: any) => {
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
import { _decorator } from 'cc'
|
import { _decorator } from 'cc'
|
||||||
const { ccclass, property } = _decorator
|
|
||||||
|
|
||||||
import EventManager, { HaoEvent } from '../../engine/utils/EventManager'
|
|
||||||
import SceneBase from './SceneBase'
|
import SceneBase from './SceneBase'
|
||||||
import SceneManager from './SceneManager'
|
|
||||||
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('StartScene')
|
@ccclass('StartScene')
|
||||||
export default class StartScene extends SceneBase {
|
export default class StartScene extends SceneBase {
|
||||||
public static scriptName: string = 'StartScene'
|
public static scriptName: string = 'StartScene'
|
||||||
onLoadMe() {}
|
|
||||||
update() {}
|
|
||||||
|
|
||||||
onDestroyMe() {}
|
onLoadMe() {
|
||||||
|
}
|
||||||
|
|
||||||
|
update() {
|
||||||
|
}
|
||||||
|
|
||||||
|
onDestroyMe() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { _decorator, Component, Vec2 } from 'cc'
|
import { _decorator, Component, Vec2 } from 'cc'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
import { Logger } from '../../engine/utils/Logger'
|
|
||||||
export enum AstarGridType {
|
export enum AstarGridType {
|
||||||
Hider = 0, //不能走
|
Hider = 0, //不能走
|
||||||
Normal = 1, //能走
|
Normal = 1, //能走
|
||||||
@@ -27,7 +27,9 @@ export class Astar extends Component {
|
|||||||
private closeList: Array<AstarGrid> = []
|
private closeList: Array<AstarGrid> = []
|
||||||
private path: Array<AstarGrid> = []
|
private path: Array<AstarGrid> = []
|
||||||
private gridsList: Array<Array<AstarGrid>> = []
|
private gridsList: Array<Array<AstarGrid>> = []
|
||||||
onLoad() {}
|
|
||||||
|
onLoad() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param mapW 宽格子数
|
* @param mapW 宽格子数
|
||||||
@@ -89,6 +91,7 @@ export class Astar extends Component {
|
|||||||
* 开始搜索路径
|
* 开始搜索路径
|
||||||
* @param startPos
|
* @param startPos
|
||||||
* @param endPos
|
* @param endPos
|
||||||
|
* @param callback
|
||||||
*/
|
*/
|
||||||
public findPath(startPos: Vec2, endPos: Vec2, callback: Function = null) {
|
public findPath(startPos: Vec2, endPos: Vec2, callback: Function = null) {
|
||||||
let startGrid = this.gridsList[startPos.x][startPos.y]
|
let startGrid = this.gridsList[startPos.x][startPos.y]
|
||||||
@@ -192,5 +195,6 @@ export class Astar extends Component {
|
|||||||
return this.path
|
return this.path
|
||||||
}
|
}
|
||||||
|
|
||||||
onDestroy() {}
|
onDestroy() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { _decorator } from 'cc'
|
|
||||||
import SoundPrefab from '../../engine/uicomponent/SoundPrefab'
|
import SoundPrefab from '../../engine/uicomponent/SoundPrefab'
|
||||||
import MusicPrefab from '../../engine/uicomponent/MusicPrefab'
|
import MusicPrefab from '../../engine/uicomponent/MusicPrefab'
|
||||||
import RandomUtil from '../../engine/utils/RandomUtil'
|
import RandomUtil from '../../engine/utils/RandomUtil'
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { error, game, _decorator } from 'cc'
|
import { error, game } from 'cc'
|
||||||
import DarkLayer from '../../engine/uicomponent/DarkLayer'
|
import DarkLayer from '../../engine/uicomponent/DarkLayer'
|
||||||
import LoadingPrefab from '../../engine/uicomponent/LoadingPrefab'
|
import LoadingPrefab from '../../engine/uicomponent/LoadingPrefab'
|
||||||
import LoadingScenePrefab from '../../engine/uicomponent/LoadingScenePrefab'
|
import LoadingScenePrefab from '../../engine/uicomponent/LoadingScenePrefab'
|
||||||
import MusicPrefab from '../../engine/uicomponent/MusicPrefab'
|
import MusicPrefab from '../../engine/uicomponent/MusicPrefab'
|
||||||
import Progress from '../../engine/uicomponent/Progress'
|
import Progress from '../../engine/uicomponent/Progress'
|
||||||
import SoundPrefab from '../../engine/uicomponent/SoundPrefab'
|
import SoundPrefab from '../../engine/uicomponent/SoundPrefab'
|
||||||
import { Logger } from '../../engine/utils/Logger'
|
|
||||||
import ResourcePrefab from '../prefab/ResourcePrefab'
|
import ResourcePrefab from '../prefab/ResourcePrefab'
|
||||||
import ShaderMaterialPrefab from '../prefab/ShaderMaterialPrefab'
|
import ShaderMaterialPrefab from '../prefab/ShaderMaterialPrefab'
|
||||||
|
|
||||||
@@ -15,6 +14,7 @@ export default class ResourcePreload {
|
|||||||
private totalNum: number = 6
|
private totalNum: number = 6
|
||||||
private nowIndex: number = 0
|
private nowIndex: number = 0
|
||||||
private progress: Progress
|
private progress: Progress
|
||||||
|
|
||||||
public async preLoad(callback: Function, progress: Progress) {
|
public async preLoad(callback: Function, progress: Progress) {
|
||||||
if (this.isPreloaded) {
|
if (this.isPreloaded) {
|
||||||
callback()
|
callback()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { tween, Node } from 'cc'
|
import { Node, tween } from 'cc'
|
||||||
|
|
||||||
export default class TimeHelper {
|
export default class TimeHelper {
|
||||||
public static exeNextFrame(node: Node, callback: Function) {
|
public static exeNextFrame(node: Node, callback: Function) {
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import { _decorator, Component, Node } from 'cc'
|
import { _decorator, Component } from 'cc'
|
||||||
|
|
||||||
const { ccclass, property } = _decorator
|
const { ccclass, property } = _decorator
|
||||||
|
|
||||||
@ccclass('UIRoot')
|
@ccclass('UIRoot')
|
||||||
export class UIRoot extends Component {
|
export class UIRoot extends Component {
|
||||||
public static Instance
|
public static Instance: UIRoot
|
||||||
onLoad() {
|
onLoad() {
|
||||||
UIRoot.Instance = this
|
UIRoot.Instance = this
|
||||||
}
|
}
|
||||||
|
|||||||
16
package.json
16
package.json
@@ -6,5 +6,19 @@
|
|||||||
"version": "3.8.2"
|
"version": "3.8.2"
|
||||||
},
|
},
|
||||||
"_sourceId": "f769f6bf-2fe4-41a7-b7ad-f38f57e2d1b9",
|
"_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
1832
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"__version__": "3.0.5",
|
"__version__": "3.0.5",
|
||||||
"game": {
|
"game": {
|
||||||
"name": "未知游戏",
|
"name": "UNKNOW GAME",
|
||||||
"app_id": "UNKNOW",
|
"app_id": "UNKNOW",
|
||||||
"c_id": "0"
|
"c_id": "0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,19 +4,19 @@
|
|||||||
"customSplash": {
|
"customSplash": {
|
||||||
"id": "customSplash",
|
"id": "customSplash",
|
||||||
"label": "customSplash",
|
"label": "customSplash",
|
||||||
"enable": true,
|
"enable": false,
|
||||||
"customSplash": {
|
"customSplash": {
|
||||||
"complete": false,
|
"complete": false,
|
||||||
"form": "https://creator-api.cocos.com/api/form/show?sid=5d73e8c847732207609c34c0adf271fb"
|
"form": "https://creator-api.cocos.com/api/form/show?"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"removeSplash": {
|
"removeSplash": {
|
||||||
"id": "removeSplash",
|
"id": "removeSplash",
|
||||||
"label": "removeSplash",
|
"label": "removeSplash",
|
||||||
"enable": true,
|
"enable": false,
|
||||||
"removeSplash": {
|
"removeSplash": {
|
||||||
"complete": true,
|
"complete": false,
|
||||||
"form": "https://creator-api.cocos.com/api/form/show?sid=5d73e8c847732207609c34c0adf271fb"
|
"form": "https://creator-api.cocos.com/api/form/show?"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user