This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-12-25 02:06:56 +08:00
parent 516d520c5e
commit 5366e3413c
18 changed files with 1054 additions and 441 deletions

View File

@@ -0,0 +1,33 @@
import { _decorator, Component, Node } from 'cc';
import GOnHookData from '../../../data/GOnHookData';
import { TD } from '../../../App';
import { Label } from 'cc';
import { TbGEntity } from '../../../config/data/schema';
const { ccclass, property } = _decorator;
@ccclass('GameDifficultyTitle')
export class GameDifficultyTitle extends Component {
@property(Label)
title:Label;
protected update(dt: number): void {
let info = GOnHookData.getIns().info;
let sign = null;
let levelId = info.levelId;
if(info && levelId){
sign = TD.TbGOnHookMaps.get(info.onHookMap)?.sign;
if(!sign) return;
}else return;
let table:{data:TbGEntity.TOnHookLevel} = TD[sign].get(GOnHookData.getIns().info.levelId);
//显示难度
this.title.string = `难度 : ${table.data.level}-${table.data.childLevel}`;
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "b2374caf-5449-4193-88a5-ff17e311d29c",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,43 @@
import { _decorator, Component, Node } from 'cc';
import { app } from '../../../App';
import { GModeEvent } from '../../../battle/modes/GMode';
import { tween } from 'cc';
import { Vec3 } from 'cc';
import RandomUtil from '../../../../../extensions/ngame/assets/ngame/util/RandomUtil';
import { v3 } from 'cc';
const { ccclass, property } = _decorator;
//游戏震屏
@ccclass('ModeShakeScreen')
export class ModeShakeScreen extends Component {
local:Vec3;
onLoad(){
this.local = this.node.position.clone();
app.event.on(GModeEvent.HIT,this.onShakeScreen,this);
}
protected onDestroy(): void {
app.event.off(GModeEvent.HIT,this.onShakeScreen,this);
}
onShakeScreen(){
tween(this.node).
to(0.1, { position: this.local.clone().add(v3(RandomUtil.RandomInt(-5, 5), RandomUtil.RandomInt(-5, 0), 0)) })
.call(() => {
tween(this.node).to(0.1 / 2, { position: this.local.clone() }).start();
})
.start();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "c18bbd8c-6ce3-4ea1-84e3-2bb7bd368d31",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -7,6 +7,7 @@ import { JNGLayerBase } from '../../components/JNComponent';
import { app } from '../../App';
import { GAction } from '../../consts/GAction';
import { GAPI } from '../../consts/GAPI';
import GOnHookManager from '../../manager/battle/mode/GOnHookManager';
const { ccclass, property } = _decorator;
@ccclass('MainView')
@@ -63,8 +64,7 @@ export class MainView extends JNGLayerBase {
//点击下一关
async onClickNextLevel(){
await GAPI.GOnHookNextLevel();
app.layer.Open(GUI.Tips,{text:"下一关"});
GOnHookManager.getIns().onNextLevel();
}
}