dd
This commit is contained in:
@@ -31,17 +31,20 @@
|
||||
"__id__": 184
|
||||
},
|
||||
{
|
||||
"__id__": 200
|
||||
"__id__": 202
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 208
|
||||
"__id__": 210
|
||||
},
|
||||
{
|
||||
"__id__": 212
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 210
|
||||
"__id__": 214
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -881,7 +884,7 @@
|
||||
"__id__": 137
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 179
|
||||
@@ -2609,7 +2612,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Label",
|
||||
"_name": "num",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
@@ -3038,7 +3041,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Label",
|
||||
"_name": "num",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
@@ -4336,10 +4339,13 @@
|
||||
},
|
||||
{
|
||||
"__id__": 197
|
||||
},
|
||||
{
|
||||
"__id__": 199
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 199
|
||||
"__id__": 201
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -4553,7 +4559,7 @@
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 130,
|
||||
"height": 150
|
||||
"height": 200
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@@ -4634,6 +4640,42 @@
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "04UOxXonpCRZu3CFkEfDmk"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 184
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 200
|
||||
},
|
||||
"_alignFlags": 45,
|
||||
"_target": null,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 0,
|
||||
"_bottom": 0,
|
||||
"_horizontalCenter": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
"_isAbsRight": true,
|
||||
"_isAbsTop": true,
|
||||
"_isAbsBottom": true,
|
||||
"_isAbsHorizontalCenter": true,
|
||||
"_isAbsVerticalCenter": true,
|
||||
"_originalWidth": 130,
|
||||
"_originalHeight": 150,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "921Qx7uwBA759uBmFOW7Wq"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
@@ -4658,18 +4700,18 @@
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 201
|
||||
},
|
||||
{
|
||||
"__id__": 203
|
||||
},
|
||||
{
|
||||
"__id__": 205
|
||||
},
|
||||
{
|
||||
"__id__": 207
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 207
|
||||
"__id__": 209
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -4706,11 +4748,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 200
|
||||
"__id__": 202
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 202
|
||||
"__id__": 204
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -4734,11 +4776,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 200
|
||||
"__id__": 202
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 204
|
||||
"__id__": 206
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
@@ -4779,11 +4821,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 200
|
||||
"__id__": 202
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 206
|
||||
"__id__": 208
|
||||
},
|
||||
"_alignFlags": 45,
|
||||
"_target": null,
|
||||
@@ -4832,7 +4874,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 209
|
||||
"__id__": 211
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -4850,6 +4892,24 @@
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "2dp4xN/oRHP7ybc7yUFDkn"
|
||||
},
|
||||
{
|
||||
"__type__": "e06b1QGh45ILZndRut+0seo",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 213
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "d8ASfYekhH7pF5qSbpSwsX"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"_native": "",
|
||||
"sample": 60,
|
||||
"speed": 1,
|
||||
"wrapMode": 2,
|
||||
"wrapMode": 1,
|
||||
"enableTrsBlending": false,
|
||||
"_duration": 0.18333333333333332,
|
||||
"_hash": 500763545,
|
||||
@@ -70,7 +70,7 @@
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.1666666716337204
|
||||
0.16666666666666666
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
@@ -111,7 +111,7 @@
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.1666666716337204
|
||||
0.16666666666666666
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
@@ -152,7 +152,7 @@
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0,
|
||||
0.1666666716337204
|
||||
0.16666666666666666
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
@@ -242,8 +242,8 @@
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0.1666666716337204,
|
||||
0.18333333730697632
|
||||
0.16666666666666666,
|
||||
0.18333333333333332
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
@@ -283,8 +283,8 @@
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0.1666666716337204,
|
||||
0.18333333730697632
|
||||
0.16666666666666666,
|
||||
0.18333333333333332
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
@@ -324,8 +324,8 @@
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0.1666666716337204,
|
||||
0.18333333730697632
|
||||
0.16666666666666666,
|
||||
0.18333333333333332
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
@@ -365,8 +365,8 @@
|
||||
{
|
||||
"__type__": "cc.RealCurve",
|
||||
"_times": [
|
||||
0.1666666716337204,
|
||||
0.18333333730697632
|
||||
0.16666666666666666,
|
||||
0.18333333333333332
|
||||
],
|
||||
"_values": [
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,4 +15,5 @@ export enum GameEvent {
|
||||
MissionStart = "MissionStart",
|
||||
MissionEnd = "MissionEnd",
|
||||
CastSkill = "CastSkill",
|
||||
CardRefresh = "CardRefresh",
|
||||
}
|
||||
51
assets/script/game/map/CardComp.ts
Normal file
51
assets/script/game/map/CardComp.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { _decorator, Animation, Label, resources, SpriteAtlas,Sprite } 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 { GameEvent } from "../common/config/GameEvent";
|
||||
import { HeroInfo, HeroList } from "../common/config/heroSet";
|
||||
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('CardCompp')
|
||||
@ecs.register('Card', false)
|
||||
export class CardComp extends CCComp {
|
||||
c_uuid:number=0;
|
||||
c_type:number=0;
|
||||
onLoad(){
|
||||
this.on(GameEvent.CardRefresh,this.onCardRefresh,this)
|
||||
}
|
||||
start() {
|
||||
|
||||
}
|
||||
onCardRefresh(event: string, args: any){
|
||||
|
||||
let hero_list =HeroList
|
||||
let x=RandomManager.instance.getRandomInt(0,hero_list.length,1)
|
||||
this.c_uuid=hero_list[x]
|
||||
console.log("onCardRefresh c_uuid:"+this.c_uuid)
|
||||
this.update_card(this.c_uuid)
|
||||
this.node.getChildByName("show").active=false
|
||||
this.node.getChildByName("anim").getChildByName("up").getComponent(Animation).play('carsup')
|
||||
this.scheduleOnce(() => {
|
||||
this.node.getChildByName("show").active=true
|
||||
}, 0.1);
|
||||
|
||||
}
|
||||
update_card(uuid:number){
|
||||
let show=this.node.getChildByName("show")
|
||||
show.getChildByName("name").getComponent(Label).string=HeroInfo[uuid].name
|
||||
show.getChildByName("ap").getChildByName("num").getComponent(Label).string=HeroInfo[uuid].ap.toString()
|
||||
show.getChildByName("hp").getChildByName("num").getComponent(Label).string=HeroInfo[uuid].hp.toString()
|
||||
var icon_path = "game/heros/herois"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = show.getChildByName("mask").getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path);
|
||||
});
|
||||
|
||||
}
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
9
assets/script/game/map/CardComp.ts.meta
Normal file
9
assets/script/game/map/CardComp.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "e06b1406-878e-482d-99dd-46eb7ed2c7a8",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -174,7 +174,9 @@ export class MissionComp extends CCComp {
|
||||
smc.hero_back_x=right_x
|
||||
// console.log("count_hero_pos",smc.hero_pos,smc.hero_front_x,smc.mon_front_x)
|
||||
}
|
||||
|
||||
card_refresh(){
|
||||
oops.message.dispatchEvent(GameEvent.CardRefresh)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user