feat(技能系统): 添加技能盒组件和预制体
- 新增 SkillBoxComp 和 MissSkillsComp 组件,用于技能盒视图逻辑 - 创建 sbox.prefab 技能盒预制体,包含完整的 UI 结构和精灵组件 - 为组件添加元数据文件,支持 ECS 框架集成
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"__type__": "cc.Prefab",
|
"__type__": "cc.Prefab",
|
||||||
"_name": "box",
|
"_name": "sbox",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"__editorExtras__": {},
|
"__editorExtras__": {},
|
||||||
"_native": "",
|
"_native": "",
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.Node",
|
"__type__": "cc.Node",
|
||||||
"_name": "box",
|
"_name": "sbox",
|
||||||
"_objFlags": 0,
|
"_objFlags": 0,
|
||||||
"__editorExtras__": {},
|
"__editorExtras__": {},
|
||||||
"_parent": null,
|
"_parent": null,
|
||||||
@@ -38,10 +38,13 @@
|
|||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 50
|
"__id__": 50
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 52
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 52
|
"__id__": 54
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -1143,6 +1146,27 @@
|
|||||||
"__type__": "cc.CompPrefabInfo",
|
"__type__": "cc.CompPrefabInfo",
|
||||||
"fileId": "f9WzzmQplCw4od/9N1bGZ8"
|
"fileId": "f9WzzmQplCw4od/9N1bGZ8"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"__type__": "ca519GL6uRIa4LozolUSmoN",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {},
|
||||||
|
"node": {
|
||||||
|
"__id__": 1
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"__prefab": {
|
||||||
|
"__id__": 53
|
||||||
|
},
|
||||||
|
"icon_node": {
|
||||||
|
"__id__": 11
|
||||||
|
},
|
||||||
|
"_id": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.CompPrefabInfo",
|
||||||
|
"fileId": "2b0pxtPkdJgrKePAS8msRc"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.PrefabInfo",
|
"__type__": "cc.PrefabInfo",
|
||||||
"root": {
|
"root": {
|
||||||
@@ -8,6 +8,6 @@
|
|||||||
],
|
],
|
||||||
"subMetas": {},
|
"subMetas": {},
|
||||||
"userData": {
|
"userData": {
|
||||||
"syncNodeName": "box"
|
"syncNodeName": "sbox"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
34
assets/script/game/map/MissSkillsComp.ts
Normal file
34
assets/script/game/map/MissSkillsComp.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import { mLogger } from "../common/Logger";
|
||||||
|
import { _decorator, Node, Prefab } from "cc";
|
||||||
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
|
import { CardType } from "../common/config/CardSet";
|
||||||
|
import { oops } from "db://oops-framework/core/Oops";
|
||||||
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 视图层对象 */
|
||||||
|
@ccclass('MissSkillsComp')
|
||||||
|
@ecs.register('MissSkillsComp', false)
|
||||||
|
export class MissSkillsComp extends CCComp {
|
||||||
|
private debugMode: boolean = true;
|
||||||
|
@property({type: Prefab})
|
||||||
|
private skill_box: Prefab = null;
|
||||||
|
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||||
|
reset() {
|
||||||
|
this.node.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
9
assets/script/game/map/MissSkillsComp.ts.meta
Normal file
9
assets/script/game/map/MissSkillsComp.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"ver": "4.0.24",
|
||||||
|
"importer": "typescript",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "68387c27-1f8e-4056-8e8d-728fa95ed1b9",
|
||||||
|
"files": [],
|
||||||
|
"subMetas": {},
|
||||||
|
"userData": {}
|
||||||
|
}
|
||||||
34
assets/script/game/map/SkillBoxComp.ts
Normal file
34
assets/script/game/map/SkillBoxComp.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import { mLogger } from "../common/Logger";
|
||||||
|
import { _decorator, Node, Prefab } from "cc";
|
||||||
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||||
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
|
import { CardType } from "../common/config/CardSet";
|
||||||
|
import { oops } from "db://oops-framework/core/Oops";
|
||||||
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 视图层对象 */
|
||||||
|
@ccclass('SkillBoxComp')
|
||||||
|
@ecs.register('SkillBoxComp', false)
|
||||||
|
export class SkillBoxComp extends CCComp {
|
||||||
|
private debugMode: boolean = true;
|
||||||
|
@property({type: Node})
|
||||||
|
private icon_node:Node= null;
|
||||||
|
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||||
|
reset() {
|
||||||
|
this.node.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
9
assets/script/game/map/SkillBoxComp.ts.meta
Normal file
9
assets/script/game/map/SkillBoxComp.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"ver": "4.0.24",
|
||||||
|
"importer": "typescript",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "ca51918b-eae4-486b-82e8-ce89544a6a0d",
|
||||||
|
"files": [],
|
||||||
|
"subMetas": {},
|
||||||
|
"userData": {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user