mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
简单PVP
This commit is contained in:
@@ -5,6 +5,7 @@ import PlayerData from '../../data/PlayerData';
|
||||
import GBattleModeManager, { BattleMode } from '../../battle/GBattleModeManager';
|
||||
import { JNGLayerBase } from '../../components/JNComponent';
|
||||
import { app } from '../../App';
|
||||
import { GAction } from '../../consts/GAction';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('MainView')
|
||||
@@ -47,6 +48,11 @@ export class MainView extends JNGLayerBase {
|
||||
GBattleModeManager.getIns().Open(BattleMode.OnHook,true);
|
||||
}
|
||||
|
||||
//点击PVP模式
|
||||
onOpenPVP(){
|
||||
app.socket.Send(GAction.S_MODE_PVP_JOIN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
9
JisolGameCocos/assets/script/ui/Mode.meta
Normal file
9
JisolGameCocos/assets/script/ui/Mode.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "7767a760-8e96-4bf8-8289-030e5a8c91c5",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
9
JisolGameCocos/assets/script/ui/Mode/PVP.meta
Normal file
9
JisolGameCocos/assets/script/ui/Mode/PVP.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "37638c81-4459-4c8d-8054-e5789bce2590",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
37
JisolGameCocos/assets/script/ui/Mode/PVP/PVPMatchView.ts
Normal file
37
JisolGameCocos/assets/script/ui/Mode/PVP/PVPMatchView.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { JNGLayerBase } from '../../../components/JNComponent';
|
||||
import { tween } from 'cc';
|
||||
import { v3 } from 'cc';
|
||||
import { app } from '../../../App';
|
||||
import { GAction } from '../../../consts/GAction';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/**
|
||||
* 游戏匹配页面
|
||||
*/
|
||||
@ccclass('PVPMatchView')
|
||||
export class PVPMatchView extends JNGLayerBase {
|
||||
|
||||
@property(Node)
|
||||
content:Node;
|
||||
|
||||
onJNLoad(data?: any): void {
|
||||
super.onJNLoad(data);
|
||||
tween(this.content)
|
||||
.repeatForever(
|
||||
tween()
|
||||
.to(.5,{scale:v3(.8,.8,.8)})
|
||||
.to(.5,{scale:v3(1,1,1)})
|
||||
)
|
||||
.start();
|
||||
|
||||
}
|
||||
|
||||
//取消匹配
|
||||
onClickCancel(){
|
||||
app.socket.Send(GAction.S_MODE_PVP_LEAVE)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "9979d56d-f754-44c3-8e29-c764eaeb0aaf",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -23,6 +23,9 @@ export enum GUI{
|
||||
|
||||
IntoBattleView = "IntoBattleView", //上阵页面
|
||||
|
||||
/**游戏模式页面 */
|
||||
PVPModeMatchView = "PVPModeMatchView", //PVP模式匹配页面
|
||||
|
||||
Home = "Home", //主页面
|
||||
Main = "Main", //主页面2
|
||||
}
|
||||
@@ -97,6 +100,17 @@ const UINoviceConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
|
||||
}
|
||||
|
||||
//游戏模式页面
|
||||
const UIGModeConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
|
||||
[GUI.PVPModeMatchView]:{
|
||||
layer:GLayer.Popup,
|
||||
uri: "prefab/ui/模式/PVP/PVP匹配页面",
|
||||
anims:BackOutScale
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
export const UIConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
[GUI.Home]:{
|
||||
layer:GLayer.View,
|
||||
@@ -121,5 +135,6 @@ export const UIConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
...UISystemConfig, //系统页面
|
||||
...UINoviceConfig, //新手引导页面
|
||||
...UIMainConfig, //主页面
|
||||
...UIGModeConfig, //游戏模式页面
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user