mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-10-09 00:26:11 +00:00
添加角色 远程攻击逻辑
This commit is contained in:
@@ -20,6 +20,9 @@ import { TableGRole } from "../resources/config/ts/TableGRole";
|
||||
import loader from "../../extensions/ngame/assets/ngame/util/loader";
|
||||
import { Prefab } from "cc";
|
||||
import { sp } from "cc";
|
||||
import { TableGRoleAttack } from "../resources/config/ts/TableGRoleAttack";
|
||||
import { SpriteFrame } from "cc";
|
||||
import { TableGRoleAttackBullet } from "../resources/config/ts/TableGRoleAttackBullet";
|
||||
|
||||
|
||||
//重写UI
|
||||
@@ -102,7 +105,9 @@ export class JNGConfig extends SystemBase{
|
||||
|
||||
//配置JSON加载
|
||||
jsons:JsonLoad[] = [
|
||||
{name:TableGRole.TableName},
|
||||
{name:TableGRole.TableName}, //角色
|
||||
{name:TableGRoleAttack.TableName}, //角色攻击
|
||||
{name:TableGRoleAttackBullet.TableName}, //角色攻击子弹
|
||||
].map((table) => {
|
||||
return {
|
||||
name:table.name,
|
||||
@@ -124,6 +129,7 @@ export class JNGConfig extends SystemBase{
|
||||
export class JLoaderRole extends JLoaderSystem{
|
||||
|
||||
skData:{[id:number]:sp.SkeletonData} = {};
|
||||
bullets:{[id:number]:SpriteFrame} = {};
|
||||
async onInit(): Promise<any> {
|
||||
await super.onInit();
|
||||
//将配置表的角色都读取出来
|
||||
@@ -134,6 +140,15 @@ export class JLoaderRole extends JLoaderSystem{
|
||||
})
|
||||
}))
|
||||
}
|
||||
//将所有子弹读取出来
|
||||
for (const info of Object.values(TableGRoleAttackBullet.getAllConfig())) {
|
||||
this.bullets[info.id] = await (new Promise(r => {
|
||||
this.bundle.load(info.bulletSrc,SpriteFrame,(err,data) => {
|
||||
r(data);
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user