暂存 已有UI替换
This commit is contained in:
parent
1f0db6c4a9
commit
497c5853be
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,4 +4,4 @@
|
|||
/packages/
|
||||
/build-templates/
|
||||
/build/
|
||||
/图片资源/
|
||||
/图片资源/
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,6 @@
|
|||
import { MiniGameSdk } from "../../Sdk/MiniGameSdk";
|
||||
|
||||
import { MiniGameSdk } from "../../Sdk/MiniGameSdk";
|
||||
//@ts-ignore
|
||||
//最大工具类 各种公共方法,以及处理上传,获取后端接口数据
|
||||
var GameTool = {
|
||||
_startTime: 0,
|
||||
|
@ -386,9 +387,10 @@ var GameTool = {
|
|||
// console.log("上传",data);
|
||||
})
|
||||
},
|
||||
|
||||
//@ts-ignore
|
||||
//获取用户金币数量
|
||||
getUserCoin(callback: Function) {
|
||||
//@ts-ignore
|
||||
if (typeof wx!== 'undefined' && wx!== null) {
|
||||
//@ts-ignore
|
||||
wx.cloud.callFunction({
|
||||
|
@ -412,6 +414,7 @@ var GameTool = {
|
|||
|
||||
//改变用户金币
|
||||
setUserCoin(callback){
|
||||
//@ts-ignore
|
||||
if (typeof wx!== 'undefined' && wx!== null) {
|
||||
if(cc.fx.GameConfig.GM_INFO.coin <= 0 || cc.fx.GameConfig.GM_INFO.coin == undefined){
|
||||
console.log("金币上传失败",cc.fx.GameConfig.GM_INFO.coin);
|
||||
|
@ -450,6 +453,7 @@ var GameTool = {
|
|||
|
||||
//获取用户关卡数
|
||||
getUserLevel(callback: Function) {
|
||||
//@ts-ignore
|
||||
if (typeof wx!== 'undefined' && wx!== null) {
|
||||
//@ts-ignore
|
||||
wx.cloud.callFunction({
|
||||
|
@ -536,6 +540,7 @@ var GameTool = {
|
|||
|
||||
//获取用户体力值
|
||||
getUserHealth(callback: Function) {
|
||||
//@ts-ignore
|
||||
if (typeof wx!== 'undefined' && wx!== null) {
|
||||
console.log("即将进入体力获取接口");
|
||||
//@ts-ignore
|
||||
|
@ -582,6 +587,7 @@ var GameTool = {
|
|||
}
|
||||
cc.fx.StorageMessage.setStorage("health",healthInfo);
|
||||
MiniGameSdk.API.shushu_SetSuperProperties();
|
||||
//@ts-ignore
|
||||
if (typeof wx!== 'undefined' && wx!== null) {
|
||||
//@ts-ignore
|
||||
wx.cloud.callFunction({
|
||||
|
@ -609,6 +615,7 @@ var GameTool = {
|
|||
|
||||
//购买行为
|
||||
buyReview(coin,callback: Function){
|
||||
//@ts-ignore
|
||||
if (typeof wx!== 'undefined' && wx!== null) {
|
||||
// console.log("实际即将消耗金币:",coin);
|
||||
// this.changeCoin(coin);
|
||||
|
@ -618,6 +625,7 @@ var GameTool = {
|
|||
|
||||
//更改用户道具数
|
||||
buyProp(propid,callback: Function) {
|
||||
//@ts-ignore
|
||||
if (typeof wx!== 'undefined' && wx!== null) {
|
||||
cc.fx.GameTool.changeCoin(-1500);
|
||||
cc.fx.GameTool.setUserProp(propid,3,(data)=>{
|
||||
|
@ -647,6 +655,7 @@ var GameTool = {
|
|||
|
||||
//改变用户关卡
|
||||
setUserLevel(callback){
|
||||
//@ts-ignore
|
||||
if (typeof wx!== 'undefined' && wx!== null) {
|
||||
// if(cc.fx.GameConfig.GM_INFO.level <= 0 || cc.fx.GameConfig.GM_INFO.level == undefined){
|
||||
// console.log("等级重置为0");
|
||||
|
@ -682,6 +691,7 @@ var GameTool = {
|
|||
|
||||
//获取用户关卡数
|
||||
getUserProp(callback: Function) {
|
||||
//@ts-ignore
|
||||
if (typeof wx!== 'undefined' && wx!== null) {
|
||||
//@ts-ignore
|
||||
wx.cloud.callFunction({
|
||||
|
@ -709,6 +719,7 @@ var GameTool = {
|
|||
|
||||
//改变用户道具
|
||||
setUserProp(propid,amount,callback){
|
||||
//@ts-ignore
|
||||
if (typeof wx!== 'undefined' && wx!== null) {
|
||||
let newPropData = null;
|
||||
if(propid == 0){
|
||||
|
|
|
@ -54,6 +54,8 @@ export default class setUi extends cc.Component {
|
|||
cc.fx.GameConfig.GM_INFO.musicOpen = this.musicState;
|
||||
|
||||
this.setMusicConfig();
|
||||
|
||||
//如果音乐关闭了,则停止音乐
|
||||
cc.fx.AudioManager._instance.stopMusic();
|
||||
}
|
||||
else {
|
||||
|
@ -83,8 +85,10 @@ export default class setUi extends cc.Component {
|
|||
this.effectState = true;
|
||||
cc.fx.GameConfig.GM_INFO.effectOpen = this.effectState;
|
||||
this.setMusicConfig();
|
||||
|
||||
|
||||
}
|
||||
console.log("音效状态", this.effectState);
|
||||
}
|
||||
|
||||
clickVibrate() {
|
||||
|
@ -98,8 +102,10 @@ export default class setUi extends cc.Component {
|
|||
this.vibrateState = true;
|
||||
cc.fx.GameConfig.GM_INFO.vibrateOpen = this.vibrateState;
|
||||
this.setMusicConfig();
|
||||
|
||||
|
||||
}
|
||||
console.log("震动状态", this.vibrateState);
|
||||
}
|
||||
syncToggleState() {
|
||||
this.music.getComponent(cc.Toggle).isChecked = !this.musicState;
|
||||
|
@ -109,6 +115,7 @@ export default class setUi extends cc.Component {
|
|||
|
||||
//关闭ui
|
||||
closeUi() {
|
||||
cc.fx.AudioManager._instance.playEffect("anniu_little", null);
|
||||
this.node.active = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user