mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
简单的PVP
This commit is contained in:
@@ -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);
|
||||
|
||||
|
@@ -16,9 +16,6 @@ export class MainView extends JNGLayerBase {
|
||||
|
||||
onJNLoad(data?: any): void {
|
||||
|
||||
//打开默认模式
|
||||
GBattleModeManager.getIns().Open();
|
||||
|
||||
//发送消息
|
||||
ChatData.getIns().onSend({
|
||||
message:`${PlayerData.getIns().data.playerId} 加入游戏`
|
||||
|
Reference in New Issue
Block a user