mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -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}`;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "b2374caf-5449-4193-88a5-ff17e311d29c",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "c18bbd8c-6ce3-4ea1-84e3-2bb7bd368d31",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Reference in New Issue
Block a user