yangqiwen 2 months ago
parent f35d2e1e1c
commit 3a5d222b71
  1. BIN
      assets/CommonRes/texture/newTexture/当前任务(未完成).png
  2. 38
      assets/CommonRes/texture/newTexture/当前任务(未完成).png.meta
  3. BIN
      assets/GameMethodRes/shouhuoji/newTexture/按钮购买.png
  4. 38
      assets/GameMethodRes/shouhuoji/newTexture/按钮购买.png.meta
  5. 8
      assets/GameMethodRes/shouhuoji/prefab/ShouHuoJiGai.prefab
  6. BIN
      assets/GameMethodRes/shouhuoji/texture/背景.jpg
  7. 13
      assets/JianZao.meta
  8. 13
      assets/JianZao/prefab.meta
  9. 1439
      assets/JianZao/prefab/JianZao.prefab
  10. 9
      assets/JianZao/prefab/JianZao.prefab.meta
  11. 13
      assets/JianZao/res.meta
  12. BIN
      assets/JianZao/res/×.png
  13. 38
      assets/JianZao/res/×.png.meta
  14. BIN
      assets/JianZao/res/店铺图片(临时).png
  15. 38
      assets/JianZao/res/店铺图片(临时).png.meta
  16. BIN
      assets/JianZao/res/弹窗建造产业.png
  17. 38
      assets/JianZao/res/弹窗建造产业.png.meta
  18. BIN
      assets/JianZao/res/按钮建造.png
  19. 38
      assets/JianZao/res/按钮建造.png.meta
  20. BIN
      assets/JianZao/res/按钮建造置灰.png
  21. 38
      assets/JianZao/res/按钮建造置灰.png.meta
  22. BIN
      assets/JianZao/res/钞票.png
  23. 38
      assets/JianZao/res/钞票.png.meta
  24. 750
      assets/LixianGame/prefab/LixianGame.prefab
  25. 4
      assets/MainHall/prefab/DiaoLuo.prefab
  26. 1289
      assets/MainHall/prefab/MainHall.prefab
  27. BIN
      assets/MainHall/texture/侧边栏.png
  28. 12
      assets/MainHall/texture/侧边栏.png.meta
  29. BIN
      assets/MainHall/texture/入口有奖.png
  30. 12
      assets/MainHall/texture/入口有奖.png.meta
  31. 8
      assets/MainScene/MainScene.fire
  32. 1049
      assets/PeopleLevelUp/prefab/PeopleLevelUp.prefab
  33. BIN
      assets/PeopleLevelUp/texture/1/晋升.png
  34. BIN
      assets/PeopleLevelUp/texture/1/秒赚条.png
  35. 38
      assets/PeopleLevelUp/texture/1/秒赚条.png.meta
  36. 13
      assets/Scripts/JianZao.meta
  37. 56
      assets/Scripts/JianZao/JianZao.ts
  38. 10
      assets/Scripts/JianZao/JianZao.ts.meta
  39. 13
      assets/Scripts/LixianGame/LixianGameScript.ts
  40. 47
      assets/Scripts/MainHall/MainHall.ts
  41. 95
      assets/Scripts/Manager/ZaoCanManager.ts
  42. 1
      assets/Scripts/PeopleLevelUp/PeopleLevelUpScript.ts
  43. 19
      assets/Scripts/PeopleLevelUp/jiachengItem.ts

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "5b5731ac-7aa0-4693-bf32-d42a808ba775",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 49,
"height": 49,
"platformSettings": {},
"subMetas": {
"当前任务(未完成)": {
"ver": "1.0.6",
"uuid": "1fc8bda6-d295-4ecd-b6f9-7ca567083981",
"importer": "sprite-frame",
"rawTextureUuid": "5b5731ac-7aa0-4693-bf32-d42a808ba775",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 49,
"height": 49,
"rawWidth": 49,
"rawHeight": 49,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "270f582b-3648-4142-8d64-b40389d70d4f",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 174,
"height": 74,
"platformSettings": {},
"subMetas": {
"按钮购买": {
"ver": "1.0.6",
"uuid": "501465f6-8f07-460f-9116-c1fc8cf9c3ee",
"importer": "sprite-frame",
"rawTextureUuid": "270f582b-3648-4142-8d64-b40389d70d4f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 174,
"height": 74,
"rawWidth": 174,
"rawHeight": 74,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

@ -2428,8 +2428,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 168,
"height": 80
"width": 174,
"height": 74
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@ -2473,7 +2473,7 @@
"__id__": 66
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 68
@ -2850,7 +2850,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "71668072-5839-43bf-9041-ea6a3fba313e"
"__uuid__": "501465f6-8f07-460f-9116-c1fc8cf9c3ee"
},
"_type": 0,
"_sizeMode": 1,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 222 KiB

@ -0,0 +1,13 @@
{
"ver": "1.1.3",
"uuid": "5d9fdd42-3370-47c3-b02a-26f7f823a7c7",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}

@ -0,0 +1,13 @@
{
"ver": "1.1.3",
"uuid": "e0c9d2fb-0bc1-44dc-985c-50614fc52e49",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,9 @@
{
"ver": "1.3.2",
"uuid": "2546e336-2f40-4c81-81ed-e4b4a4381ce0",
"importer": "prefab",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}

@ -0,0 +1,13 @@
{
"ver": "1.1.3",
"uuid": "8d747218-cdf3-42ea-8c44-43a189987d2e",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "91b3513f-b336-4edd-bb73-55dcaee8ac35",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 84,
"height": 96,
"platformSettings": {},
"subMetas": {
"×": {
"ver": "1.0.6",
"uuid": "cbc1b414-fd91-4f74-87f0-129e30c11176",
"importer": "sprite-frame",
"rawTextureUuid": "91b3513f-b336-4edd-bb73-55dcaee8ac35",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 84,
"height": 96,
"rawWidth": 84,
"rawHeight": 96,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "9e0d9aea-8e98-4b27-845d-78b996e27a3f",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 164,
"height": 126,
"platformSettings": {},
"subMetas": {
"店铺图片(临时)": {
"ver": "1.0.6",
"uuid": "b6c5072d-7dc1-4397-81ef-bc7f295e257f",
"importer": "sprite-frame",
"rawTextureUuid": "9e0d9aea-8e98-4b27-845d-78b996e27a3f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 164,
"height": 126,
"rawWidth": 164,
"rawHeight": 126,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "6ecf6a46-d626-42ce-9da4-8f7b15d4031c",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 472,
"height": 617,
"platformSettings": {},
"subMetas": {
"弹窗建造产业": {
"ver": "1.0.6",
"uuid": "33866011-8a19-46dd-9195-1129cc10c586",
"importer": "sprite-frame",
"rawTextureUuid": "6ecf6a46-d626-42ce-9da4-8f7b15d4031c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 472,
"height": 617,
"rawWidth": 472,
"rawHeight": 617,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "2cd067d5-da18-4393-87de-6316636d586e",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 157,
"height": 66,
"platformSettings": {},
"subMetas": {
"按钮建造": {
"ver": "1.0.6",
"uuid": "32e6b115-e879-4e2f-b67a-063af43aaaba",
"importer": "sprite-frame",
"rawTextureUuid": "2cd067d5-da18-4393-87de-6316636d586e",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 157,
"height": 66,
"rawWidth": 157,
"rawHeight": 66,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "27650c06-1abd-47d9-acee-9a6f3b6afe3c",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 157,
"height": 66,
"platformSettings": {},
"subMetas": {
"按钮建造置灰": {
"ver": "1.0.6",
"uuid": "95ad92f7-6c2b-491f-a8eb-a206a39094a9",
"importer": "sprite-frame",
"rawTextureUuid": "27650c06-1abd-47d9-acee-9a6f3b6afe3c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 157,
"height": 66,
"rawWidth": 157,
"rawHeight": 66,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "220a4ca2-1c8a-4b5d-a5f2-0068fd93e1ac",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 27,
"height": 19,
"platformSettings": {},
"subMetas": {
"钞票": {
"ver": "1.0.6",
"uuid": "e81507a0-19d2-4d1a-b5e5-f456735180a4",
"importer": "sprite-frame",
"rawTextureUuid": "220a4ca2-1c8a-4b5d-a5f2-0068fd93e1ac",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 27,
"height": 19,
"rawWidth": 27,
"rawHeight": 19,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

File diff suppressed because it is too large Load Diff

@ -48,8 +48,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
375,
667,
0,
0,
0,
0,
0,

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

@ -8,8 +8,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 109,
"height": 100,
"width": 93,
"height": 83,
"platformSettings": {},
"subMetas": {
"侧边栏": {
@ -24,10 +24,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 93,
"height": 83,
"rawWidth": 93,
"rawHeight": 83,
"width": 57,
"height": 73,
"rawWidth": 57,
"rawHeight": 73,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -8,8 +8,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 93,
"height": 84,
"width": 57,
"height": 74,
"platformSettings": {},
"subMetas": {
"入口有奖": {
@ -24,10 +24,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 93,
"height": 84,
"rawWidth": 93,
"rawHeight": 84,
"width": 57,
"height": 74,
"rawWidth": 57,
"rawHeight": 74,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,

@ -751,8 +751,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
41.886999999999944,
521.637,
-229.48699999999997,
492.25199999999995,
0,
0,
0,
@ -787,9 +787,9 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 571.887,
"_left": 300.51300000000003,
"_right": 0,
"_top": 125.36300000000006,
"_top": 154.74800000000005,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "2de65ef6-7800-4d3c-b775-24e1b638dc79",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 90,
"height": 23,
"platformSettings": {},
"subMetas": {
"秒赚条": {
"ver": "1.0.6",
"uuid": "41f80717-a662-4764-9060-56d3f3d79451",
"importer": "sprite-frame",
"rawTextureUuid": "2de65ef6-7800-4d3c-b775-24e1b638dc79",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 90,
"height": 23,
"rawWidth": 90,
"rawHeight": 23,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

@ -0,0 +1,13 @@
{
"ver": "1.1.3",
"uuid": "c3ca0dce-e0a3-4c1a-bdf5-a034bb154def",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}

@ -0,0 +1,56 @@
// Learn TypeScript:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
import UserManager from "../Manager/UserManager";
const { ccclass, property } = cc._decorator;
@ccclass
export default class JianZao extends cc.Component {
@property({ type: cc.Label, displayName: '产业名字' })
name_Label: cc.Label = null;
@property({ type: cc.Label, displayName: '店铺收入' })
shouru_Label: cc.Label = null;
@property({ type: cc.Label, displayName: '开设提示' })
kaishe_Label: cc.Label = null;
@property({ type: cc.Label, displayName: '需要资金' })
price_Label: cc.Label = null;
price: number;
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start() {
}
init(name, shouru, price) {
this.name_Label.string = `${name}`
this.shouru_Label.string = `${shouru}`
this.kaishe_Label.string = `开设${name}需要资金:`
this.price_Label.string = `${price}`
this.price = price
}
onTouchJianZao() {
UserManager.subMoney(this.price)
this.onTouchClose()
}
onTouchClose() {
this.node.removeFromParent()
this.node.destroy()
}
// update (dt) {}
}

@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "dd7e5aac-74d0-47dc-a62a-6ea54c0dcb68",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

@ -22,6 +22,9 @@ export default class LixianGameScript extends UiBase {
@property(cc.Label)
moneyLab: cc.Label = null;
@property(cc.Label)
timeLab: cc.Label = null;
moneyNum = 0
start() {
@ -30,13 +33,15 @@ export default class LixianGameScript extends UiBase {
console.log(time1, 'fen+++++++++++===')
let earnMoney = LevelUpManager.levelUpSpned()
console.log(earnMoney, 'earnMoney+++++++++++===')
let maxTime = 4.5 * 60 //最大累计离线时间
if (time1 < 10) {
earnMoney = earnMoney * time1 * 0.002
} else if (time1 >= 10 && time1 <= 1440) {
} else if (time1 >= 10 && time1 <= maxTime) {
earnMoney = earnMoney * time1 * 0.002
} else if (time1 > 1440) {
earnMoney = earnMoney * 1440 * 0.002
} else if (time1 > maxTime) {
earnMoney = earnMoney * maxTime * 0.002
}
if (earnMoney < 50000) {
@ -44,7 +49,7 @@ export default class LixianGameScript extends UiBase {
}
this.moneyNum = earnMoney
this.moneyLab.string = Common5.getNumberChangeHanzi(earnMoney) + ''
this.timeLab.string = `${time0}`
}

@ -22,6 +22,7 @@ import MiShuManager from "../Manager/MiShuManager";
import ShipuManager from "../Manager/ShipuManager";
import TanWeiManager from "../Manager/TanWeiManager";
import UserManager from "../Manager/UserManager";
import ZaoCanManager from "../Manager/ZaoCanManager";
import ZiChanManager from "../Manager/ZiChanManager";
import NewGuideScript from "../NewGuide/NewGuideScript";
//import NewGuideScript2 from "../NewGuide/NewGuideScript2";
@ -44,6 +45,9 @@ export default class MainHall extends UiBase {
@property(cc.Label)
secondMoneyLab: cc.Label = null;
@property(cc.Label)
danJiaMoneyLab: cc.Label = null;
@property(cc.Sprite)
chenghaoPic: cc.Sprite = null;
@property(cc.Label)
@ -980,6 +984,10 @@ export default class MainHall extends UiBase {
this.clickMoneyLab.string = '' + Common5.getNumberChangeHanzi(clickNum) + '/次'
this.secondMoneyLab.string = '' + Common5.getNumberChangeHanzi(mzNum) + '/秒'
//单价
let danjia = ZaoCanManager.getDanJia()
this.danJiaMoneyLab.string = '' + Common5.getNumberChangeHanzi(danjia) + '/个'
//点击收益
let node = this.node.getChildByName('UINode').getChildByName('bottom').getChildByName('升级')
let dianji = node.getChildByName('点击收益').getChildByName('str')
@ -1372,10 +1380,27 @@ export default class MainHall extends UiBase {
let chenghao = LevelUpManager.getChengHao()
this.chenghao.string = chenghao
//小游戏图标显示
if (mainId > MainTaskIdEnum.MainTask_511) {
let node = this.node.getChildByName('UINode').getChildByName('小游戏')
node.active = true
// //小游戏图标显示
// if (mainId > MainTaskIdEnum.MainTask_511) {
// let node = this.node.getChildByName('UINode').getChildByName('小游戏')
// node.active = true
// }
//任务显示
this.refreshTaskView()
}
refreshTaskView() {
let customTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let taskId = customTaskInfo.Id
console.log(taskId, 'TaskInfoView')
let node = this.node.getChildByName('UINode').getChildByName('bottom').getChildByName('任务')
node.getChildByName("未完成").active = true
let config = TaskManager.getTaskConfigById(taskId)
if (config) {
node.getChildByName("任务描述").getChildByName("lab").getComponent(cc.Label).string = config.TaskDesc
// this.contentDesc.string = config.TaskDesc
}
}
@ -1383,13 +1408,13 @@ export default class MainHall extends UiBase {
let mainTaskInfo: any = TaskManager.getCurUnLockMainTaskInfo()
let mainId = mainTaskInfo.Id
let config = TaskManager.getTaskConfigById(mainId)
if (config && config.levelNum) {
this.level_ProgressBar.node.active = true
this.level_ProgressBar.progress = User.getMyLevel() / config.levelNum
this.level_ProgressBar.node.getChildByName("jindu").getComponent(cc.Label).string = `${User.getMyLevel()}/${config.levelNum}`
} else {
this.level_ProgressBar.node.active = false
}
// if (config && config.levelNum) {
// this.level_ProgressBar.node.active = true
// this.level_ProgressBar.progress = User.getMyLevel() / config.levelNum
// this.level_ProgressBar.node.getChildByName("jindu").getComponent(cc.Label).string = `${User.getMyLevel()}/${config.levelNum}`
// } else {
// this.level_ProgressBar.node.active = false
// }
if (config && config.taskNum) {
this.qian_ProgressBar.node.active = true

@ -13,11 +13,11 @@ import BagManager from "./BagManager"
let zaocanConfig = [
{ id: 0, zancan: ['馒头', '肉包', '烧卖', '红薯'], needLevel: [1, 5, 10, 20], initPrice: 100, jiacheng: [1, 2, 3, 4] },
{ id: 1, zancan: ['鸡蛋', '茶叶蛋', '玉米', '西兰花'], needLevel: [1, 5, 10, 20], initPrice: 100, jiacheng: [1, 2, 3, 4] },
{ id: 2, zancan: ['饺子', '韭菜盒子', '鸡蛋饼', '牛排'], needLevel: [1, 5, 10, 20], initPrice: 100, jiacheng: [1, 2, 3, 4] },
{ id: 3, zancan: ['油条', '麻球', '油饼', '鸡腿'], needLevel: [1, 5, 10, 20], initPrice: 100, jiacheng: [1, 2, 3, 4] },
{ id: 4, zancan: ['豆浆', '小米粥', '燕麦', '咖啡机'], needLevel: [1, 5, 10, 20], initPrice: 100, jiacheng: [1, 2, 3, 4] },
{ id: 0, zaocan: ['馒头', '肉包', '烧卖', '红薯'], needLevel: [1, 5, 10, 20], initPrice: 100, jiacheng: [1, 2, 3, 4] },
{ id: 1, zaocan: ['鸡蛋', '茶叶蛋', '玉米', '西兰花'], needLevel: [1, 5, 10, 20], initPrice: 100, jiacheng: [1, 2, 3, 4] },
{ id: 2, zaocan: ['饺子', '韭菜盒子', '鸡蛋饼', '牛排'], needLevel: [1, 5, 10, 20], initPrice: 100, jiacheng: [1, 2, 3, 4] },
{ id: 3, zaocan: ['油条', '麻球', '油饼', '鸡腿'], needLevel: [1, 5, 10, 20], initPrice: 100, jiacheng: [1, 2, 3, 4] },
{ id: 4, zaocan: ['豆浆', '小米粥', '燕麦', '咖啡机'], needLevel: [1, 5, 10, 20], initPrice: 100, jiacheng: [1, 2, 3, 4] },
]
@ -28,6 +28,17 @@ export default class ZaoCanManager {
return zaocanConfig
}
public static getDanJia() {
let price = 0
for (let i = 0; i < zaocanConfig.length; i++) {
let config = zaocanConfig[i]
let level = User.getMyLevel()
price += config.initPrice + level
}
let danjia = Math.floor(price / zaocanConfig.length)
return danjia
}
public static getCurPriceById(id) {
let config = zaocanConfig[id]
let level = User.getMyLevel()
@ -58,34 +69,92 @@ export default class ZaoCanManager {
public static getCurNameById(id) {
let config = zaocanConfig[id]
let level = User.getMyLevel()
let name = config.zancan[0]
let name = config.zaocan[0]
for (let i = 0; i < config.needLevel.length; i++) {
let _needLevel = config.needLevel[i];
if (level <= _needLevel) {
name = config.zancan[i]
if (level >= _needLevel) {
name = config.zaocan[i]
}
}
//大于最大的
if (level >= config.needLevel[config.needLevel.length - 1]) {
name = config.zancan[config.zancan.length - 1]
name = config.zaocan[config.zaocan.length - 1]
}
return name
}
/**
*
*
*/
public static getAllZaoCan() {
let all = []
public static getAllZaoCanJiaCheng() {
let jiacheng = 0
let level = User.getMyLevel()
for (let i = 0; i < zaocanConfig.length; i++) {
let _needLevel = zaocanConfig[i].needLevel
for (let j = 0; j < _needLevel.length; j++) {
if (level >= _needLevel[j]) {
all.push({ name: zaocanConfig[i].zancan[j], addPercent: zaocanConfig[i].jiacheng[j] })
jiacheng += zaocanConfig[i].jiacheng[j]
}
}
}
// 没有加成就是1倍加成
if (jiacheng == 0) {
jiacheng = 1
}
return jiacheng
}
/**
*
*/
public static getAllZaoCan() {
let all = []
for (let i = 0; i < zaocanConfig.length; i++) {
let _zaocan = zaocanConfig[i].zaocan
// 初始的早餐不计入
for (let j = 1; j < _zaocan.length; j++) {
all.push({ name: zaocanConfig[i].zaocan[j], addPercent: zaocanConfig[i].jiacheng[j] })
}
}
return all
}
/**
*
*/
public static isUnLockByName(name) {
let level = User.getMyLevel()
let lockState = false
for (let i = 0; i < zaocanConfig.length; i++) {
let _zaocan = zaocanConfig[i].zaocan
let _needLevel = zaocanConfig[i].needLevel
for (let j = 0; j < _zaocan.length; j++) {
//是当前早餐并且等级已经到了自动解锁
if (name == _zaocan[j] && level >= _needLevel[j]) {
lockState = true
break
}
}
}
return lockState
}
/**
*
*/
public static getZaoCanNeedLevelByName(name) {
let needLevel = 0
for (let i = 0; i < zaocanConfig.length; i++) {
let _zaocan = zaocanConfig[i].zaocan
let _needLevel = zaocanConfig[i].needLevel
for (let j = 0; j < _zaocan.length; j++) {
//是当前早餐
if (name == _zaocan[j]) {
needLevel = _needLevel[j]
break
}
}
}
return needLevel
}
}

@ -327,6 +327,7 @@ export default class PeopleLevelUpScript extends UiBase {
}
this.setListZaoCan()
this.setListJc()
}
else {

@ -9,6 +9,7 @@ import Common5 from "../../Platform/th/Common5";
import MiShuManager from "../Manager/MiShuManager";
import ShipuManager from "../Manager/ShipuManager";
import TanWeiManager from "../Manager/TanWeiManager";
import ZaoCanManager from "../Manager/ZaoCanManager";
const { ccclass, property } = cc._decorator;
@ -23,6 +24,9 @@ export default class jiachengItem extends cc.Component {
@property(cc.Label)
jiachengPercent: cc.Label = null;
@property(cc.Label)
levelLabel: cc.Label = null;
// LIFE-CYCLE CALLBACKS:
config = null
gameType = 'mishu' //tanwei
@ -98,9 +102,20 @@ export default class jiachengItem extends cc.Component {
}
Common5.addUrlSprite_custom('tanweiTexture/icon/' + this.config.name, this.headImg)
} else if (this.gameType == '早餐加成') {
let name = '炸球' //this.config.name
Common5.getSpriteFrameFromBundle("PeopleLevelUp", 'texture/1/' + name, this.headImg)
let name = this.config.name
// Common5.addUrlSprite_custom('tanweiTexture/icon/' + this.config.name, this.headImg)
let lockState = ZaoCanManager.isUnLockByName(name)
if (lockState) {
this.nameLabel.node.active = true
this.jiachengPercent.node.parent.active = true
this.levelLabel.node.active = false
Common5.getSpriteFrameFromBundle("PeopleLevelUp", 'texture/1/' + '炸球', this.headImg)
} else {
this.nameLabel.node.active = false
this.jiachengPercent.node.parent.active = false
this.levelLabel.node.active = true
this.levelLabel.string = `摊位${ZaoCanManager.getZaoCanNeedLevelByName(name)}级解锁`
}
}
}

Loading…
Cancel
Save