117 lines
5.2 KiB
TypeScript
117 lines
5.2 KiB
TypeScript
import { GameConfig } from "../Config/GameConfig";
|
|
import HttpUtil from "../Crypto/HttpUtil";
|
|
import AudioManager from "../Music/AudioManager";
|
|
import { Notifications } from "../Notification/Notification";
|
|
import { StorageMessage } from "../Storage/Storage";
|
|
import { GameTool } from "../Tool/GameTool";
|
|
|
|
window.initMgr = function() {
|
|
if(cc.fx)
|
|
{
|
|
return;
|
|
}
|
|
cc.fx = {};
|
|
console.log("初始化");
|
|
//基础状态信息
|
|
cc.fx.StateInfo = {
|
|
debugMode: true,
|
|
networkConnected: true, //网络状态
|
|
networkType: 'none', //网络类型
|
|
isOnForeground: true //当前是否是在前台
|
|
};
|
|
|
|
//应用系统信息
|
|
//配置文件
|
|
|
|
cc.fx.GameConfig = GameConfig;
|
|
cc.fx.HttpUtil = HttpUtil;
|
|
cc.fx.GameTool = GameTool;
|
|
cc.fx.AudioManager = AudioManager;
|
|
cc.fx.Notifications = Notifications;
|
|
cc.fx.StorageMessage = StorageMessage;
|
|
|
|
cc.fx.ShareInfo = {
|
|
queryId : -1 //分享id
|
|
};
|
|
|
|
/*
|
|
* 客户端埋点分享类型
|
|
*/
|
|
cc.fx.BurialShareType = {
|
|
Default : "default", //默认分享类型,分享到群
|
|
Invite : "invite", // 邀请好友
|
|
|
|
DailyInviteRoomJoin:'invite_join_room', //邀请好友加入
|
|
DailyInviteFriend : 'invite_friend', // 日常邀请好友
|
|
DailyInviteGroup : 'invate_group', // 日常分享群
|
|
DailyInviteGroupAlive: 'invate_alive', //日常分享群复活
|
|
DailyInviteGroupReward: 'invate_rewared',//分享奖励翻倍
|
|
DailyInviteGroupBox: 'invate_box', //宝箱分享奖励
|
|
DailyInviteGroupBall: 'invate_ball', //分享领取球球
|
|
|
|
MatchResult : 'matchResult', // 比赛结算分享
|
|
MatchFix5: 'MatchFix5', // 5元红包赛
|
|
MatchFix20: 'MatchFix20', // 20元红包赛
|
|
MatchFix100: 'MatchFix100', // 100元红包赛
|
|
MatchFix500: 'MatchFix500', // 500元红包赛
|
|
NewerRedEnvelope: 'newerRedEnvelope', // 新手红包
|
|
CoinRoomResult: 'coinRoomResult', // 金币桌结算
|
|
HighRate : "highRate",//高倍分享
|
|
CoinRoomWinStreak: 'coinRoomWinStreak', // 连胜
|
|
CoinRoomBankruptcy1: 'coinRoomBankruptcy1', // 金币桌破产
|
|
CoinRoomBankruptcy2: 'coinRoomBankruptcy2', // 金币桌破产
|
|
CoinRoomBankruptcy3: 'coinRoomBankruptcy3', // 金币桌破产
|
|
};
|
|
|
|
/*
|
|
* 分享到哪儿给奖励 group frined all
|
|
*/
|
|
cc.fx.ShareWhereReward = {
|
|
Group :"group", //微信群
|
|
Friend : "friend",//好友
|
|
All : "all", //不区分
|
|
};
|
|
|
|
//用于存储消息的ID
|
|
cc.fx.storageType = cc.Enum({
|
|
storageTypeCustom: 1000101, //用于存储关卡等级
|
|
});
|
|
|
|
//用于存储提示语 按照步骤提示
|
|
cc.fx.tipType = cc.Enum({
|
|
tipOne: '神农氏回到家中,开始整理今天收集来的物品。当他第一次拿出或说出一种植物时,请告诉他这是新植物。',
|
|
tipTwo: '如果他拿出或说出的植物你今天看到过,请告诉他上次是看到的;如果你听他说过,则请告诉他上次是听到的。', //用于存储关卡等级
|
|
tipErrNew: '这是这局游戏第一次出现{植物}',
|
|
tipErrOld: '{植物}刚才出现过呢',
|
|
tipErrHear: '上次遇到{植物}时,似乎不是听到的吧',
|
|
tipErrSee: '上次遇到{植物}时,似乎不是看到的吧',
|
|
tipErrLast: '之前确实看到过{植物},但最近一次似乎不是看到的呢',
|
|
|
|
});
|
|
//暂时不用
|
|
// cc.fx.clickStatEventType = {
|
|
// clickStatEventTypeVideoAD : 20173201,//视频播放完成
|
|
// clickStatEventTypeClickAdVideo : 20173202,//视频播放为完成
|
|
// clickStatEventTypeBannerAD : 20173203,//banner播放为完成
|
|
// clickStatEventTypeUserFrom : 99990001,//用户来源
|
|
// clickStatEventTypeShare : 99990002,//用户分享
|
|
// clickStatEventTypeClickAdBtn : 99990007,//点击分流icon
|
|
// clickStatEventTypeBannerAD2 : 67890033, // banner广告干预
|
|
// clickStatEventTypeSubmitVersionInfo : 9999, //上报微信版本及基础库信息
|
|
// clickStatEventTypeClickFirstAd : 99990003, //分流icon显示
|
|
// clickStatEventTypeClickSecondAd : 99990004, //玩家点击分流按钮
|
|
// clickStatEventTypeWxLoginStart : 10001,//微信登录开始
|
|
// clickStatEventTypeWxLoginSuccess : 10002,//微信登录成功
|
|
// clickStatEventTypeWxLoginFailed : 10003,//微信登录失败
|
|
// clickStatEventTypeAuthorizationStart : 10003,//授权开始
|
|
// clickStatEventTypeAuthorizationSuccess : 10004,//授权成功
|
|
// clickStatEventTypeAuthorizationFailed : 10005,//授权失败
|
|
// clickStatEventTypeLoginSDKStart : 10007,//登录SDK开始
|
|
// clickStatEventTypeLoginSDKSuccess : 10008,//登录SDK成功
|
|
// clickStatEventTypeLoginSDKFailed : 10009,//登录SDK时失败
|
|
// clickStatEventTypeTCP_Start : 10009,//TCP连接开始
|
|
// clickStatEventTypeTCP_Success : 10010,//TCP连接成功
|
|
// clickStatEventTypeTCP_Failed : 10011,//TCP连接失败
|
|
// };
|
|
|
|
}; |