ui重做
This commit is contained in:
1522
assets/resources/game/gui/card.prefab
Normal file
1522
assets/resources/game/gui/card.prefab
Normal file
File diff suppressed because it is too large
Load Diff
13
assets/resources/game/gui/card.prefab.meta
Normal file
13
assets/resources/game/gui/card.prefab.meta
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.1.50",
|
||||||
|
"importer": "prefab",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "2849e90f-15b2-4082-a7b6-1ff1362f537b",
|
||||||
|
"files": [
|
||||||
|
".json"
|
||||||
|
],
|
||||||
|
"subMetas": {},
|
||||||
|
"userData": {
|
||||||
|
"syncNodeName": "card"
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -50,8 +50,8 @@
|
|||||||
"height": 250,
|
"height": 250,
|
||||||
"rawWidth": 1775,
|
"rawWidth": 1775,
|
||||||
"rawHeight": 250,
|
"rawHeight": 250,
|
||||||
"borderTop": 227,
|
"borderTop": 57,
|
||||||
"borderBottom": 0,
|
"borderBottom": 181,
|
||||||
"borderLeft": 0,
|
"borderLeft": 0,
|
||||||
"borderRight": 0,
|
"borderRight": 0,
|
||||||
"packable": true,
|
"packable": true,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
405
assets/resources/gui/anim/carsup.anim
Normal file
405
assets/resources/gui/anim/carsup.anim
Normal file
@@ -0,0 +1,405 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"__type__": "cc.AnimationClip",
|
||||||
|
"_name": "carsup",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {
|
||||||
|
"embeddedPlayerGroups": []
|
||||||
|
},
|
||||||
|
"_native": "",
|
||||||
|
"sample": 60,
|
||||||
|
"speed": 1,
|
||||||
|
"wrapMode": 2,
|
||||||
|
"enableTrsBlending": false,
|
||||||
|
"_duration": 0.18333333333333332,
|
||||||
|
"_hash": 500763545,
|
||||||
|
"_tracks": [
|
||||||
|
{
|
||||||
|
"__id__": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 11
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"_exoticAnimation": null,
|
||||||
|
"_events": [],
|
||||||
|
"_embeddedPlayers": [],
|
||||||
|
"_additiveSettings": {
|
||||||
|
"__id__": 22
|
||||||
|
},
|
||||||
|
"_auxiliaryCurveEntries": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.VectorTrack",
|
||||||
|
"_binding": {
|
||||||
|
"__type__": "cc.animation.TrackBinding",
|
||||||
|
"path": {
|
||||||
|
"__id__": 2
|
||||||
|
},
|
||||||
|
"proxy": null
|
||||||
|
},
|
||||||
|
"_channels": [
|
||||||
|
{
|
||||||
|
"__id__": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 7
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 9
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"_nComponents": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.TrackPath",
|
||||||
|
"_paths": [
|
||||||
|
"scale"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.Channel",
|
||||||
|
"_curve": {
|
||||||
|
"__id__": 4
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealCurve",
|
||||||
|
"_times": [
|
||||||
|
0,
|
||||||
|
0.1666666716337204
|
||||||
|
],
|
||||||
|
"_values": [
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 0,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 10,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preExtrapolation": 1,
|
||||||
|
"postExtrapolation": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.Channel",
|
||||||
|
"_curve": {
|
||||||
|
"__id__": 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealCurve",
|
||||||
|
"_times": [
|
||||||
|
0,
|
||||||
|
0.1666666716337204
|
||||||
|
],
|
||||||
|
"_values": [
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 0,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 10,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preExtrapolation": 1,
|
||||||
|
"postExtrapolation": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.Channel",
|
||||||
|
"_curve": {
|
||||||
|
"__id__": 8
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealCurve",
|
||||||
|
"_times": [
|
||||||
|
0,
|
||||||
|
0.1666666716337204
|
||||||
|
],
|
||||||
|
"_values": [
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 1,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 1,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preExtrapolation": 1,
|
||||||
|
"postExtrapolation": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.Channel",
|
||||||
|
"_curve": {
|
||||||
|
"__id__": 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealCurve",
|
||||||
|
"_times": [],
|
||||||
|
"_values": [],
|
||||||
|
"preExtrapolation": 1,
|
||||||
|
"postExtrapolation": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.ColorTrack",
|
||||||
|
"_binding": {
|
||||||
|
"__type__": "cc.animation.TrackBinding",
|
||||||
|
"path": {
|
||||||
|
"__id__": 12
|
||||||
|
},
|
||||||
|
"proxy": null
|
||||||
|
},
|
||||||
|
"_channels": [
|
||||||
|
{
|
||||||
|
"__id__": 14
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 16
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 18
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 20
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.TrackPath",
|
||||||
|
"_paths": [
|
||||||
|
{
|
||||||
|
"__id__": 13
|
||||||
|
},
|
||||||
|
"color"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.ComponentPath",
|
||||||
|
"component": "cc.Sprite"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.Channel",
|
||||||
|
"_curve": {
|
||||||
|
"__id__": 15
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealCurve",
|
||||||
|
"_times": [
|
||||||
|
0.1666666716337204,
|
||||||
|
0.18333333730697632
|
||||||
|
],
|
||||||
|
"_values": [
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 255,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 255,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preExtrapolation": 1,
|
||||||
|
"postExtrapolation": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.Channel",
|
||||||
|
"_curve": {
|
||||||
|
"__id__": 17
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealCurve",
|
||||||
|
"_times": [
|
||||||
|
0.1666666716337204,
|
||||||
|
0.18333333730697632
|
||||||
|
],
|
||||||
|
"_values": [
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 255,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 255,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preExtrapolation": 1,
|
||||||
|
"postExtrapolation": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.Channel",
|
||||||
|
"_curve": {
|
||||||
|
"__id__": 19
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealCurve",
|
||||||
|
"_times": [
|
||||||
|
0.1666666716337204,
|
||||||
|
0.18333333730697632
|
||||||
|
],
|
||||||
|
"_values": [
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 255,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 255,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preExtrapolation": 1,
|
||||||
|
"postExtrapolation": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.animation.Channel",
|
||||||
|
"_curve": {
|
||||||
|
"__id__": 21
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealCurve",
|
||||||
|
"_times": [
|
||||||
|
0.1666666716337204,
|
||||||
|
0.18333333730697632
|
||||||
|
],
|
||||||
|
"_values": [
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 255,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.RealKeyframeValue",
|
||||||
|
"interpolationMode": 0,
|
||||||
|
"tangentWeightMode": 0,
|
||||||
|
"value": 0,
|
||||||
|
"rightTangent": 0,
|
||||||
|
"rightTangentWeight": 1,
|
||||||
|
"leftTangent": 0,
|
||||||
|
"leftTangentWeight": 1,
|
||||||
|
"easingMethod": 0,
|
||||||
|
"__editorExtras__": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"preExtrapolation": 1,
|
||||||
|
"postExtrapolation": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.AnimationClipAdditiveSettings",
|
||||||
|
"enabled": false,
|
||||||
|
"refClip": null
|
||||||
|
}
|
||||||
|
]
|
||||||
13
assets/resources/gui/anim/carsup.anim.meta
Normal file
13
assets/resources/gui/anim/carsup.anim.meta
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"ver": "2.0.3",
|
||||||
|
"importer": "animation-clip",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "322cf75e-d992-47d7-9886-ae644b65de10",
|
||||||
|
"files": [
|
||||||
|
".cconb"
|
||||||
|
],
|
||||||
|
"subMetas": {},
|
||||||
|
"userData": {
|
||||||
|
"name": "carsup"
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 1021 KiB After Width: | Height: | Size: 1.0 MiB |
@@ -1129,10 +1129,10 @@
|
|||||||
"height": 110,
|
"height": 110,
|
||||||
"rawWidth": 110,
|
"rawWidth": 110,
|
||||||
"rawHeight": 110,
|
"rawHeight": 110,
|
||||||
"borderTop": 0,
|
"borderTop": 55,
|
||||||
"borderBottom": 0,
|
"borderBottom": 55,
|
||||||
"borderLeft": 0,
|
"borderLeft": 55,
|
||||||
"borderRight": 0,
|
"borderRight": 55,
|
||||||
"packable": true,
|
"packable": true,
|
||||||
"pixelsToUnit": 100,
|
"pixelsToUnit": 100,
|
||||||
"pivotX": 0.5,
|
"pivotX": 0.5,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -25,28 +25,18 @@ export class MissionHomeComp extends CCComp {
|
|||||||
{uuid:0,px:-300},
|
{uuid:0,px:-300},
|
||||||
]
|
]
|
||||||
protected onLoad(): void {
|
protected onLoad(): void {
|
||||||
oops.message.on("hero_card_select", this.select_hero, this);
|
|
||||||
oops.message.on("hero_card_cancel_select", this.cancel_hero, this);
|
|
||||||
}
|
}
|
||||||
/** 视图层逻辑代码分离演示 */
|
/** 视图层逻辑代码分离演示 */
|
||||||
start() {
|
start() {
|
||||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||||
this.load_hero_card()
|
|
||||||
this.load_ui_heros()
|
this.load_ui_heros()
|
||||||
// this.load_skill_card()
|
|
||||||
// this.select_skill()
|
|
||||||
this.init_buff()
|
|
||||||
}
|
}
|
||||||
to_start(){
|
to_start(){
|
||||||
this.show_heros()
|
|
||||||
}
|
}
|
||||||
start_mission() {
|
start_mission() {
|
||||||
if (this.heros.length <=0 ) {
|
|
||||||
oops.gui.toast("请先选择英雄")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.hide_heros()
|
|
||||||
for(let i=0;i<this.heros.length;i++){
|
for(let i=0;i<this.heros.length;i++){
|
||||||
this.heros[i].to_destroy()
|
this.heros[i].to_destroy()
|
||||||
}
|
}
|
||||||
@@ -59,107 +49,15 @@ export class MissionHomeComp extends CCComp {
|
|||||||
oops.message.dispatchEvent(GameEvent.MissionStart, {})
|
oops.message.dispatchEvent(GameEvent.MissionStart, {})
|
||||||
this.node.active=false;
|
this.node.active=false;
|
||||||
}
|
}
|
||||||
init_buff(){
|
|
||||||
smc.vmdata.mission.ap_up=MBSet.ap_add*smc.vmdata.buff_num[0]/MBSet.ap_cost
|
|
||||||
smc.vmdata.mission.def_up=MBSet.def_add*smc.vmdata.buff_num[1]/MBSet.def_cost
|
|
||||||
smc.vmdata.mission.hp_up=MBSet.hp_add*smc.vmdata.buff_num[2]/MBSet.hp_cost
|
|
||||||
smc.vmdata.mission.crit_up=MBSet.crit_add*smc.vmdata.buff_num[3]/MBSet.crit_cost
|
|
||||||
smc.vmdata.mission.dodge_up=MBSet.dodge_add*smc.vmdata.buff_num[4]/MBSet.dodge_cost
|
|
||||||
smc.vmdata.buff_num_less=smc.vmdata.buff_num_max-smc.vmdata.buff_num[0]-smc.vmdata.buff_num[1]-smc.vmdata.buff_num[2]-smc.vmdata.buff_num[3]-smc.vmdata.buff_num[4]
|
|
||||||
|
|
||||||
}
|
|
||||||
load_hero_card(){
|
|
||||||
|
|
||||||
let hc:number =HeroList.length
|
|
||||||
let parent= this.node.getChildByName("heros").getChildByName("view").getChildByName("content")
|
|
||||||
let height=Math.ceil(hc / 4)*160 +100
|
|
||||||
parent.getComponent(UITransform).height=height
|
|
||||||
|
|
||||||
for (let i = 0; i < hc; i++) {
|
|
||||||
// if (HeroInfo[HeroList[i]].quality==3) {
|
|
||||||
let hcc =ecs.getEntity<HeroSelect>(HeroSelect)
|
|
||||||
hcc.load(HeroList[i],parent)
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
// for (let i = 0; i < hc; i++) {
|
|
||||||
// if (HeroInfo[HeroList[i]].quality==2) {
|
|
||||||
// let hcc =ecs.getEntity<HeroSelect>(HeroSelect)
|
|
||||||
// hcc.load(HeroList[i],parent)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// for (let i = 0; i < hc; i++) {
|
|
||||||
// if (HeroInfo[HeroList[i]].quality==1) {
|
|
||||||
// let hcc =ecs.getEntity<HeroSelect>(HeroSelect)
|
|
||||||
// hcc.load(HeroList[i],parent)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
this.update_hero_cards()
|
|
||||||
}
|
|
||||||
update_hero_cards(){
|
|
||||||
let loaded:any = ecs.query(ecs.allOf(HeroSelectComp));
|
|
||||||
for(let i=0;i<loaded.length;i++){
|
|
||||||
if(smc.heros[loaded[i].HeroSelectComp.h_uuid].slv ==0 ) {
|
|
||||||
loaded[i].HeroSelectComp.node.active=false
|
|
||||||
}else{
|
|
||||||
loaded[i].HeroSelectComp.node.active=true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
load_skill_card(){
|
|
||||||
|
|
||||||
}
|
|
||||||
load_ui_heros(){
|
load_ui_heros(){
|
||||||
for(let i=0;i<smc.fight_heros.length;i++){
|
|
||||||
this.select_hero("local",{uuid:smc.fight_heros[i]})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
select_hero(event:any,args:any){
|
|
||||||
console.log("select_hero",args.uuid)
|
|
||||||
for(let i=0;i<GameSet.HERO_NUM;i++){
|
|
||||||
if(this.heros_pos[i].uuid==0){
|
|
||||||
this.heros_pos[i].uuid=args.uuid
|
|
||||||
this.call_hero(args.uuid,i)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cancel_hero(event:any,args:any){
|
|
||||||
for(let i=0;i<GameSet.HERO_NUM;i++){
|
|
||||||
if(this.heros_pos[i].uuid==args.uuid){
|
|
||||||
this.heros_pos[i].uuid=0
|
|
||||||
this.destory_hero(args.uuid)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
call_hero(h_uuid:number,index:number){
|
|
||||||
var path = "game/heros/uiheros/"+HeroInfo[h_uuid].path;
|
|
||||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
||||||
var node = instantiate(prefab);
|
|
||||||
var scene = smc.map.MapView.scene;
|
|
||||||
node.parent = scene.entityLayer!.node!
|
|
||||||
node.setPosition(this.heros_pos[index].px,BoxSet.GAME_LINE,0);
|
|
||||||
let comp = node.getComponent(UiHeroComp)
|
|
||||||
comp.h_uuid = h_uuid
|
|
||||||
this.heros.push(comp)
|
|
||||||
}
|
|
||||||
destory_hero(h_uuid:number){
|
|
||||||
for(let i=0;i<this.heros.length;i++){
|
|
||||||
if(this.heros[i].h_uuid==h_uuid){
|
|
||||||
this.heros[i].to_destroy()
|
|
||||||
this.heros.splice(i,1)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
show_heros(){
|
|
||||||
this.node.getChildByName("heros").setPosition(0,290)
|
|
||||||
}
|
|
||||||
hide_heros(){
|
|
||||||
this.node.getChildByName("heros").setPosition(0,-800)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||||
reset() {
|
reset() {
|
||||||
this.node.destroy();
|
this.node.destroy();
|
||||||
|
|||||||
Reference in New Issue
Block a user