ui继续
This commit is contained in:
@@ -22,17 +22,17 @@
|
||||
"__id__": 2
|
||||
},
|
||||
{
|
||||
"__id__": 18
|
||||
"__id__": 26
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 24
|
||||
"__id__": 32
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 26
|
||||
"__id__": 34
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -74,22 +74,25 @@
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 3
|
||||
},
|
||||
{
|
||||
"__id__": 11
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 11
|
||||
"__id__": 19
|
||||
},
|
||||
{
|
||||
"__id__": 13
|
||||
"__id__": 21
|
||||
},
|
||||
{
|
||||
"__id__": 15
|
||||
"__id__": 23
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 17
|
||||
"__id__": 25
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -227,7 +230,7 @@
|
||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@7beff",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 3,
|
||||
"_type": 1,
|
||||
"_fillType": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillCenter": {
|
||||
@@ -291,8 +294,179 @@
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "61x78YGExIH5sbDV+PvuuK",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "Slider_Play_01_Border",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 2
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 12
|
||||
},
|
||||
{
|
||||
"__id__": 14
|
||||
},
|
||||
{
|
||||
"__id__": 16
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 18
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0.3,
|
||||
"y": 0.3,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 11
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 13
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 246.66666666666669,
|
||||
"height": 33.333333333333336
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "c7Cwn33JNAvp+kuH9WDEb+"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 11
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 15
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
"_dstBlendFactor": 4,
|
||||
"_color": {
|
||||
"__type__": "cc.Color",
|
||||
"r": 0,
|
||||
"g": 0,
|
||||
"b": 0,
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "49c583b3-d566-4c79-9e4c-bd0ca4a4b717@2edc0",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 1,
|
||||
"_fillType": 0,
|
||||
"_sizeMode": 0,
|
||||
"_fillCenter": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"_fillStart": 0,
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": null,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "a8Un8uEVBH+qZzlDSeBSr2"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 11
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 17
|
||||
},
|
||||
"_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": 74,
|
||||
"_originalHeight": 10,
|
||||
"_alignMode": 2,
|
||||
"_lockFlags": 0,
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "b2xNpsW7xBcaJIzT+6iaMc"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "c8R9MyTiNMVYI5gmckIEFe",
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
@@ -305,7 +479,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 12
|
||||
"__id__": 20
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -333,7 +507,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 14
|
||||
"__id__": 22
|
||||
},
|
||||
"_customMaterial": null,
|
||||
"_srcBlendFactor": 2,
|
||||
@@ -378,13 +552,13 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 16
|
||||
"__id__": 24
|
||||
},
|
||||
"_barSprite": {
|
||||
"__id__": 6
|
||||
},
|
||||
"_mode": 2,
|
||||
"_totalLength": 1,
|
||||
"_mode": 0,
|
||||
"_totalLength": 72,
|
||||
"_progress": 1,
|
||||
"_reverse": false,
|
||||
"_id": ""
|
||||
@@ -402,8 +576,6 @@
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "4bGUhFXlZF/Jdkcq0HY9ai",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
@@ -418,14 +590,14 @@
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 19
|
||||
"__id__": 27
|
||||
},
|
||||
{
|
||||
"__id__": 21
|
||||
"__id__": 29
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 23
|
||||
"__id__": 31
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -462,11 +634,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 18
|
||||
"__id__": 26
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 20
|
||||
"__id__": 28
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -490,11 +662,11 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 18
|
||||
"__id__": 26
|
||||
},
|
||||
"_enabled": false,
|
||||
"__prefab": {
|
||||
"__id__": 22
|
||||
"__id__": 30
|
||||
},
|
||||
"_resizeMode": 2,
|
||||
"_layoutType": 3,
|
||||
@@ -545,7 +717,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 25
|
||||
"__id__": 33
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
|
||||
1207
assets/resources/gui/element/goodsbg.prefab
Normal file
1207
assets/resources/gui/element/goodsbg.prefab
Normal file
File diff suppressed because it is too large
Load Diff
13
assets/resources/gui/element/goodsbg.prefab.meta
Normal file
13
assets/resources/gui/element/goodsbg.prefab.meta
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"ver": "1.1.50",
|
||||
"importer": "prefab",
|
||||
"imported": true,
|
||||
"uuid": "218c9dd2-f53a-41f5-a4c2-b74fecb468fa",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"syncNodeName": "goodsbg"
|
||||
}
|
||||
}
|
||||
@@ -23,24 +23,27 @@
|
||||
},
|
||||
{
|
||||
"__id__": 10
|
||||
},
|
||||
{
|
||||
"__id__": 80
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 80
|
||||
"__id__": 84
|
||||
},
|
||||
{
|
||||
"__id__": 82
|
||||
"__id__": 86
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 84
|
||||
"__id__": 88
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": -411.134,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
@@ -1820,6 +1823,94 @@
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "mission",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 1
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 81
|
||||
}
|
||||
],
|
||||
"_prefab": {
|
||||
"__id__": 83
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": -138.648,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 80
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 82
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 400,
|
||||
"height": 80
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
"x": 0.5,
|
||||
"y": 0.5
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "11Al6TSD1JZrvcRZ6s9OJD"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
"root": {
|
||||
"__id__": 1
|
||||
},
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "7f7Gz9qptNA7d3o+RJRvBg",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.UITransform",
|
||||
"_name": "",
|
||||
@@ -1830,7 +1921,7 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 81
|
||||
"__id__": 85
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
@@ -1858,14 +1949,14 @@
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": {
|
||||
"__id__": 83
|
||||
"__id__": 87
|
||||
},
|
||||
"_alignFlags": 44,
|
||||
"_target": null,
|
||||
"_left": 0,
|
||||
"_right": 0,
|
||||
"_top": 1180,
|
||||
"_bottom": 193.866,
|
||||
"_bottom": 605,
|
||||
"_horizontalCenter": 0,
|
||||
"_verticalCenter": 0,
|
||||
"_isAbsLeft": true,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
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: 500 KiB After Width: | Height: | Size: 536 KiB |
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: 936 KiB After Width: | Height: | Size: 963 KiB |
@@ -55,6 +55,9 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
score:0,//分数
|
||||
diamond:0,//钻石
|
||||
mission:1,//关卡
|
||||
chapter:1,//章节
|
||||
level:1,//关卡等级
|
||||
max_mission:10,//最大关卡
|
||||
meat:0,//肉
|
||||
mon_num:0,//怪物数量
|
||||
hero_num:0,//英雄数量
|
||||
@@ -407,6 +410,11 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
this.vmdata.mission_data.diamond=this.getGameProperty("diamond", 0)
|
||||
this.vmdata.mission_data.mission=this.getGameProperty("mission", 1)
|
||||
this.vmdata.mission_data.score=this.getGameProperty("score", 0)
|
||||
|
||||
// 计算章节和关卡等级
|
||||
const currentMission = this.getGameProperty("mission", 1)
|
||||
this.vmdata.mission_data.chapter = Math.floor((currentMission - 1) / 10) + 1
|
||||
this.vmdata.mission_data.level = ((currentMission - 1) % 10) + 1
|
||||
}
|
||||
initReward(){
|
||||
this.vmdata.reward.gold=0
|
||||
@@ -493,6 +501,22 @@ export class SingletonModuleComp extends ecs.Comp {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加关卡进度
|
||||
* @param amount 增加的关卡数 (默认1)
|
||||
* @param autoSave 是否自动保存 (默认true)
|
||||
*/
|
||||
addMission(amount: number = 1, autoSave: boolean = true) {
|
||||
const currentMission = this.getGameProperty("mission", 1);
|
||||
const newMission = currentMission + amount;
|
||||
this.setGameProperty("mission", newMission, autoSave);
|
||||
console.log(`[SMC]: 关卡进度增加: ${currentMission} -> ${newMission} (+${amount})`);
|
||||
// 计算章节和关卡等级
|
||||
this.vmdata.mission_data.chapter = Math.floor((newMission - 1) / 10) + 1
|
||||
this.vmdata.mission_data.level = ((newMission - 1) % 10) + 1
|
||||
return newMission;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前关卡进度
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@ export class MissionComp extends CCComp {
|
||||
smc.vmdata.mission_data.mon_num--
|
||||
console.log("[MissionComp] do_mon_dead",smc.vmdata.mission_data.mon_num)
|
||||
if(smc.vmdata.mission_data.mon_num<=0) {
|
||||
smc.setGameProperty("mission",smc.data.mission+1,true)
|
||||
smc.addMission()
|
||||
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:true})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,22 +31,51 @@ export class MissionHomeComp extends CCComp {
|
||||
home_active(){
|
||||
this.uodate_data()
|
||||
this.node.active=true
|
||||
this.btn_func("","fight")
|
||||
oops.message.dispatchEvent(GameEvent.UpdateHero, {})
|
||||
}
|
||||
uodate_data(){
|
||||
smc.syncData()
|
||||
}
|
||||
btn_func(e:string,data:any){
|
||||
let btns=this.node.getChildByName("btns")
|
||||
let btn=btns.getChildByName(data)
|
||||
let act=btn.getChildByName("act")
|
||||
console.log("[MissionHomeComp]:btn_func",e,data)
|
||||
if(act.active){
|
||||
act.active=false
|
||||
}else{
|
||||
act.active=true
|
||||
let btns=this.node.getChildByName("btns")
|
||||
let shop =btns.getChildByName("shop")
|
||||
let heros =btns.getChildByName("heros")
|
||||
let fight =btns.getChildByName("fight")
|
||||
let skill =btns.getChildByName("skill")
|
||||
let set =btns.getChildByName("set")
|
||||
shop.getChildByName("act").active=false
|
||||
heros.getChildByName("act").active=false
|
||||
fight.getChildByName("act").active=false
|
||||
skill.getChildByName("act").active=false
|
||||
set.getChildByName("act").active=false
|
||||
this.node.getChildByName("shop").active=false
|
||||
// this.node.getChildByName("heros").active=false
|
||||
// this.node.getChildByName("fight").active=false
|
||||
// this.node.getChildByName("skill").active=false
|
||||
// this.node.getChildByName("set").active=false
|
||||
switch(data){
|
||||
case "shop":
|
||||
this.node.getChildByName("shop").active=true
|
||||
shop.getChildByName("act").active=true
|
||||
break
|
||||
case "heros":
|
||||
heros.getChildByName("act").active=true
|
||||
break
|
||||
case "fight":
|
||||
fight.getChildByName("act").active=true
|
||||
break
|
||||
case "skill":
|
||||
skill.getChildByName("act").active=true
|
||||
break
|
||||
case "set":
|
||||
set.getChildByName("act").active=true
|
||||
break
|
||||
default:
|
||||
fight.getChildByName("act").active=true
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user