|
|
@@ -103,8 +103,8 @@ cc.Class({
|
|
|
//场景开始时候,打开的黑色遮罩
|
|
|
surroundingBlack: cc.Node,
|
|
|
|
|
|
- dogButtonNode:cc.Node,
|
|
|
- stickButtonNode:cc.Node
|
|
|
+ dogButtonNode: cc.Node,
|
|
|
+ stickButtonNode: cc.Node
|
|
|
},
|
|
|
onLoad() {
|
|
|
cc.game.setFrameRate(30)
|
|
|
@@ -470,7 +470,7 @@ cc.Class({
|
|
|
}
|
|
|
},
|
|
|
//设置介绍信息
|
|
|
- onSetMallInfo(_Name, _mature, _CNT,_SNB, _Synopsis) {
|
|
|
+ onSetMallInfo(_Name, _mature, _CNT, _SNB, _Synopsis) {
|
|
|
this.mallContent_Name.string = _Name
|
|
|
this.mallContent_Price.string = _CNT
|
|
|
this.mallContent_SNBPrice.string = _SNB;
|
|
|
@@ -1246,14 +1246,15 @@ cc.Class({
|
|
|
|
|
|
if (0 === value.code) {
|
|
|
if (0 !== value.data.stealSum) {
|
|
|
- if (this.StealViewSuccessPrefab) {
|
|
|
- let _TipView = cc.instantiate(this.StealViewSuccessPrefab)
|
|
|
- _TipView.parent = this.TipView
|
|
|
- _TipView.setPosition(cc.v2(0, 0))
|
|
|
- _TipView
|
|
|
- .getComponent('StealViewSuccess')
|
|
|
- .setInfo({ amount: value.data.stealSum });
|
|
|
- }
|
|
|
+ // if (this.StealViewSuccessPrefab) {
|
|
|
+ // let _TipView = cc.instantiate(this.StealViewSuccessPrefab)
|
|
|
+ // _TipView.parent = this.TipView
|
|
|
+ // _TipView.setPosition(cc.v2(0, 0))
|
|
|
+ // _TipView
|
|
|
+ // .getComponent('StealViewSuccess')
|
|
|
+ // .setInfo({ amount: value.data.stealSum });
|
|
|
+ // }
|
|
|
+ this.onInitStealViewSuccessPrefab(value.data);
|
|
|
|
|
|
let BuildingView = cc.find('Canvas/UICamera/BuildingContainer/BuildingView').getComponent('BuildingView');
|
|
|
BuildingView.onUpdateList();
|
|
|
@@ -1285,16 +1286,16 @@ cc.Class({
|
|
|
|
|
|
/**
|
|
|
* 生成一个提示面板
|
|
|
- * @param {偷取数量} stealSum
|
|
|
+ * @param {偷取对象} stealObj
|
|
|
*/
|
|
|
- onInitStealViewSuccessPrefab(stealSum) {
|
|
|
+ onInitStealViewSuccessPrefab(stealObj) {
|
|
|
if (this.StealViewSuccessPrefab) {
|
|
|
let _TipView = cc.instantiate(this.StealViewSuccessPrefab)
|
|
|
_TipView.parent = this.TipView
|
|
|
_TipView.setPosition(cc.v2(0, 0))
|
|
|
_TipView
|
|
|
.getComponent('StealViewSuccess')
|
|
|
- .setInfo({ amount: stealSum });
|
|
|
+ .setSingleStealInfo(stealObj);
|
|
|
}
|
|
|
},
|
|
|
//体力值
|
|
|
@@ -1307,25 +1308,29 @@ cc.Class({
|
|
|
},
|
|
|
|
|
|
//小狗和木棒
|
|
|
- onSettingDogAlpha(opacity){
|
|
|
- this.dogButtonNode.opacity = opacity ;
|
|
|
+ onSettingDogAlpha(opacity) {
|
|
|
+ this.dogButtonNode.opacity = opacity;
|
|
|
},
|
|
|
- onSettingStickAlpha(opacity){
|
|
|
+ onSettingStickAlpha(opacity) {
|
|
|
this.stickButtonNode.opacity = opacity;
|
|
|
},
|
|
|
|
|
|
- onDetectDog(){
|
|
|
- if(GlobalD.Dog){
|
|
|
- GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "已经拥有小狗。", 1);
|
|
|
- }else{
|
|
|
+ onDetectDog() {
|
|
|
+ if (GlobalD.Dog) {
|
|
|
+ if (GlobalD.Dog.remainingConsumption > 0) {
|
|
|
+ GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "已经拥有小狗。", 1);
|
|
|
+ } else {
|
|
|
+ GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "需要点击狗盆购买狗粮。", 1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "尚未拥有小狗。", 1);
|
|
|
}
|
|
|
},
|
|
|
- onDetectStick(){
|
|
|
- if(GlobalD.Stick){
|
|
|
- GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "已经装备木棒。", 1);
|
|
|
- }else{
|
|
|
- GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "尚未拥有木棒。", 1);
|
|
|
+ onDetectStick() {
|
|
|
+ if (GlobalD.Stick) {
|
|
|
+ GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "已经装备打狗棒。", 1);
|
|
|
+ } else {
|
|
|
+ GlobalD.GameData.showToast(cc.find("Canvas/UICamera"), "尚未购买打狗棒。", 1);
|
|
|
}
|
|
|
}
|
|
|
})
|