添加角色 远程攻击逻辑

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-10-27 02:38:08 +08:00
parent 39dd60bb8d
commit 7e402432dd
199 changed files with 7059 additions and 5 deletions

View File

@@ -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);
})
}))
}
}
}