简单的PVP

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-11-21 01:57:40 +08:00
parent 1aa5900294
commit 074cfbd5bd
18 changed files with 3218 additions and 158 deletions

View File

@@ -7,6 +7,7 @@ import { Prefab } from 'cc';
import { instantiate } from 'cc';
import { v3 } from 'cc';
import { ModeRenderHitText } from './ModeRenderHitText';
import { Vec2 } from 'cc';
const { ccclass, property } = _decorator;
export enum ModeRenderEvent{
@@ -34,11 +35,9 @@ export class ModeRender extends Component {
}
//受击
onHit(role:GRoleDefault,hit:number){
onHit(pos:Vec2,hit:number){
if(!role.get()) return;
let rolePos = GData.WorldCanvas.camera.worldToScreen(role.node.worldPosition);
let rolePos = GData.WorldCanvas.camera.worldToScreen(v3(pos.x,pos.y));
let hitNode = instantiate(this.hitPrefab);

View File

@@ -16,9 +16,6 @@ export class MainView extends JNGLayerBase {
onJNLoad(data?: any): void {
//打开默认模式
GBattleModeManager.getIns().Open();
//发送消息
ChatData.getIns().onSend({
message:`${PlayerData.getIns().data.playerId} 加入游戏`