模板更新,更新了埋点上传失败3次上传,5秒10秒15秒,更新了更改分享链接和分享内容,增加了scode

This commit is contained in:
YZ\249929363 2024-08-28 11:12:05 +08:00
parent 8c55ee1950
commit d5fb9e6de4
3429 changed files with 383549 additions and 13414 deletions

13
assets/Script/Sdk.meta Normal file
View File

@ -0,0 +1,13 @@
{
"ver": "1.1.3",
"uuid": "ec0a44ff-c813-4573-8b85-268526211437",
"importer": "folder",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}

View File

@ -0,0 +1,29 @@
import { MiniGameSdk } from "./MiniGameSdk";
const { ccclass, property } = cc._decorator;
@ccclass
export class DouyinEntranceView extends cc.Component {
start() {
}
update(deltaTime: number) {
}
onCloseClick() {
this.node.active = false;
}
onNavigateToDouyinClick() {
MiniGameSdk.BytedanceSidebar.navigateToSidebar((success: boolean) => { // 跳转到抖音侧边栏
if (success) {
console.log('跳转成功');
} else {
console.log('跳转失败');
}
});
}
}

View File

@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "8a024faa-e4af-4cae-9c5c-693bee7120c1",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@ -0,0 +1,340 @@
import { MiniGameSdk } from "./MiniGameSdk";
const { ccclass, property } = cc._decorator;
enum EWechatAD {
CUMSTOM_01 = 'adunit-f7c2417eb2c2e473'
}
@ccclass
export class MiniGameManager extends cc.Component {
@property(cc.Node)
entranceView: cc.Node = null;
/**
*
*
*
* @remarks
*
*
*
*
*/
private _id:any;
private _userData:any;
private static _instance: MiniGameManager;
static get instance(): MiniGameManager {
if (!MiniGameManager._instance) {
MiniGameManager._instance = new MiniGameManager();
}
return MiniGameManager._instance;
}
start() {
// 禁用游戏入口视图
// this.entranceView.active = false;
// MiniGameSdk.API.getUserProfile(this.setUserId);
// cc.fx.GameTool.setUserInfo("");
this.onGetLoginCode();
// 尝试获取游戏入口按钮,如果存在则直接返回,不进行后续操作
// let buttonEntrance = this.node.getChildByName('Btns')?.getChildByName('Button_EntranceView');
// if (buttonEntrance) {
// return;
// }
// 如果是字节跳动小游戏环境,检查侧边栏是否存在
if (MiniGameSdk.isBytedance()) {
//抖音环境,检测侧边栏存在
MiniGameSdk.BytedanceSidebar.checkSideBar((success: boolean) => {
// 根据侧边栏存在性激活或禁用游戏入口按钮
// buttonEntrance.active = success;
});
} else {
// 非抖音小游戏环境,直接激活游戏入口按钮
// 非抖音环境,正常显示按钮
// buttonEntrance.active = true;
}
// 设置监听器,以处理来自侧边栏的交互事件
MiniGameSdk.BytedanceSidebar.listenFromSidebar((success: boolean) => {
// 如果交互成功,显示奖励提示
if (success) {
MiniGameSdk.API.showToast('侧边栏奖励', 5);
}
});
}
update(deltaTime: number) {
}
/**
* 广
* 广广广广
* 广广MiniGameSdk.AdvertManager的实例方法来实现的
*
* @remarks
* 广
* 1. showBanner方法显示广告
* 2. 广
*
* 广使
*/
onShowBanner() {
// 加载指定广告位的横幅广告。
MiniGameSdk.AdvertManager.instance.loadBanner('adunit-4e7ef467e3eaab51');
// 默认方式显示横幅广告。
// 方法1默认调用
MiniGameSdk.AdvertManager.instance.showBanner();
// 示例:指定屏幕底部正中显示横幅广告。
// 方法2指定屏幕顶部或底部正中
// MiniGameSdk.AdvertManager.instance.showBanner('adunit-4e7ef467e3eaab51', MiniGameSdk.EAdBannerLocation.BOTTOM);
// 示例:通过坐标指定位置显示横幅广告。
// 方法2指定坐标
// MiniGameSdk.AdvertManager.instance.showBanner('adunit-4e7ef467e3eaab51', { top: 10, left: 10 });
}
/**
* 广
*
* MiniGameSdk.AdvertManager实例的方法广
* 广广
*
* @remarks
*
* 广AdvertManager的实现
*/
onHideBanner() {
MiniGameSdk.AdvertManager.instance.hideBanner();
}
/**
* 广
*
* MiniGameSdk.AdvertManager实例的方法广
* 使广广
* 广
*/
onShowInterstitial() {
MiniGameSdk.AdvertManager.instance.showInterstitial('adunit-eadd67851d3050ad');
}
/**
* 广广
* 广广广
* 广广
* 广
*/
onShowCustom() {
// 加载指定的自定义广告单元。
MiniGameSdk.AdvertManager.instance.loadCustom(EWechatAD.CUMSTOM_01);
// 展示已加载的自定义广告。
MiniGameSdk.AdvertManager.instance.showCustom(EWechatAD.CUMSTOM_01);
}
/**
* 广
*
* MiniGameSdk.AdvertManager.instance.hideCustom()广
* 广广
* 广
*/
onHideCustom() {
MiniGameSdk.AdvertManager.instance.hideCustom(EWechatAD.CUMSTOM_01);
}
/**
* 广
* MiniGameSdk.AdvertManager.instance.showVideo方法广广
*
* @remarks
* 广ID广广
* 广广
*/
onShowVideo() {
// 广告单元ID用于标识要显示的视频广告
// 广告单元ID的样例
//抖音形如: 1re3nfqkmy81m4m8ge
//微信形如: adunit-a7718f6e195e42fe
MiniGameSdk.AdvertManager.instance.showVideo('1re3nfqkmy81m4m8ge', (res: MiniGameSdk.EAdVideoResult, count: number) => {
// 输出用户观看的广告数量
console.log('用户看的视频广告个数是:', count);
// 根据用户观看广告的结果,执行不同的逻辑
switch (res) {
case MiniGameSdk.EAdVideoResult.ACCEPT:
// 用户完成了广告观看,显示奖励提示
MiniGameSdk.API.showToast('用户看完广告,可以奖励');
break;
case MiniGameSdk.EAdVideoResult.REJECT:
// 用户拒绝了广告观看,显示不奖励提示
MiniGameSdk.API.showToast('用户拒绝掉广告,不奖励');
break;
case MiniGameSdk.EAdVideoResult.ERROR:
// 广告播放发生错误,显示错误提示
MiniGameSdk.API.showToast('播放广告发生错误,不奖励');
break;
default:
// 其他情况,不作处理
break;
}
});
}
/**
*
*
* MiniGameSdk的API分享功能
* 广
*
* @remarks
* API依赖于特定的小游戏平台
*/
onShare() {
MiniGameSdk.API.shareAppToFriends('来玩游戏吧');
}
/**
* toast提示
*
* MiniGameSdk的API方法来显示一个简短的提示信息toast是一种轻量级的提示方式
* 使 '这是一个toast'
*/
onShowToast() {
MiniGameSdk.API.showToast('这是一个toast');
}
/**
*
*
* MiniGameSdk提供的API
*
*
* @remarks
*
*/
onVirbrate() {
MiniGameSdk.API.vibrate();
}
/**
*
*
* MiniGameSdk中的API重新启动游戏
*
*
* @remarks
*
*
* @returns
*/
onReboot() {
MiniGameSdk.API.reboot();
}
/**
* 退
* MiniGameSdk提供的API方法来触发退出操作
*
*/
onExit() {
MiniGameSdk.API.exit();
}
/**
*
*
* MiniGameSdk的API方法
* 便SDK接口交互
*
* @remarks
*
*/
onShowShareMenu() {
MiniGameSdk.API.showShareMenu();
}
/**
*
*
* ID
* 便
*
* 'xxx'使ID
*/
onNavigate() {
MiniGameSdk.API.navigateTo('xxx'); // xxx替换为你的小游戏id
}
/**
*
*
*
* 使
*/
onBytedanceEntranceView() {
// this.entranceView.active = true;
}
/**
*
*
*
*
*/
onGetLoginCode() {
// 调用MiniGameSdk的API登录方法传入一个回调函数处理登录结果
MiniGameSdk.API.login((code: string, anonymousCode: string) => {
// 打印微信或头条的登录代码
console.log('Wechat Or Bytedance Code:', code);
// 打印头条的匿名登录代码
// console.log('Bytedance Anonymous Code:', anonymousCode);
if(code){
cc.fx.GameTool.getUserId(code, data => this.setUserId(data));
}
});
}
setUserId(data){
cc.fx.GameConfig.GM_INFO.userId = data.data.userId;
MiniGameSdk.API.getUserInfo(this.setUserInfo);
}
setUserInfo(data){
console.log("获取到的用户信息",data.userInfo);
var useData = {
"gameId": cc.fx.GameConfig.GM_INFO.gameId,
"userId": cc.fx.GameConfig.GM_INFO.userId,
"nickName":data.userInfo.nickName,
"pic": data.userInfo.avatarUrl
}
console.log("即将上传的用户信息:",cc.fx.GameConfig.GM_INFO.userId,data.userInfo.nickName,data.userInfo.avatarUrl);
console.log("Post数据:",useData);
cc.fx.HttpUtil.setUserInfo(useData,(res)=>{
console.log("上传成功:",res);
});
}
/**
*
*
* MiniGameSdk的GameClub实例方法
*
*
*/
onCreateClub() {
// 配置俱乐部图标为绿色设置图标的位置为顶部200像素左侧0像素
MiniGameSdk.GameClub.instance.create(
MiniGameSdk.EGameClubIcon.GREEN,
{ top: 200, left: 0 },
{ width: 50, height: 50 });
// 显示游戏俱乐部图标
MiniGameSdk.GameClub.instance.show();
}
}

View File

@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "0d272a57-5428-450e-a8b9-1574c3d89951",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "c1af99dd-ee03-40f7-9609-d3887d0dd357",
"importer": "typescript",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

File diff suppressed because one or more lines are too long

View File

@ -6,40 +6,37 @@ const BASE_URL = "https://api.sparkus.cn";
//只负责网络接口 次类只负责和后端交互,不负责处理数据 数据处理在GameTool
@ccclass
export default class HttpUtil extends cc.Component {
static async getShareInfo(shareUrl: string): Promise<any> {
console.log("设置分享链接:",shareUrl);
const time = Math.floor((new Date().getTime()) / 1000)
const url = HttpUtil.apiSign(`/api/share/cfg?gameId=${config.gameId}&time=${time}&url=${shareUrl}`,{})
return this.post(url,null,null);
}
//排行榜
static async rankData(type,callback,data): Promise<any> {
const time = Math.floor((new Date().getTime()) / 1000)
const url = HttpUtil.apiSign(`/api/get/rank/data?gameId=${config.gameId}&dataType=${type}&time=${time}`, data)
this.post(url,data,callback);
this.post(url,data,callback,0);
}
static async uploadUserLogData(data,callback): Promise<any> {
const url = '/log/collect/data';
this.post(url,data,callback);
this.post(url,data,callback,3);
}
//暂时用不到
static async getUserRecord(data,callback): Promise<any> {
const time = Math.floor((new Date().getTime()) / 1000)
const url = HttpUtil.apiSign(`/api/get/user/data?gameId=${config.gameId}&time=${time}`, data)
this.post(url,data,callback);
this.post(url,data,callback,0);
}
static async post(url, data, callback) {
const response = await this.fetchData(url, data, 'POST');
static async get(url, callback,count) {
let repeat = count?count:0;
const response = await this.fetchData(url, null, 'GET',repeat);
callback && callback(response);
}
static async get(url, callback) {
const response = await this.fetchData(url, null, 'GET');
static async post(url, data, callback,count) {
let repeat = count?count:0;
const response = await this.fetchData(url, data, 'POST',repeat);
callback && callback(response);
}
static async fetchData(url, data, method) {
static async fetchData(url, data, method,repeat) {
const fullUrl = `${BASE_URL}${url}`;
const headers = { 'Content-Type': 'application/json' };
const options = {
@ -49,15 +46,36 @@ export default class HttpUtil extends cc.Component {
};
try {
const response = await fetch(fullUrl, options);
var response = await this.fetchWithTimeout(fullUrl,options);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
throw new Error(`HTTP_______________error! status: ${response.status}`);
}
return await response.json();
} catch (error) {
console.error('Fetch error:', error);
return null;
console.error('Fetch_______________error:', error);
if(repeat > 0){
repeat -= 1;
const timeOut = (3-repeat)*5000;
setTimeout(async () => {
response = await this.fetchData(url, data, method,repeat);
}, timeOut);
}
else{
return null;
}
}
}
static async fetchWithTimeout(resource, options = {}) {
const controller = new AbortController();
const id = setTimeout(() => controller.abort(), 5000);
const response = await fetch(resource, {
...options,
signal: controller.signal
});
clearTimeout(id);
return response;
}
/**
@ -91,8 +109,8 @@ function responseHandler(response: { data: any }) {
// 响应拦截器
// Rq.interceptors.response.use(responseHandler)
const config = {
gameId: "100012",
secretKey: "onnfPKJW",
gameId: "100010",
secretKey: "wozrGKsL",
EK:"hui231%1"
};

View File

@ -36,20 +36,6 @@ window.initMgr = function() {
queryId : -1 //分享id
};
cc.fx.Message = {
control: "10001", //传递操作控制
startGame:"10002", //传递开始建筑
next: "10003" , //传递执行下一个格子洪水流过
changePath: "10004", //传递操作控制
changeMap: "10005", //改变那地图
nextWater: "10006" , //传递执行下一个格子洪水流过
addEnd: "10007" , //添加结束点
setData: "10008" , //上传分数
guideNext: "10009" , //引导进入下一步
showResult: "10010", //展示治水结果
removeTip: "10011" //执行撤回或者后退动作,移除提示
}
/*
*
*/
@ -104,5 +90,30 @@ window.initMgr = function() {
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连接失败
// };
};

View File

@ -9,55 +9,21 @@ export default class AudioManager extends cc.Component {
audioGameBgm0: cc.AudioClip = null;
@property(cc.AudioClip)
baishao_audio: cc.AudioClip = null;
chehui: cc.AudioClip = null;
@property(cc.AudioClip)
cha_audio: cc.AudioClip = null;
jineng: cc.AudioClip = null;
@property(cc.AudioClip)
chixiaodou_audio: cc.AudioClip = null;
qingkong: cc.AudioClip = null;
@property(cc.AudioClip)
danggui_audio: cc.AudioClip = null;
fangxiang: cc.AudioClip = null;
@property(cc.AudioClip)
danshen_audio: cc.AudioClip = null;
build: cc.AudioClip = null;
@property(cc.AudioClip)
dazao_audio: cc.AudioClip = null;
win: cc.AudioClip = null;
@property(cc.AudioClip)
gancao_audio: cc.AudioClip = null;
@property(cc.AudioClip)
ganjiang_audio: cc.AudioClip = null;
@property(cc.AudioClip)
gouqi_audio: cc.AudioClip = null;
@property(cc.AudioClip)
jingjie_audio: cc.AudioClip = null;
@property(cc.AudioClip)
jinju_audio: cc.AudioClip = null;
@property(cc.AudioClip)
lizhi_audio: cc.AudioClip = null;
@property(cc.AudioClip)
lizi_audio: cc.AudioClip = null;
@property(cc.AudioClip)
longyan_audio: cc.AudioClip = null;
@property(cc.AudioClip)
moli_audio: cc.AudioClip = null;
@property(cc.AudioClip)
muchai_audio: cc.AudioClip = null;
@property(cc.AudioClip)
mudan_audio: cc.AudioClip = null;
@property(cc.AudioClip)
mulan_audio: cc.AudioClip = null;
@property(cc.AudioClip)
pugongying_audio: cc.AudioClip = null;
@property(cc.AudioClip)
putao_audio: cc.AudioClip = null;
@property(cc.AudioClip)
renshen_audio: cc.AudioClip = null;
@property(cc.AudioClip)
taozi_audio: cc.AudioClip = null;
@property(cc.AudioClip)
zhuye_audio: cc.AudioClip = null;
@property(cc.AudioClip)
err: cc.AudioClip = null;
@property(cc.AudioClip)
yes: cc.AudioClip = null;
lose: cc.AudioClip = null;
mAudioMap: {};
@ -111,7 +77,12 @@ export default class AudioManager extends cc.Component {
volume = 1;
cc.audioEngine.setEffectsVolume(1);
cc.audioEngine.setMusicVolume(1);
if(audioSource.name == "lose"){
cc.audioEngine.setEffectsVolume(0.5);
}
else{
cc.audioEngine.setEffectsVolume(1);
}
var context = cc.audioEngine.playEffect(audioSource, loop);
if (callback){
cc.audioEngine.setFinishCallback(context, function(){

View File

@ -8,16 +8,16 @@ export default class ItemRender extends cc.Component {
/**数据 */
public data:any = null;
/**索引 0表示第一项*/
public itemIndex:number = 0;
public itemIndex:number = 0;
/**数据改变时调用 */
public dataChanged(){
cc.fx.GameTool.subName(this.data.name,6);
let name = cc.fx.GameTool.subName(this.data.name,6);
this.node.getChildByName("rankLab").getComponent(cc.Label).string = this.data.rank + "";
this.node.getChildByName("nameLab").getComponent(cc.Label).string = this.data.name + "";
this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total;
this.node.getChildByName("nameLab").getComponent(cc.Label).string = name + "";
this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total + "%";
let timeTemp = cc.fx.GameTool.getTimeShenNong(this.data.time);
// this.node.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + "";
this.node.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + "";
this.node.getChildByName("rank").getChildByName("one").active = false;
this.node.getChildByName("rank").getChildByName("two").active = false;
this.node.getChildByName("rank").getChildByName("three").active = false;
@ -67,7 +67,7 @@ export default class ItemRender extends cc.Component {
}
else{
// console.log("设置头像失败",url);
console.log(err,texture)
// console.log(err,texture)
}
})
}

Binary file not shown.

View File

@ -1,7 +1,7 @@
var shareConfig = {
gameId: "100010",
gameId: "100009",
shareLine: "zDLsruVI",
EK:"hui231%1"
};
@ -26,6 +26,7 @@ export class WeChat {
static getResult(res){
if(res){
var data = res.data;
// @ts-ignore
wx.config({
debug: false,
appId: data.appId,
@ -34,41 +35,48 @@ export class WeChat {
signature: data.signature,
jsApiList: ['onMenuShareTimeline','updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage']
});
// @ts-ignore
wx.checkJsApi({
jsApiList: ['updateAppMessageShareData'], // 需要检测的JS接口列表所有JS接口列表见附录2,
success: function(res) {
setTimeout(() => {
WeChat.changeShare();
}, 100);
}, 200);
setTimeout(() => {
WeChat.changeShare();
}, 200);
}, 500);
}
});
}
}
static changeShare(){
// @ts-ignore
wx.ready(() => {
// @ts-ignore
wx.updateAppMessageShareData({
title: '记忆力认知测评', // 分享标题
desc: '你的认知灵活性和选择注意有问题吗', // 分享描述
desc: '你的注意力和工作记忆有问题吗', // 分享描述
link: shareConfig.shareLine, // 分享链接该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'https://static.sparkus.cn/public/shennong.jpg', // 分享图标
imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg', // 分享图标
success: function () {
// 设置成功
console.log("分享好友成功回调");
}
});
wx.updateTimelineShareData({
title: '记忆力认知测评', // 分享标题
link: shareConfig.shareLine, // 分享链接该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'https://static.sparkus.cn/public/shennong.jpg', // 分享图标
success: function () {
// 设置成功
console.log("分享朋友圈成功回调");
}
})
setTimeout(() => {
// @ts-ignore
wx.updateTimelineShareData({
title: '记忆力认知测评', // 分享标题
link: shareConfig.shareLine, // 分享链接该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg', // 分享图标
success: function () {
// 设置成功
console.log("分享朋友圈成功回调");
}
})
}, 200);
});
}
@ -79,8 +87,8 @@ export class WeChat {
}
static async getShareInfo(shareUrl: string, callback:Function): Promise<any> {
const time = Math.floor((new Date().getTime()) / 1000)
const url = cc.fx.HttpUtil.apiSign(`/api/share/cfg?gameId=${shareConfig.gameId}&time=${time}&url=${shareUrl}`,{})
return cc.fx.HttpUtil.get(url,callback)
const url = cc.fx.HttpUtil.apiSign(`/api/share/cfg?gameId=${cc.fx.GameConfig.GM_INFO.gameId}&time=${time}&url=${shareUrl}`,{})
return cc.fx.HttpUtil.get(url,callback,3)
}

View File

@ -29,11 +29,12 @@ var GameTool = {
let postData = {
"gameId":cc.fx.GameConfig.GM_INFO.gameId,
"userId":cc.fx.GameConfig.GM_INFO.userId,
"scode":cc.fx.GameConfig.GM_INFO.scode,
"matchId":matchId,
"data": data
};
console.log("上传数据:",data);
// console.log("上传数据:",data);
cc.fx.HttpUtil.uploadUserLogData(postData,function(){})
},
//上传排行榜 type为1
@ -312,7 +313,7 @@ var GameTool = {
//获取时间戳
getTime(){
const timestamp = Math.floor((new Date().getTime()) / 1000)
const timestamp = (new Date().getTime())
return timestamp;
},
pushLister:function () {

Binary file not shown.

View File

@ -0,0 +1,6 @@
{
"ver": "1.1.2",
"uuid": "8162ee52-27a1-40fa-b8d8-b05e309020cd",
"importer": "ttf-font",
"subMetas": {}
}

Binary file not shown.

View File

@ -0,0 +1,6 @@
{
"ver": "1.1.2",
"uuid": "ba08509d-1972-42d5-aa39-2bcd83804450",
"importer": "ttf-font",
"subMetas": {}
}

File diff suppressed because one or more lines are too long

View File

@ -5,8 +5,8 @@ window.boot = function () {
window._CCSettings = undefined;
var onProgress = null;
var RESOURCES = remote_url + cc.AssetManager.BuiltinBundleName.RESOURCES;
// var RESOURCES = cc.AssetManager.BuiltinBundleName.RESOURCES;
// var RESOURCES = remote_url + cc.AssetManager.BuiltinBundleName.RESOURCES;
var RESOURCES = cc.AssetManager.BuiltinBundleName.RESOURCES;
var INTERNAL = cc.AssetManager.BuiltinBundleName.INTERNAL;
var MAIN = cc.AssetManager.BuiltinBundleName.MAIN;
function setLoadingDisplay () {

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,339 @@
"use strict";
cc._RF.push(module, '0d272pXVChFDqi5FXTD2JlR', 'MiniGameManager');
// Script/Sdk/MiniGameManager.ts
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MiniGameManager = void 0;
var MiniGameSdk_1 = require("./MiniGameSdk");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var EWechatAD;
(function (EWechatAD) {
EWechatAD["CUMSTOM_01"] = "adunit-f7c2417eb2c2e473";
})(EWechatAD || (EWechatAD = {}));
var MiniGameManager = /** @class */ (function (_super) {
__extends(MiniGameManager, _super);
function MiniGameManager() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.entranceView = null;
return _this;
}
MiniGameManager_1 = MiniGameManager;
Object.defineProperty(MiniGameManager, "instance", {
get: function () {
if (!MiniGameManager_1._instance) {
MiniGameManager_1._instance = new MiniGameManager_1();
}
return MiniGameManager_1._instance;
},
enumerable: false,
configurable: true
});
MiniGameManager.prototype.start = function () {
// 禁用游戏入口视图
// this.entranceView.active = false;
// MiniGameSdk.API.getUserProfile(this.setUserId);
// cc.fx.GameTool.setUserInfo("");
this.onGetLoginCode();
// 尝试获取游戏入口按钮,如果存在则直接返回,不进行后续操作
// let buttonEntrance = this.node.getChildByName('Btns')?.getChildByName('Button_EntranceView');
// if (buttonEntrance) {
// return;
// }
// 如果是字节跳动小游戏环境,检查侧边栏是否存在
if (MiniGameSdk_1.MiniGameSdk.isBytedance()) {
//抖音环境,检测侧边栏存在
MiniGameSdk_1.MiniGameSdk.BytedanceSidebar.checkSideBar(function (success) {
// 根据侧边栏存在性激活或禁用游戏入口按钮
// buttonEntrance.active = success;
});
}
else {
// 非抖音小游戏环境,直接激活游戏入口按钮
// 非抖音环境,正常显示按钮
// buttonEntrance.active = true;
}
// 设置监听器,以处理来自侧边栏的交互事件
MiniGameSdk_1.MiniGameSdk.BytedanceSidebar.listenFromSidebar(function (success) {
// 如果交互成功,显示奖励提示
if (success) {
MiniGameSdk_1.MiniGameSdk.API.showToast('侧边栏奖励', 5);
}
});
};
MiniGameManager.prototype.update = function (deltaTime) {
};
/**
* 弹出广告横幅
* 此方法用于加载并显示广告横幅它首先加载指定广告位的横幅广告然后显示广告
* 加载广告和显示广告是通过MiniGameSdk.AdvertManager的实例方法来实现的
*
* @remarks
* 此方法提供了两种显示横幅广告的方式
* 1. 默认方式调用showBanner方法显示广告系统会自动选择显示位置
* 2. 指定位置方式可以通过传入额外的参数来指定广告显示在屏幕的顶部或底部或者通过坐标指定显示位置
*
* 示例代码中注释掉了两种显示广告的具体方法可以根据实际需求选择使用
*/
MiniGameManager.prototype.onShowBanner = function () {
// 加载指定广告位的横幅广告。
MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.loadBanner('adunit-4e7ef467e3eaab51');
// 默认方式显示横幅广告。
// 方法1默认调用
MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.showBanner();
// 示例:指定屏幕底部正中显示横幅广告。
// 方法2指定屏幕顶部或底部正中
// MiniGameSdk.AdvertManager.instance.showBanner('adunit-4e7ef467e3eaab51', MiniGameSdk.EAdBannerLocation.BOTTOM);
// 示例:通过坐标指定位置显示横幅广告。
// 方法2指定坐标
// MiniGameSdk.AdvertManager.instance.showBanner('adunit-4e7ef467e3eaab51', { top: 10, left: 10 });
};
/**
* 隐藏广告横幅的函数
*
* 该函数调用MiniGameSdk.AdvertManager实例的方法用于隐藏广告横幅
* 当需要暂时停止展示广告或用户主动请求隐藏广告时可以调用此函数
*
* @remarks
* 此函数不接受任何参数也不返回任何值
* 它单纯地触发广告横幅的隐藏操作具体实现依赖于AdvertManager的实现
*/
MiniGameManager.prototype.onHideBanner = function () {
MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.hideBanner();
};
/**
* 显示插屏广告的函数
*
* 此函数调用MiniGameSdk.AdvertManager实例的方法以显示一个指定的插屏广告
* 它使用了硬编码的广告单元标识符这意味着它专为特定的广告位设计
* 在实际应用中可能需要根据应用的配置或用户的特定条件来动态选择广告单元标识符
*/
MiniGameManager.prototype.onShowInterstitial = function () {
MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.showInterstitial('adunit-eadd67851d3050ad');
};
/**
* 调用广告管理器加载并展示自定义广告
* 此方法首先通过广告管理器的实例加载指定的自定义广告单元然后展示这个自定义广告
* 加载和展示广告是广告管理系统中的常见操作这里通过两步分别完成加载和展示的过程
* 以确保广告在展示前正确且充分地被加载
*/
MiniGameManager.prototype.onShowCustom = function () {
// 加载指定的自定义广告单元。
MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.loadCustom(EWechatAD.CUMSTOM_01);
// 展示已加载的自定义广告。
MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.showCustom(EWechatAD.CUMSTOM_01);
};
/**
* 隐藏自定义广告
*
* 本函数调用MiniGameSdk.AdvertManager.instance.hideCustom()来隐藏自定义广告
* 这是对接广告管理系统的一部分用于控制广告的显示与隐藏
* 在需要隐藏自定义广告的场景下调用此函数即可实现相应功能
*/
MiniGameManager.prototype.onHideCustom = function () {
MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.hideCustom(EWechatAD.CUMSTOM_01);
};
/**
* 触发显示视频广告的函数
* 通过调用MiniGameSdk.AdvertManager.instance.showVideo方法显示一个视频广告并根据用户观看广告的情况执行相应的逻辑
*
* @remarks
* 此函数首先传入一个广告单元ID用于标识要显示的视频广告然后传入一个回调函数该回调函数在用户观看广告后被调用无论用户是完成了观看拒绝了观看还是观看过程中发生了错误
* 回调函数接收两个参数一个是用户观看广告的结果另一个是用户观看的广告数量根据观看结果的不同显示不同的提示信息
*/
MiniGameManager.prototype.onShowVideo = function () {
// 广告单元ID用于标识要显示的视频广告
// 广告单元ID的样例
//抖音形如: 1re3nfqkmy81m4m8ge
//微信形如: adunit-a7718f6e195e42fe
MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.showVideo('1re3nfqkmy81m4m8ge', function (res, count) {
// 输出用户观看的广告数量
console.log('用户看的视频广告个数是:', count);
// 根据用户观看广告的结果,执行不同的逻辑
switch (res) {
case MiniGameSdk_1.MiniGameSdk.EAdVideoResult.ACCEPT:
// 用户完成了广告观看,显示奖励提示
MiniGameSdk_1.MiniGameSdk.API.showToast('用户看完广告,可以奖励');
break;
case MiniGameSdk_1.MiniGameSdk.EAdVideoResult.REJECT:
// 用户拒绝了广告观看,显示不奖励提示
MiniGameSdk_1.MiniGameSdk.API.showToast('用户拒绝掉广告,不奖励');
break;
case MiniGameSdk_1.MiniGameSdk.EAdVideoResult.ERROR:
// 广告播放发生错误,显示错误提示
MiniGameSdk_1.MiniGameSdk.API.showToast('播放广告发生错误,不奖励');
break;
default:
// 其他情况,不作处理
break;
}
});
};
/**
* 引导用户分享应用给朋友
*
* 通过调用MiniGameSdk的API分享功能向用户的朋友圈发送邀请邀请他们一起玩游戏
* 这是一个重要的推广手段可以增加应用的曝光度和用户量
*
* @remarks
* 此方法中调用的API依赖于特定的小游戏平台因此在不同的平台上可能需要不同的实现
*/
MiniGameManager.prototype.onShare = function () {
MiniGameSdk_1.MiniGameSdk.API.shareAppToFriends('来玩游戏吧');
};
/**
* 显示一个toast提示
*
* 通过调用MiniGameSdk的API方法来显示一个简短的提示信息toast是一种轻量级的提示方式用于在界面上短暂地展示一些信息不影响用户操作
* 这里使用了固定的提示文本 '这是一个toast'在实际应用中可以根据需要动态设置提示文本
*/
MiniGameManager.prototype.onShowToast = function () {
MiniGameSdk_1.MiniGameSdk.API.showToast('这是一个toast');
};
/**
* 触发设备振动功能
*
* 该方法用于调用MiniGameSdk提供的API以实现设备的振动功能当需要提醒用户或提供触觉反馈时可以调用此方法
* 例如在游戏或应用中当用户完成特定操作或发生特定事件时可以通过振动给予用户反馈
*
* @remarks
* 此方法无参数也不返回任何值
*/
MiniGameManager.prototype.onVirbrate = function () {
MiniGameSdk_1.MiniGameSdk.API.vibrate();
};
/**
* 重新启动游戏实例
*
* 此函数调用MiniGameSdk中的API重新启动游戏重新启动操作可能是为了初始化游戏环境重置游戏状态或处理其他需要重启的场景
* 调用此函数后游戏将会重新开始当前的游戏状态将会被清除
*
* @remarks
* 此函数不接受任何参数
*
* @returns 无返回值
*/
MiniGameManager.prototype.onReboot = function () {
MiniGameSdk_1.MiniGameSdk.API.reboot();
};
/**
* 当前函数用于在迷你游戏中实现退出功能
* 它调用了MiniGameSdk提供的API方法来触发退出操作
* 该方法通常在需要结束当前迷你游戏或返回到上一级菜单时被调用
*/
MiniGameManager.prototype.onExit = function () {
MiniGameSdk_1.MiniGameSdk.API.exit();
};
/**
* 显示分享菜单
*
* 通过调用MiniGameSdk的API方法触发显示分享菜单的操作此函数旨在提供一个统一的入口
* 以便在需要时轻松调用分享功能而无需直接与具体的SDK接口交互
*
* @remarks
* 此方法不接受任何参数也不返回任何值
*/
MiniGameManager.prototype.onShowShareMenu = function () {
MiniGameSdk_1.MiniGameSdk.API.showShareMenu();
};
/**
* 导航到指定的小游戏
*
* 本函数用于触发导航到一个特定的小游戏这需要提供目标小游戏的ID
* 以便系统能够正确地将用户重定向到目标小游戏
*
* 注意这里的'xxx'是占位符实际使用时需要替换为具体的小游戏ID
*/
MiniGameManager.prototype.onNavigate = function () {
MiniGameSdk_1.MiniGameSdk.API.navigateTo('xxx'); // xxx替换为你的小游戏id
};
/**
* 激活字节跳动入口视图
*
* 此方法用于将字节跳动入口视图设置为活跃状态当需要在用户界面中显示字节跳动的入口时
* 可以调用此方法来激活相应的视图元素使其对用户可见
*/
MiniGameManager.prototype.onBytedanceEntranceView = function () {
// this.entranceView.active = true;
};
/**
* 请求登录代码
*
* 本函数用于触发小程序的登录流程获取微信或头条等第三方平台的登录代码
* 这些代码可以用于后续的用户身份验证和数据同步流程
*/
MiniGameManager.prototype.onGetLoginCode = function () {
var _this = this;
// 调用MiniGameSdk的API登录方法传入一个回调函数处理登录结果
MiniGameSdk_1.MiniGameSdk.API.login(function (code, anonymousCode) {
// 打印微信或头条的登录代码
console.log('Wechat Or Bytedance Code:', code);
// 打印头条的匿名登录代码
// console.log('Bytedance Anonymous Code:', anonymousCode);
if (code) {
cc.fx.GameTool.getUserId(code, function (data) { return _this.setUserId(data); });
}
});
};
MiniGameManager.prototype.setUserId = function (data) {
cc.fx.GameConfig.GM_INFO.userId = data.data.userId;
MiniGameSdk_1.MiniGameSdk.API.getUserInfo(this.setUserInfo);
};
MiniGameManager.prototype.setUserInfo = function (data) {
console.log("获取到的用户信息", data.userInfo);
var useData = {
"gameId": cc.fx.GameConfig.GM_INFO.gameId,
"userId": cc.fx.GameConfig.GM_INFO.userId,
"nickName": data.userInfo.nickName,
"pic": data.userInfo.avatarUrl
};
console.log("即将上传的用户信息:", cc.fx.GameConfig.GM_INFO.userId, data.userInfo.nickName, data.userInfo.avatarUrl);
console.log("Post数据:", useData);
cc.fx.HttpUtil.setUserInfo(useData, function (res) {
console.log("上传成功:", res);
});
};
/**
* 创建并显示游戏圈按钮
*
* 本函数通过调用MiniGameSdk的GameClub实例方法实现游戏俱乐部的创建和显示
* 它首先配置俱乐部的图标类型和位置大小然后创建俱乐部最后显示俱乐部
* 这样做是为了在小游戏内创建并展示一个游戏俱乐部的图标供玩家加入或互动
*/
MiniGameManager.prototype.onCreateClub = function () {
// 配置俱乐部图标为绿色设置图标的位置为顶部200像素左侧0像素
MiniGameSdk_1.MiniGameSdk.GameClub.instance.create(MiniGameSdk_1.MiniGameSdk.EGameClubIcon.GREEN, { top: 200, left: 0 }, { width: 50, height: 50 });
// 显示游戏俱乐部图标
MiniGameSdk_1.MiniGameSdk.GameClub.instance.show();
};
var MiniGameManager_1;
__decorate([
property(cc.Node)
], MiniGameManager.prototype, "entranceView", void 0);
MiniGameManager = MiniGameManager_1 = __decorate([
ccclass
], MiniGameManager);
return MiniGameManager;
}(cc.Component));
exports.MiniGameManager = MiniGameManager;
cc._RF.pop();

File diff suppressed because one or more lines are too long

View File

@ -34,10 +34,11 @@ var GameTool = {
var postData = {
"gameId": cc.fx.GameConfig.GM_INFO.gameId,
"userId": cc.fx.GameConfig.GM_INFO.userId,
"scode": cc.fx.GameConfig.GM_INFO.scode,
"matchId": matchId,
"data": data
};
console.log("上传数据:");
// console.log("上传数据:",data);
cc.fx.HttpUtil.uploadUserLogData(postData, function () { });
},
//上传排行榜 type为1
@ -47,8 +48,8 @@ var GameTool = {
"gameId": cc.fx.GameConfig.GM_INFO.gameId,
"userId": cc.fx.GameConfig.GM_INFO.userId,
"type": 1,
"totleTimes": data.totleTimes,
"accuracy": data.accuracy,
"score": data.score,
"accuracy": data.date,
"success": cc.fx.GameConfig.GM_INFO.success
};
cc.fx.HttpUtil.rankData(1, function () { }, postData);
@ -140,10 +141,10 @@ var GameTool = {
}
})
.catch(function (error) {
console.error('Error fetching X-Info:', error);
// console.error('Error fetching X-Info:', error);
});
}, 100);
cc.assetManager.loadRemote(url, { ext: '.jpg' }, function (err, texture) {
cc.assetManager.loadRemote(url, { ext: '.png' }, function (err, texture) {
if (texture) {
node.active = true;
node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
@ -162,7 +163,7 @@ var GameTool = {
var self = false;
cc.fx.GameTool.setPic(target.selfNode.getChildByName("pic").getChildByName("icon"), target.selfData.pic);
for (var i = 0; i <= target.listData.length - 1; i++) {
rankData.push({ rank: (i + 1), name: target.listData[i].nickName, total: target.listData[i].accuracy, time: target.listData[i].totleTimes, pic: target.listData[i].pic });
rankData.push({ rank: (i + 1), name: target.listData[i].nickName, total: target.listData[i].score, time: null, pic: target.listData[i].pic });
if (cc.fx.GameConfig.GM_INFO.userId == target.listData[i].userId) {
self = true;
target.rankNumber = i;
@ -175,9 +176,9 @@ var GameTool = {
}
cc.fx.GameTool.subName(target.selfData.nickName, nameLength);
target.selfNode.getChildByName("nameLab").getComponent(cc.Label).string = target.selfData.nickName;
target.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = target.selfData.accuracy + "%";
target.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = target.selfData.score;
var timeTemp = cc.fx.GameTool.getTimeShenNong(target.selfData.totleTimes);
target.selfNode.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + "";
// target.selfNode.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + "";
switch (target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string) {
case "1":
target.selfNode.getChildByName("rank").getChildByName("one").active = true;
@ -236,81 +237,6 @@ var GameTool = {
cc.fx.GameConfig.GM_INFO_SET("custom", arrayList[0]);
cc.fx.StorageMessage.setStorage(cc.fx.storageType.storageTypeCustom, arrayList);
},
getFoodName: function (food) {
var name = "葡萄";
switch (food) {
case "baishao":
name = "白芍";
break;
case "jingjie":
name = "荆芥";
break;
case "renshen":
name = "人参";
break;
case "danshen":
name = "丹参";
break;
case "danggui":
name = "当归";
break;
case "gouqi":
name = "枸杞";
break;
case "mudan":
name = "牡丹";
break;
case "mulan":
name = "木兰";
break;
case "pugongying":
name = "蒲公英";
break;
case "moli":
name = "茉莉";
break;
case "jinju":
name = "金桔";
break;
case "dazao":
name = "大枣";
break;
case "lizi":
name = "李子";
break;
case "lizhi":
name = "荔枝";
break;
case "taozi":
name = "桃子";
break;
case "putao":
name = "葡萄";
break;
case "muchai":
name = "木柴";
break;
case "ganjiang":
name = "干姜";
break;
case "zhuye":
name = "竹叶";
break;
case "longyan":
name = "龙眼";
break;
case "chixiaodou":
name = "赤小豆";
break;
case "gancao":
name = "甘草";
break;
case "cha":
name = "茶";
break;
}
return name;
},
getSetScreenResolutionFlag: function () {
var size = cc.winSize;
var width = size.width;
@ -388,7 +314,7 @@ var GameTool = {
},
//获取时间戳
getTime: function () {
var timestamp = new Date().getTime();
var timestamp = (new Date().getTime());
return timestamp;
},
pushLister: function () {

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,6 @@ var NewClass = /** @class */ (function (_super) {
}
NewClass.prototype.start = function () {
window.initMgr();
debugger;
cc.fx.GameConfig.init(true);
// cc.fx.AudioManager.Instance.init();
this.testVersion.string = this.clientTestVersion;

View File

@ -1 +1 @@
{"version":3,"sources":["assets\\Script\\Load.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACM,IAAA,KAAwC,EAAE,CAAC,UAAU,EAApD,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,gBAAgB,sBAAiB,CAAC;AAG5D;IAAsC,4BAAY;IAAlD;QAAA,qEAoCC;QAjCG,eAAS,GAAY,KAAK,CAAC;QAG3B,uBAAiB,GAAW,OAAO,CAAC;QAGpC,iBAAW,GAAa,IAAI,CAAC;;IA2BjC,CAAC;IAzBG,wBAAK,GAAL;QACI,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,QAAQ,CAAC;QACT,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,sCAAsC;QACtC,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC;IACrD,CAAC;IAED,cAAc;IACd,4BAAS,GAAT;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACnC,uCAAuC;IAC3C,CAAC;IACD,gBAAgB;IAChB,2BAAQ,GAAR,UAAS,KAAK,EAAC,IAAI;QACf,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjD,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IACD,OAAO;IACP,2BAAQ,GAAR;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IAES,yBAAM,GAAhB,UAAiB,EAAU;IAC3B,CAAC;IAhCD;QADC,QAAQ,CAAC,KAAK,CAAC;+CACW;IAG3B;QADC,QAAQ,CAAC,EAAE,CAAC;uDACuB;IAGpC;QADC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC;iDACU;IATZ,QAAQ;QAD5B,OAAO;OACa,QAAQ,CAoC5B;IAAD,eAAC;CApCD,AAoCC,CApCqC,EAAE,CAAC,SAAS,GAoCjD;kBApCoB,QAAQ","file":"","sourceRoot":"/","sourcesContent":["\r\nconst {ccclass, property, requireComponent} = cc._decorator;\r\n\r\n@ccclass\r\nexport default class NewClass extends cc.Component {\r\n\r\n @property(false)\r\n localTest: boolean = false;\r\n\r\n @property(\"\")\r\n clientTestVersion: string = \"1.0.0\";\r\n\r\n @property(cc.Label)\r\n testVersion: cc.Label = null;\r\n\r\n start () {\r\n window.initMgr();\r\n debugger;\r\n cc.fx.GameConfig.init(true);\r\n // cc.fx.AudioManager.Instance.init();\r\n this.testVersion.string = this.clientTestVersion;\r\n }\r\n\r\n //开始游戏,跳转至引导页面\r\n startGame(){\r\n cc.director.loadScene(\"GameScene\");\r\n // cc.director.loadScene(\"GuideScene\");\r\n }\r\n //备用,用来测试跳转 指定关卡\r\n clickBtn(event,data){\r\n cc.fx.GameConfig.GM_INFO.custom = parseInt(data);\r\n cc.director.loadScene(\"GameScene\");\r\n } \r\n //打开排行榜\r\n openRank(){\r\n cc.director.loadScene(\"RankScene\");\r\n }\r\n \r\n protected update(dt: number): void {\r\n }\r\n}\r\n"]}
{"version":3,"sources":["assets\\Script\\Load.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACM,IAAA,KAAwC,EAAE,CAAC,UAAU,EAApD,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,gBAAgB,sBAAiB,CAAC;AAG5D;IAAsC,4BAAY;IAAlD;QAAA,qEAmCC;QAhCG,eAAS,GAAY,KAAK,CAAC;QAG3B,uBAAiB,GAAW,OAAO,CAAC;QAGpC,iBAAW,GAAa,IAAI,CAAC;;IA0BjC,CAAC;IAxBG,wBAAK,GAAL;QACI,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,sCAAsC;QACtC,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC;IACrD,CAAC;IAED,cAAc;IACd,4BAAS,GAAT;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACnC,uCAAuC;IAC3C,CAAC;IACD,gBAAgB;IAChB,2BAAQ,GAAR,UAAS,KAAK,EAAC,IAAI;QACf,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QACjD,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IACD,OAAO;IACP,2BAAQ,GAAR;QACI,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,CAAC;IAES,yBAAM,GAAhB,UAAiB,EAAU;IAC3B,CAAC;IA/BD;QADC,QAAQ,CAAC,KAAK,CAAC;+CACW;IAG3B;QADC,QAAQ,CAAC,EAAE,CAAC;uDACuB;IAGpC;QADC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC;iDACU;IATZ,QAAQ;QAD5B,OAAO;OACa,QAAQ,CAmC5B;IAAD,eAAC;CAnCD,AAmCC,CAnCqC,EAAE,CAAC,SAAS,GAmCjD;kBAnCoB,QAAQ","file":"","sourceRoot":"/","sourcesContent":["\r\nconst {ccclass, property, requireComponent} = cc._decorator;\r\n\r\n@ccclass\r\nexport default class NewClass extends cc.Component {\r\n\r\n @property(false)\r\n localTest: boolean = false;\r\n\r\n @property(\"\")\r\n clientTestVersion: string = \"1.0.0\";\r\n\r\n @property(cc.Label)\r\n testVersion: cc.Label = null;\r\n\r\n start () {\r\n window.initMgr();\r\n cc.fx.GameConfig.init(true);\r\n // cc.fx.AudioManager.Instance.init();\r\n this.testVersion.string = this.clientTestVersion;\r\n }\r\n\r\n //开始游戏,跳转至引导页面\r\n startGame(){\r\n cc.director.loadScene(\"GameScene\");\r\n // cc.director.loadScene(\"GuideScene\");\r\n }\r\n //备用,用来测试跳转 指定关卡\r\n clickBtn(event,data){\r\n cc.fx.GameConfig.GM_INFO.custom = parseInt(data);\r\n cc.director.loadScene(\"GameScene\");\r\n } \r\n //打开排行榜\r\n openRank(){\r\n cc.director.loadScene(\"RankScene\");\r\n }\r\n \r\n protected update(dt: number): void {\r\n }\r\n}\r\n"]}

View File

@ -30,31 +30,13 @@ var AudioManager = /** @class */ (function (_super) {
var _this = _super !== null && _super.apply(this, arguments) || this;
//背景音乐
_this.audioGameBgm0 = null;
_this.baishao_audio = null;
_this.cha_audio = null;
_this.chixiaodou_audio = null;
_this.danggui_audio = null;
_this.danshen_audio = null;
_this.dazao_audio = null;
_this.gancao_audio = null;
_this.ganjiang_audio = null;
_this.gouqi_audio = null;
_this.jingjie_audio = null;
_this.jinju_audio = null;
_this.lizhi_audio = null;
_this.lizi_audio = null;
_this.longyan_audio = null;
_this.moli_audio = null;
_this.muchai_audio = null;
_this.mudan_audio = null;
_this.mulan_audio = null;
_this.pugongying_audio = null;
_this.putao_audio = null;
_this.renshen_audio = null;
_this.taozi_audio = null;
_this.zhuye_audio = null;
_this.err = null;
_this.yes = null;
_this.chehui = null;
_this.jineng = null;
_this.qingkong = null;
_this.fangxiang = null;
_this.build = null;
_this.win = null;
_this.lose = null;
return _this;
}
AudioManager_1 = AudioManager;
@ -94,6 +76,12 @@ var AudioManager = /** @class */ (function (_super) {
volume = 1;
cc.audioEngine.setEffectsVolume(1);
cc.audioEngine.setMusicVolume(1);
if (audioSource.name == "lose") {
cc.audioEngine.setEffectsVolume(0.5);
}
else {
cc.audioEngine.setEffectsVolume(1);
}
var context = cc.audioEngine.playEffect(audioSource, loop);
if (callback) {
cc.audioEngine.setFinishCallback(context, function () {
@ -231,79 +219,25 @@ var AudioManager = /** @class */ (function (_super) {
], AudioManager.prototype, "audioGameBgm0", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "baishao_audio", void 0);
], AudioManager.prototype, "chehui", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "cha_audio", void 0);
], AudioManager.prototype, "jineng", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "chixiaodou_audio", void 0);
], AudioManager.prototype, "qingkong", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "danggui_audio", void 0);
], AudioManager.prototype, "fangxiang", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "danshen_audio", void 0);
], AudioManager.prototype, "build", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "dazao_audio", void 0);
], AudioManager.prototype, "win", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "gancao_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "ganjiang_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "gouqi_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "jingjie_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "jinju_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "lizhi_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "lizi_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "longyan_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "moli_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "muchai_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "mudan_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "mulan_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "pugongying_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "putao_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "renshen_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "taozi_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "zhuye_audio", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "err", void 0);
__decorate([
property(cc.AudioClip)
], AudioManager.prototype, "yes", void 0);
], AudioManager.prototype, "lose", void 0);
AudioManager = AudioManager_1 = __decorate([
ccclass
], AudioManager);

File diff suppressed because one or more lines are too long

View File

@ -42,7 +42,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.WeChat = void 0;
var shareConfig = {
gameId: "100010",
gameId: "100009",
shareLine: "zDLsruVI",
EK: "hui231%1"
};
@ -58,6 +58,7 @@ var WeChat = /** @class */ (function () {
WeChat.getResult = function (res) {
if (res) {
var data = res.data;
// @ts-ignore
wx.config({
debug: false,
appId: data.appId,
@ -66,40 +67,46 @@ var WeChat = /** @class */ (function () {
signature: data.signature,
jsApiList: ['onMenuShareTimeline', 'updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage']
});
// @ts-ignore
wx.checkJsApi({
jsApiList: ['updateAppMessageShareData'],
success: function (res) {
setTimeout(function () {
WeChat.changeShare();
}, 100);
}, 200);
setTimeout(function () {
WeChat.changeShare();
}, 200);
}, 500);
}
});
}
};
WeChat.changeShare = function () {
// @ts-ignore
wx.ready(function () {
// @ts-ignore
wx.updateAppMessageShareData({
title: '记忆力认知测评',
desc: '你的认知灵活性和选择注意有问题吗',
desc: '你的注意力和工作记忆有问题吗',
link: shareConfig.shareLine,
imgUrl: 'https://static.sparkus.cn/public/shennong.jpg',
imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg',
success: function () {
// 设置成功
console.log("分享好友成功回调");
}
});
wx.updateTimelineShareData({
title: '记忆力认知测评',
link: shareConfig.shareLine,
imgUrl: 'https://static.sparkus.cn/public/shennong.jpg',
success: function () {
// 设置成功
console.log("分享朋友圈成功回调");
}
});
setTimeout(function () {
// @ts-ignore
wx.updateTimelineShareData({
title: '记忆力认知测评',
link: shareConfig.shareLine,
imgUrl: 'https://static.sparkus.cn/public/shootsun.jpg',
success: function () {
// 设置成功
console.log("分享朋友圈成功回调");
}
});
}, 200);
});
};
WeChat.getSignature = function (url) {
@ -112,8 +119,8 @@ var WeChat = /** @class */ (function () {
var time, url;
return __generator(this, function (_a) {
time = Math.floor((new Date().getTime()) / 1000);
url = cc.fx.HttpUtil.apiSign("/api/share/cfg?gameId=" + shareConfig.gameId + "&time=" + time + "&url=" + shareUrl, {});
return [2 /*return*/, cc.fx.HttpUtil.get(url, callback)];
url = cc.fx.HttpUtil.apiSign("/api/share/cfg?gameId=" + cc.fx.GameConfig.GM_INFO.gameId + "&time=" + time + "&url=" + shareUrl, {});
return [2 /*return*/, cc.fx.HttpUtil.get(url, callback, 3)];
});
});
};

File diff suppressed because one or more lines are too long

View File

@ -16,6 +16,17 @@ var __extends = (this && this.__extends) || (function () {
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@ -69,17 +80,6 @@ var HttpUtil = /** @class */ (function (_super) {
return _super !== null && _super.apply(this, arguments) || this;
}
HttpUtil_1 = HttpUtil;
HttpUtil.getShareInfo = function (shareUrl) {
return __awaiter(this, void 0, Promise, function () {
var time, url;
return __generator(this, function (_a) {
console.log("设置分享链接:", shareUrl);
time = Math.floor((new Date().getTime()) / 1000);
url = HttpUtil_1.apiSign("/api/share/cfg?gameId=" + config.gameId + "&time=" + time + "&url=" + shareUrl, {});
return [2 /*return*/, this.post(url, null, null)];
});
});
};
//排行榜
HttpUtil.rankData = function (type, callback, data) {
return __awaiter(this, void 0, Promise, function () {
@ -87,7 +87,7 @@ var HttpUtil = /** @class */ (function (_super) {
return __generator(this, function (_a) {
time = Math.floor((new Date().getTime()) / 1000);
url = HttpUtil_1.apiSign("/api/get/rank/data?gameId=" + config.gameId + "&dataType=" + type + "&time=" + time, data);
this.post(url, data, callback);
this.post(url, data, callback, 0);
return [2 /*return*/];
});
});
@ -97,7 +97,7 @@ var HttpUtil = /** @class */ (function (_super) {
var url;
return __generator(this, function (_a) {
url = '/log/collect/data';
this.post(url, data, callback);
this.post(url, data, callback, 3);
return [2 /*return*/];
});
});
@ -109,17 +109,19 @@ var HttpUtil = /** @class */ (function (_super) {
return __generator(this, function (_a) {
time = Math.floor((new Date().getTime()) / 1000);
url = HttpUtil_1.apiSign("/api/get/user/data?gameId=" + config.gameId + "&time=" + time, data);
this.post(url, data, callback);
this.post(url, data, callback, 0);
return [2 /*return*/];
});
});
};
HttpUtil.post = function (url, data, callback) {
HttpUtil.get = function (url, callback, count) {
return __awaiter(this, void 0, void 0, function () {
var response;
var repeat, response;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.fetchData(url, data, 'POST')];
case 0:
repeat = count ? count : 0;
return [4 /*yield*/, this.fetchData(url, null, 'GET', repeat)];
case 1:
response = _a.sent();
callback && callback(response);
@ -128,12 +130,14 @@ var HttpUtil = /** @class */ (function (_super) {
});
});
};
HttpUtil.get = function (url, callback) {
HttpUtil.post = function (url, data, callback, count) {
return __awaiter(this, void 0, void 0, function () {
var response;
var repeat, response;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.fetchData(url, null, 'GET')];
case 0:
repeat = count ? count : 0;
return [4 /*yield*/, this.fetchData(url, data, 'POST', repeat)];
case 1:
response = _a.sent();
callback && callback(response);
@ -142,9 +146,10 @@ var HttpUtil = /** @class */ (function (_super) {
});
});
};
HttpUtil.fetchData = function (url, data, method) {
HttpUtil.fetchData = function (url, data, method, repeat) {
return __awaiter(this, void 0, void 0, function () {
var fullUrl, headers, options, response, error_1;
var fullUrl, headers, options, response, error_1, timeOut;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
@ -158,23 +163,58 @@ var HttpUtil = /** @class */ (function (_super) {
_a.label = 1;
case 1:
_a.trys.push([1, 4, , 5]);
return [4 /*yield*/, fetch(fullUrl, options)];
return [4 /*yield*/, this.fetchWithTimeout(fullUrl, options)];
case 2:
response = _a.sent();
if (!response.ok) {
throw new Error("HTTP error! status: " + response.status);
throw new Error("HTTP_______________error! status: " + response.status);
}
return [4 /*yield*/, response.json()];
case 3: return [2 /*return*/, _a.sent()];
case 4:
error_1 = _a.sent();
console.error('Fetch error:', error_1);
return [2 /*return*/, null];
console.error('Fetch_______________error:', error_1);
if (repeat > 0) {
repeat -= 1;
timeOut = (3 - repeat) * 5000;
setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.fetchData(url, data, method, repeat)];
case 1:
response = _a.sent();
return [2 /*return*/];
}
});
}); }, timeOut);
}
else {
return [2 /*return*/, null];
}
return [3 /*break*/, 5];
case 5: return [2 /*return*/];
}
});
});
};
HttpUtil.fetchWithTimeout = function (resource, options) {
if (options === void 0) { options = {}; }
return __awaiter(this, void 0, void 0, function () {
var controller, id, response;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
controller = new AbortController();
id = setTimeout(function () { return controller.abort(); }, 5000);
return [4 /*yield*/, fetch(resource, __assign(__assign({}, options), { signal: controller.signal }))];
case 1:
response = _a.sent();
clearTimeout(id);
return [2 /*return*/, response];
}
});
});
};
/**
*
* @param url {string} 接口地址

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
{
"__type__": "cc.TTFFont",
"_name": "SourceHanSerifCN-Bold",
"_objFlags": 0,
"_native": "SourceHanSerifCN-Bold.ttf",
"_fontFamily": null
}

View File

@ -0,0 +1,58 @@
"use strict";
cc._RF.push(module, '8a024+q5K9MrpxcaTvucSDB', 'DouyinEntranceView');
// Script/Sdk/DouyinEntranceView.ts
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DouyinEntranceView = void 0;
var MiniGameSdk_1 = require("./MiniGameSdk");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var DouyinEntranceView = /** @class */ (function (_super) {
__extends(DouyinEntranceView, _super);
function DouyinEntranceView() {
return _super !== null && _super.apply(this, arguments) || this;
}
DouyinEntranceView.prototype.start = function () {
};
DouyinEntranceView.prototype.update = function (deltaTime) {
};
DouyinEntranceView.prototype.onCloseClick = function () {
this.node.active = false;
};
DouyinEntranceView.prototype.onNavigateToDouyinClick = function () {
MiniGameSdk_1.MiniGameSdk.BytedanceSidebar.navigateToSidebar(function (success) {
if (success) {
console.log('跳转成功');
}
else {
console.log('跳转失败');
}
});
};
DouyinEntranceView = __decorate([
ccclass
], DouyinEntranceView);
return DouyinEntranceView;
}(cc.Component));
exports.DouyinEntranceView = DouyinEntranceView;
cc._RF.pop();

View File

@ -0,0 +1 @@
{"version":3,"sources":["assets\\Script\\Sdk\\DouyinEntranceView.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA4C;AACtC,IAAA,KAAwB,EAAE,CAAC,UAAU,EAAnC,OAAO,aAAA,EAAE,QAAQ,cAAkB,CAAC;AAI5C;IAAwC,sCAAY;IAApD;;IAuBA,CAAC;IAtBG,kCAAK,GAAL;IAEA,CAAC;IAED,mCAAM,GAAN,UAAO,SAAiB;IAExB,CAAC;IAED,yCAAY,GAAZ;QACI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,oDAAuB,GAAvB;QAEI,yBAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,UAAC,OAAgB;YAC5D,IAAI,OAAO,EAAE;gBACT,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;aACvB;iBAAM;gBACH,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;aACvB;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAtBQ,kBAAkB;QAD9B,OAAO;OACK,kBAAkB,CAuB9B;IAAD,yBAAC;CAvBD,AAuBC,CAvBuC,EAAE,CAAC,SAAS,GAuBnD;AAvBY,gDAAkB","file":"","sourceRoot":"/","sourcesContent":["import { MiniGameSdk } from \"./MiniGameSdk\";\r\nconst { ccclass, property } = cc._decorator;\r\n\r\n\r\n@ccclass\r\nexport class DouyinEntranceView extends cc.Component {\r\n start() {\r\n\r\n }\r\n\r\n update(deltaTime: number) {\r\n\r\n }\r\n\r\n onCloseClick() {\r\n this.node.active = false;\r\n }\r\n\r\n onNavigateToDouyinClick() {\r\n\r\n MiniGameSdk.BytedanceSidebar.navigateToSidebar((success: boolean) => { // 跳转到抖音侧边栏\r\n if (success) {\r\n console.log('跳转成功');\r\n } else {\r\n console.log('跳转失败');\r\n }\r\n });\r\n }\r\n}\r\n"]}

View File

@ -1,6 +0,0 @@
{
"__type__": "cc.Asset",
"_name": "Share",
"_objFlags": 0,
"_native": ".zip"
}

View File

@ -0,0 +1,7 @@
{
"__type__": "cc.TTFFont",
"_name": "SourceHanSerifCN-Medium",
"_objFlags": 0,
"_native": "SourceHanSerifCN-Medium.ttf",
"_fontFamily": null
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -36,9 +36,9 @@ var ItemRender = /** @class */ (function (_super) {
}
/**数据改变时调用 */
ItemRender.prototype.dataChanged = function () {
cc.fx.GameTool.subName(this.data.name, 6);
var name = cc.fx.GameTool.subName(this.data.name, 6);
this.node.getChildByName("rankLab").getComponent(cc.Label).string = this.data.rank + "";
this.node.getChildByName("nameLab").getComponent(cc.Label).string = this.data.name + "";
this.node.getChildByName("nameLab").getComponent(cc.Label).string = name + "";
this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total + "%";
var timeTemp = cc.fx.GameTool.getTimeShenNong(this.data.time);
this.node.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + "";
@ -80,7 +80,7 @@ var ItemRender = /** @class */ (function (_super) {
}
})
.catch(function (error) {
console.error('Error fetching X-Info:', error);
// console.error('Error fetching X-Info:', error);
});
cc.assetManager.loadRemote(url, { ext: '.png' }, function (err, texture) {
if (texture) {
@ -91,7 +91,7 @@ var ItemRender = /** @class */ (function (_super) {
}
else {
// console.log("设置头像失败",url);
console.log(err, texture);
// console.log(err,texture)
}
});
};

File diff suppressed because one or more lines are too long

View File

@ -10,8 +10,8 @@
"relativePath": "Scene"
},
"4734c20c-0db8-4eb2-92ea-e692f4d70934": {
"asset": 1718679055991,
"meta": 1720605517840,
"asset": 1724813915381,
"meta": 1724814258404,
"relativePath": "Script"
},
"7b81d4e8-ec84-4716-968d-500ac1d78a54": {
@ -70,8 +70,8 @@
"relativePath": "Shader"
},
"2880dc26-5b38-48bd-baba-daaec97499cb": {
"asset": 1718619532615,
"meta": 1718619583056,
"asset": 1724742919592,
"meta": 1724814258403,
"relativePath": "res"
},
"4eaf518b-35ec-4262-928d-4d497c3f2830": {
@ -80,48 +80,48 @@
"relativePath": "Scene\\GameScene.fire"
},
"eaa8b84d-69d0-4170-9f7d-8179ea948cde": {
"asset": 1720605318013,
"meta": 1720605517842,
"asset": 1724814258376,
"meta": 1724814258404,
"relativePath": "Script\\module"
},
"8848cd9b-8115-456d-a656-2abcda1dadbe": {
"asset": 1718619692450,
"meta": 1720605517844,
"meta": 1723434815937,
"relativePath": "Script\\module\\Config"
},
"13a0b173-d59e-4a9d-b5e3-4dbe4dc37cc1": {
"asset": 1718619692458,
"meta": 1720605517844,
"meta": 1723434815938,
"relativePath": "Script\\module\\Crypto"
},
"b4e113c6-a987-4133-bfa0-3355d8ab4bd1": {
"asset": 1718619692462,
"meta": 1720605517845,
"meta": 1723434815940,
"relativePath": "Script\\module\\GameStart"
},
"0487cacb-b94a-4ab6-a301-b6402ab0ac5d": {
"asset": 1718619692462,
"meta": 1720605517846,
"meta": 1723434815942,
"relativePath": "Script\\module\\Music"
},
"ff6560d9-676d-42ad-8ec7-e44acb84ad9e": {
"asset": 1718619692466,
"meta": 1720605517847,
"meta": 1723434815943,
"relativePath": "Script\\module\\Notification"
},
"d3520299-33dc-43d2-b522-d424efb5575d": {
"asset": 1718619692474,
"meta": 1720605517847,
"meta": 1723434815944,
"relativePath": "Script\\module\\RankList"
},
"2af8f2ef-b8a0-43ad-a144-ef4a887f2fa9": {
"asset": 1718619692478,
"meta": 1720605517849,
"meta": 1723434815946,
"relativePath": "Script\\module\\Storage"
},
"2a81f82d-8d16-44af-b947-44eea4dde54f": {
"asset": 1718619692482,
"meta": 1720605517850,
"meta": 1723434815946,
"relativePath": "Script\\module\\Tool"
},
"e64e1a97-c93f-4257-ab34-80341d8ff79d": {
@ -136,7 +136,7 @@
},
"d54211e0-2d28-4528-88e3-e5fd7c9b59a2": {
"asset": 1716189341583,
"meta": 1718260711351,
"meta": 1724814258871,
"relativePath": "Script\\module\\RankList\\List.ts"
},
"5c9b8159-89a3-4b32-b303-b3d4f7ac1c9f": {
@ -150,18 +150,18 @@
"relativePath": "Script\\module\\Storage\\Storage.ts"
},
"771a3d9a-4013-4654-a777-fbaea0c93280": {
"asset": 1720412209513,
"meta": 1720605518151,
"asset": 1724210582706,
"meta": 1724814258706,
"relativePath": "Script\\module\\Crypto\\HttpUtil.ts"
},
"58403fe7-d7a2-426b-9b19-84d3236731a8": {
"asset": 1720174805252,
"meta": 1720605518223,
"asset": 1723016663003,
"meta": 1723434816622,
"relativePath": "Script\\module\\Music\\AudioManager.ts"
},
"9c08062d-4cf1-4b6e-a8ba-4a3881cc7e7d": {
"asset": 1720606674576,
"meta": 1720606674582,
"asset": 1723436390364,
"meta": 1723436390368,
"relativePath": "Scene\\LoadScene.fire"
},
"805c69df-dfdf-4759-97ae-5a7341f424c7": {
@ -171,17 +171,17 @@
},
"61d4c718-db3b-4b31-8221-f16bea3cf030": {
"asset": 1720411081997,
"meta": 1720605518172,
"meta": 1724814258720,
"relativePath": "Script\\module\\GameStart\\GameAppStart.ts"
},
"ca0f9934-a015-436e-9402-f8e30d4c5de6": {
"asset": 1719476024626,
"meta": 1720605518248,
"asset": 1722331848349,
"meta": 1724814258746,
"relativePath": "Script\\module\\RankList\\ItemRender.ts"
},
"43bfc27a-ff6e-45b3-87c7-504d0f781397": {
"asset": 1720412213923,
"meta": 1720605518351,
"asset": 1724814168087,
"meta": 1724814258928,
"relativePath": "Script\\module\\Tool\\GameTool.ts"
},
"e74a9f7d-2031-4e69-bcb2-9998174088b2": {
@ -226,502 +226,502 @@
},
"9836134e-b892-4283-b6b2-78b5acf3ed45": {
"asset": 1714966328642,
"meta": 1720605515002,
"meta": 1724814255818,
"relativePath": "effects"
},
"abc2cb62-7852-4525-a90d-d474487b88f2": {
"asset": 1714966328642,
"meta": 1720605515140,
"meta": 1724814255938,
"relativePath": "effects\\builtin-phong.effect"
},
"e2f00085-c597-422d-9759-52c360279106": {
"asset": 1714966328642,
"meta": 1720605515198,
"meta": 1724814255986,
"relativePath": "effects\\builtin-toon.effect"
},
"430eccbf-bf2c-4e6e-8c0c-884bbb487f32": {
"asset": 1714966328642,
"meta": 1720605515216,
"meta": 1724814255994,
"relativePath": "effects\\__builtin-editor-gizmo-line.effect"
},
"6c5cf6e1-b044-4eac-9431-835644d57381": {
"asset": 1714966328642,
"meta": 1720605515225,
"meta": 1724814256003,
"relativePath": "effects\\__builtin-editor-gizmo-unlit.effect"
},
"115286d1-2e10-49ee-aab4-341583f607e8": {
"asset": 1714966328642,
"meta": 1720605515260,
"meta": 1724814256032,
"relativePath": "effects\\__builtin-editor-gizmo.effect"
},
"f8e6b000-5643-4b86-9080-aa680ce1f599": {
"asset": 1714966328706,
"meta": 1720605515003,
"meta": 1724814255818,
"relativePath": "image"
},
"5c3eedba-6c41-4c0c-9ba7-d91f813cbd1c": {
"asset": 1714966328721,
"meta": 1720605515005,
"meta": 1724814255818,
"relativePath": "materials"
},
"fc09f9bd-2cce-4605-b630-8145ef809ed6": {
"asset": 1714966328721,
"meta": 1720605515006,
"meta": 1724814255818,
"relativePath": "misc"
},
"e851e89b-faa2-4484-bea6-5c01dd9f06e2": {
"asset": 1714966328658,
"meta": 1720605515325,
"meta": 1724814256125,
"relativePath": "image\\default_btn_normal.png"
},
"db019bf7-f71c-4111-98cf-918ea180cb48": {
"asset": 1714966328737,
"meta": 1720605515008,
"meta": 1724814255822,
"relativePath": "model"
},
"4bab67cb-18e6-4099-b840-355f0473f890": {
"asset": 1714966328689,
"meta": 1720605515395,
"meta": 1724814256121,
"relativePath": "image\\default_scrollbar_bg.png"
},
"e39e96e6-6f6e-413f-bcf1-ac7679bb648a": {
"asset": 1714966328737,
"meta": 1720605515333,
"meta": 1724814256093,
"relativePath": "model\\prefab"
},
"617323dd-11f4-4dd3-8eec-0caf6b3b45b9": {
"asset": 1714966328689,
"meta": 1720605515383,
"meta": 1724814256133,
"relativePath": "image\\default_scrollbar_vertical_bg.png"
},
"71561142-4c83-4933-afca-cb7a17f67053": {
"asset": 1714966328658,
"meta": 1720605515331,
"meta": 1724814256077,
"relativePath": "image\\default_btn_disabled.png"
},
"600301aa-3357-4a10-b086-84f011fa32ba": {
"asset": 1714966328642,
"meta": 1720605515379,
"meta": 1724814256085,
"relativePath": "image\\default-particle.png"
},
"edd215b9-2796-4a05-aaf5-81f96c9281ce": {
"asset": 1714966328658,
"meta": 1720605515317,
"meta": 1724814256073,
"relativePath": "image\\default_editbox_bg.png"
},
"b43ff3c2-02bb-4874-81f7-f2dea6970f18": {
"asset": 1714966328658,
"meta": 1720605515329,
"meta": 1724814256077,
"relativePath": "image\\default_btn_pressed.png"
},
"567dcd80-8bf4-4535-8a5a-313f1caf078a": {
"asset": 1714966328673,
"meta": 1720605515315,
"meta": 1724814256093,
"relativePath": "image\\default_radio_button_off.png"
},
"cfef78f1-c8df-49b7-8ed0-4c953ace2621": {
"asset": 1714966328673,
"meta": 1720605515320,
"meta": 1724814256089,
"relativePath": "image\\default_progressbar.png"
},
"f6e6dd15-71d1-4ffe-ace7-24fd39942c05": {
"asset": 1714966328752,
"meta": 1720605515009,
"meta": 1724814255822,
"relativePath": "obsolete"
},
"0291c134-b3da-4098-b7b5-e397edbe947f": {
"asset": 1714966328689,
"meta": 1720605515377,
"meta": 1724814256121,
"relativePath": "image\\default_scrollbar.png"
},
"c4480a0a-6ac5-443f-8b40-361a14257fc8": {
"asset": 1714966328706,
"meta": 1720605515755,
"meta": 1724814256400,
"relativePath": "materials\\builtin-phong.mtl"
},
"f743d2b6-b7ea-4c14-a55b-547ed4d0a045": {
"asset": 1714966328752,
"meta": 1720605515010,
"meta": 1724814255822,
"relativePath": "particle"
},
"9d60001f-b5f4-4726-a629-2659e3ded0b8": {
"asset": 1714966328673,
"meta": 1720605515381,
"meta": 1724814256125,
"relativePath": "image\\default_radio_button_on.png"
},
"a87cc147-01b2-43f8-8e42-a7ca90b0c757": {
"asset": 1714966328721,
"meta": 1720605515674,
"meta": 1724814256319,
"relativePath": "model\\prefab\\box.prefab"
},
"d81ec8ad-247c-4e62-aa3c-d35c4193c7af": {
"asset": 1714966328673,
"meta": 1720605515386,
"meta": 1724814256129,
"relativePath": "image\\default_panel.png"
},
"fe1417b6-fe6b-46a4-ae7c-9fd331f33a2a": {
"asset": 1714966328737,
"meta": 1720605515677,
"meta": 1724814256323,
"relativePath": "model\\prefab\\capsule.prefab"
},
"ae6c6c98-11e4-452f-8758-75f5c6a56e83": {
"asset": 1714966328831,
"meta": 1720605515011,
"meta": 1724814255822,
"relativePath": "prefab"
},
"d6d3ca85-4681-47c1-b5dd-d036a9d39ea2": {
"asset": 1714966328689,
"meta": 1720605515392,
"meta": 1724814256089,
"relativePath": "image\\default_scrollbar_vertical.png"
},
"b5fc2cf2-7942-483d-be1f-bbeadc4714ad": {
"asset": 1714966328737,
"meta": 1720605515670,
"meta": 1724814256339,
"relativePath": "model\\prefab\\cone.prefab"
},
"1c5e4038-953a-44c2-b620-0bbfc6170477": {
"asset": 1714966328737,
"meta": 1720605515680,
"meta": 1724814256343,
"relativePath": "model\\prefab\\cylinder.prefab"
},
"99170b0b-d210-46f1-b213-7d9e3f23098a": {
"asset": 1714966328673,
"meta": 1720605515322,
"meta": 1724814256129,
"relativePath": "image\\default_progressbar_bg.png"
},
"3f376125-a699-40ca-ad05-04d662eaa1f2": {
"asset": 1714966328737,
"meta": 1720605515672,
"meta": 1724814256343,
"relativePath": "model\\prefab\\plane.prefab"
},
"6c9ef10d-b479-420b-bfe6-39cdda6a8ae0": {
"asset": 1714966328737,
"meta": 1720605515684,
"meta": 1724814256343,
"relativePath": "model\\prefab\\quad.prefab"
},
"6e056173-d285-473c-b206-40a7fff5386e": {
"asset": 1714966328689,
"meta": 1720605515390,
"meta": 1724814256129,
"relativePath": "image\\default_sprite.png"
},
"2d9a4b85-b0ab-4c46-84c5-18f393ab2058": {
"asset": 1714966328737,
"meta": 1720605515689,
"meta": 1724814256347,
"relativePath": "model\\prefab\\sphere.prefab"
},
"de510076-056b-484f-b94c-83bef217d0e1": {
"asset": 1714966328737,
"meta": 1720605515675,
"meta": 1724814256347,
"relativePath": "model\\prefab\\torus.prefab"
},
"0275e94c-56a7-410f-bd1a-fc7483f7d14a": {
"asset": 1714966328705,
"meta": 1720605515388,
"meta": 1724814256133,
"relativePath": "image\\default_sprite_splash.png"
},
"897ef7a1-4860-4f64-968d-f5924b18668a": {
"asset": 1714966328752,
"meta": 1720605515401,
"meta": 1724814256141,
"relativePath": "prefab\\2d-camera.prefab"
},
"70d7cdb0-04cd-41bb-9480-c06a4785f386": {
"asset": 1714966328768,
"meta": 1720605515404,
"meta": 1724814256141,
"relativePath": "prefab\\3d-camera.prefab"
},
"a3ee0214-b432-4865-9666-4a3211814282": {
"asset": 1714966328800,
"meta": 1720605515405,
"meta": 1724814256141,
"relativePath": "prefab\\light"
},
"ed88f13d-fcad-4848-aa35-65a2cb973584": {
"asset": 1714966328768,
"meta": 1720605515412,
"meta": 1724814256145,
"relativePath": "prefab\\3d-stage.prefab"
},
"61aeb05b-3b32-452b-8eed-2b76deeed554": {
"asset": 1714966328783,
"meta": 1720605515419,
"meta": 1724814256153,
"relativePath": "prefab\\editbox.prefab"
},
"972b9a4d-47ee-4c74-b5c3-61d8a69bc29f": {
"asset": 1714966328768,
"meta": 1720605515407,
"meta": 1724814256149,
"relativePath": "prefab\\button.prefab"
},
"70bbeb73-6dc2-4ee4-8faf-76b3a0e34ec4": {
"asset": 1714966328768,
"meta": 1720605515410,
"meta": 1724814256149,
"relativePath": "prefab\\3d-particle.prefab"
},
"2c937608-2562-40ea-b264-7395df6f0cea": {
"asset": 1714966328768,
"meta": 1720605515416,
"meta": 1724814256149,
"relativePath": "prefab\\canvas.prefab"
},
"27756ebb-3d33-44b0-9b96-e858fadd4dd4": {
"asset": 1714966328783,
"meta": 1720605515424,
"meta": 1724814256157,
"relativePath": "prefab\\label.prefab"
},
"785a442c-3ceb-45be-a46e-7317f625f3b9": {
"asset": 1714966328783,
"meta": 1720605515427,
"meta": 1724814256162,
"relativePath": "prefab\\layout.prefab"
},
"2be36297-9abb-4fee-8049-9ed5e271da8a": {
"asset": 1714966328721,
"meta": 1720605515487,
"meta": 1724814256198,
"relativePath": "misc\\default_video.mp4"
},
"4a37dd57-78cd-4cec-aad4-f11a73d12b63": {
"asset": 1714966328800,
"meta": 1720605515432,
"meta": 1724814256170,
"relativePath": "prefab\\richtext.prefab"
},
"cd33edea-55f5-46c2-958d-357a01384a36": {
"asset": 1714966328800,
"meta": 1720605515429,
"meta": 1724814256162,
"relativePath": "prefab\\particlesystem.prefab"
},
"ca8401fe-ad6e-41a8-bd46-8e3e4e9945be": {
"asset": 1714966328800,
"meta": 1720605515434,
"meta": 1724814256166,
"relativePath": "prefab\\pageview.prefab"
},
"5965ffac-69da-4b55-bcde-9225d0613c28": {
"asset": 1714966328800,
"meta": 1720605515436,
"meta": 1724814256166,
"relativePath": "prefab\\progressBar.prefab"
},
"c25b9d50-c8fc-4d27-beeb-6e7c1f2e5c0f": {
"asset": 1714966328706,
"meta": 1720605515463,
"meta": 1724814256198,
"relativePath": "image\\default_toggle_disabled.png"
},
"32044bd2-481f-4cf1-a656-e2b2fb1594eb": {
"asset": 1714966328800,
"meta": 1720605515439,
"meta": 1724814256174,
"relativePath": "prefab\\scrollview.prefab"
},
"0004d1cf-a0ad-47d8-ab17-34d3db9d35a3": {
"asset": 1714966328800,
"meta": 1720605515441,
"meta": 1724814256170,
"relativePath": "prefab\\slider.prefab"
},
"96083d03-c332-4a3f-9386-d03e2d19e8ee": {
"asset": 1714966328815,
"meta": 1720605515450,
"meta": 1724814256182,
"relativePath": "prefab\\sprite.prefab"
},
"b181c1e4-0a72-4a91-bfb0-ae6f36ca60bd": {
"asset": 1714966328706,
"meta": 1720605515472,
"meta": 1724814256190,
"relativePath": "image\\default_toggle_pressed.png"
},
"d8afc78c-4eac-4a9f-83dd-67bc70344d33": {
"asset": 1714966328862,
"meta": 1720605515012,
"meta": 1724814255822,
"relativePath": "resources"
},
"294c1663-4adf-4a1e-a795-53808011a38a": {
"asset": 1714966328862,
"meta": 1720605515464,
"meta": 1724814256190,
"relativePath": "resources\\effects"
},
"73a0903d-d80e-4e3c-aa67-f999543c08f5": {
"asset": 1714966328706,
"meta": 1720605515492,
"meta": 1724814256190,
"relativePath": "image\\default_toggle_checkmark.png"
},
"bbee2217-c261-49bd-a8ce-708d6bcc3500": {
"asset": 1714966328893,
"meta": 1720605515466,
"meta": 1724814256194,
"relativePath": "resources\\materials"
},
"d29077ba-1627-4a72-9579-7b56a235340c": {
"asset": 1714966328706,
"meta": 1720605515506,
"meta": 1724814256194,
"relativePath": "image\\default_toggle_normal.png"
},
"30682f87-9f0d-4f17-8a44-72863791461b": {
"asset": 1714966328831,
"meta": 1720605515505,
"meta": 1724814256222,
"relativePath": "resources\\effects\\builtin-2d-graphics.effect"
},
"144c3297-af63-49e8-b8ef-1cfa29b3be28": {
"asset": 1714966328831,
"meta": 1720605515516,
"meta": 1724814256230,
"relativePath": "resources\\effects\\builtin-2d-gray-sprite.effect"
},
"1f55e3be-b89b-4b79-88de-47fd31018044": {
"asset": 1714966328815,
"meta": 1720605515473,
"meta": 1724814256198,
"relativePath": "prefab\\sprite_splash.prefab"
},
"f18742d7-56d2-4eb5-ae49-2d9d710b37c8": {
"asset": 1714966328831,
"meta": 1720605515528,
"meta": 1724814256239,
"relativePath": "resources\\effects\\builtin-2d-label.effect"
},
"7de03a80-4457-438d-95a7-3e7cdffd6086": {
"asset": 1714966328815,
"meta": 1720605515476,
"meta": 1724814256206,
"relativePath": "prefab\\tiledmap.prefab"
},
"0e93aeaa-0b53-4e40-b8e0-6268b4e07bd7": {
"asset": 1714966328831,
"meta": 1720605515539,
"meta": 1724814256247,
"relativePath": "resources\\effects\\builtin-2d-spine.effect"
},
"2874f8dd-416c-4440-81b7-555975426e93": {
"asset": 1714966328846,
"meta": 1720605515552,
"meta": 1724814256255,
"relativePath": "resources\\effects\\builtin-2d-sprite.effect"
},
"829a282c-b049-4019-bd38-5ace8d8a6417": {
"asset": 1714966328846,
"meta": 1720605515617,
"meta": 1724814256299,
"relativePath": "resources\\effects\\builtin-3d-particle.effect"
},
"2a7c0036-e0b3-4fe1-8998-89a54b8a2bec": {
"asset": 1714966328846,
"meta": 1720605515639,
"meta": 1724814256315,
"relativePath": "resources\\effects\\builtin-3d-trail.effect"
},
"8a96b965-2dc0-4e03-aa90-3b79cb93b5b4": {
"asset": 1714966328752,
"meta": 1720605515468,
"meta": 1724814256202,
"relativePath": "obsolete\\atom.png"
},
"c0040c95-c57f-49cd-9cbc-12316b73d0d4": {
"asset": 1714966328846,
"meta": 1720605515647,
"meta": 1724814256323,
"relativePath": "resources\\effects\\builtin-clear-stencil.effect"
},
"6d91e591-4ce0-465c-809f-610ec95019c6": {
"asset": 1714966328862,
"meta": 1720605515664,
"meta": 1724814256335,
"relativePath": "resources\\effects\\builtin-unlit.effect"
},
"0e42ba95-1fa1-46aa-b2cf-143cd1bcee2c": {
"asset": 1714966328815,
"meta": 1720605515478,
"meta": 1724814256210,
"relativePath": "prefab\\tiledtile.prefab"
},
"0d784963-d024-4ea6-a7db-03be0ad63010": {
"asset": 1714966328815,
"meta": 1720605515481,
"meta": 1724814256206,
"relativePath": "prefab\\toggle.prefab"
},
"bf0a434c-84dd-4a8e-a08a-7a36f180cc75": {
"asset": 1714966328815,
"meta": 1720605515483,
"meta": 1724814256210,
"relativePath": "prefab\\toggleContainer.prefab"
},
"d1b8be49-b0a0-435c-83b7-552bed4bbe35": {
"asset": 1714966328815,
"meta": 1720605515485,
"meta": 1724814256222,
"relativePath": "prefab\\toggleGroup.prefab"
},
"232d2782-c4bd-4bb4-9e01-909f03d6d3b9": {
"asset": 1714966328815,
"meta": 1720605515490,
"meta": 1724814256210,
"relativePath": "prefab\\videoplayer.prefab"
},
"61906da3-7003-4bda-9abc-5769c76faee4": {
"asset": 1714966328783,
"meta": 1720605515682,
"meta": 1724814256351,
"relativePath": "prefab\\light\\ambient.prefab"
},
"8c5001fd-07ee-4a4b-a8a0-63e15195e94d": {
"asset": 1714966328831,
"meta": 1720605515541,
"meta": 1724814256303,
"relativePath": "prefab\\webview.prefab"
},
"d0a82d39-bede-46c4-b698-c81ff0dedfff": {
"asset": 1714966328752,
"meta": 1720605515470,
"meta": 1724814256202,
"relativePath": "particle\\atom.png"
},
"f5331fd2-bf42-4ee3-a3fd-3e1657600eff": {
"asset": 1714966328800,
"meta": 1720605515691,
"meta": 1724814256351,
"relativePath": "prefab\\light\\spot.prefab"
},
"0cf30284-9073-46bc-9eba-e62b69dbbff3": {
"asset": 1714966328800,
"meta": 1720605515687,
"meta": 1724814256347,
"relativePath": "prefab\\light\\point.prefab"
},
"ddb99b39-7004-47cd-9705-751905c43c46": {
"asset": 1714966328800,
"meta": 1720605515686,
"meta": 1724814256351,
"relativePath": "prefab\\light\\directional.prefab"
},
"6f801092-0c37-4f30-89ef-c8d960825b36": {
"asset": 1714966328862,
"meta": 1720605515785,
"meta": 1724814256420,
"relativePath": "resources\\materials\\builtin-2d-base.mtl"
},
"a153945d-2511-4c14-be7b-05d242f47d57": {
"asset": 1714966328862,
"meta": 1720605515784,
"meta": 1724814256420,
"relativePath": "resources\\materials\\builtin-2d-graphics.mtl"
},
"eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432": {
"asset": 1714966328878,
"meta": 1720605515791,
"meta": 1724814256424,
"relativePath": "resources\\materials\\builtin-2d-sprite.mtl"
},
"7afd064b-113f-480e-b793-8817d19f63c3": {
"asset": 1714966328878,
"meta": 1720605515792,
"meta": 1724814256420,
"relativePath": "resources\\materials\\builtin-2d-spine.mtl"
},
"432fa09c-cf03-4cff-a186-982604408a07": {
"asset": 1714966328878,
"meta": 1720605515793,
"meta": 1724814256424,
"relativePath": "resources\\materials\\builtin-3d-particle.mtl"
},
"466d4f9b-e5f4-4ea8-85d5-3c6e9a65658a": {
"asset": 1714966328878,
"meta": 1720605515787,
"meta": 1724814256420,
"relativePath": "resources\\materials\\builtin-3d-trail.mtl"
},
"2a296057-247c-4a1c-bbeb-0548b6c98650": {
"asset": 1714966328893,
"meta": 1720605515789,
"meta": 1724814256424,
"relativePath": "resources\\materials\\builtin-unlit.mtl"
},
"cf7e0bb8-a81c-44a9-ad79-d28d43991032": {
"asset": 1714966328878,
"meta": 1720605515788,
"meta": 1724814256424,
"relativePath": "resources\\materials\\builtin-clear-stencil.mtl"
},
"e02d87d4-e599-4d16-8001-e14891ac6506": {
"asset": 1714966328878,
"meta": 1720605515786,
"meta": 1724814256420,
"relativePath": "resources\\materials\\builtin-2d-label.mtl"
},
"3a7bb79f-32fd-422e-ada2-96f518fed422": {
"asset": 1714966328862,
"meta": 1720605515790,
"meta": 1724814256420,
"relativePath": "resources\\materials\\builtin-2d-gray-sprite.mtl"
},
"b2687ac4-099e-403c-a192-ff477686f4f5": {
"asset": 1714966328752,
"meta": 1720605515817,
"meta": 1724814256446,
"relativePath": "particle\\atom.plist"
},
"b8223619-7e38-47c4-841f-9160c232495a": {
"asset": 1714966328752,
"meta": 1720605515818,
"meta": 1724814256446,
"relativePath": "obsolete\\atom.plist"
},
"954fec8b-cd16-4bb9-a3b7-7719660e7558": {
"asset": 1714966328737,
"meta": 1720605517778,
"meta": 1724814258345,
"relativePath": "model\\primitives.fbx"
},
"e8b23e56-8d10-44ad-a8f0-2e637cc45533": {
@ -731,27 +731,52 @@
},
"bdc76845-baea-4381-911e-af437cccf839": {
"asset": 1720605318016,
"meta": 1720605517848,
"meta": 1723434815945,
"relativePath": "Script\\module\\Share"
},
"7290c680-dfdc-4c59-9736-a614cc2a8bcf": {
"asset": 1720427814120,
"meta": 1720605518270,
"asset": 1724747593286,
"meta": 1724814258892,
"relativePath": "Script\\module\\Share\\share.ts"
},
"b42c4fc1-4cd1-4b12-b206-930cea3d49ca": {
"asset": 1720419330469,
"meta": 1720605518358,
"relativePath": "Script\\module\\Share.zip"
},
"454ad829-851a-40ea-8ab9-941e828357ca": {
"asset": 1720606628700,
"meta": 1720606629712,
"asset": 1720606689492,
"meta": 1722936011378,
"relativePath": "Script\\Load.ts"
},
"c5692be7-8703-45e4-9f67-23b54d290356": {
"asset": 1720606662600,
"meta": 1720606663284,
"asset": 1724814244271,
"meta": 1724814258643,
"relativePath": "Script\\module\\Config\\GameConfig.ts"
},
"ec0a44ff-c813-4573-8b85-268526211437": {
"asset": 1723434789315,
"meta": 1723434815936,
"relativePath": "Script\\Sdk"
},
"8a024faa-e4af-4cae-9c5c-693bee7120c1": {
"asset": 1723104058083,
"meta": 1723434815965,
"relativePath": "Script\\Sdk\\DouyinEntranceView.ts"
},
"0d272a57-5428-450e-a8b9-1574c3d89951": {
"asset": 1723192822148,
"meta": 1723434816030,
"relativePath": "Script\\Sdk\\MiniGameManager.ts"
},
"c1af99dd-ee03-40f7-9609-d3887d0dd357": {
"asset": 1723176553474,
"meta": 1723434816251,
"relativePath": "Script\\Sdk\\MiniGameSdk.ts"
},
"8162ee52-27a1-40fa-b8d8-b05e309020cd": {
"asset": 1724742760071,
"meta": 1724742919602,
"relativePath": "res\\SourceHanSerifCN-Bold.ttf"
},
"ba08509d-1972-42d5-aa39-2bcd83804450": {
"asset": 1724742934631,
"meta": 1724742968972,
"relativePath": "res\\SourceHanSerifCN-Medium.ttf"
}
}

View File

@ -13,13 +13,13 @@
"type": "dock-h",
"children": [
{
"width": 205,
"width": 252,
"height": 556.3333740234375,
"type": "dock-v",
"children": [
{
"width": 205,
"height": 300.1770935058594,
"width": 252,
"height": 300.2708435058594,
"type": "panel",
"active": 0,
"children": [
@ -27,8 +27,8 @@
]
},
{
"width": 205,
"height": 253.15625,
"width": 252,
"height": 253.0625,
"type": "panel",
"active": 0,
"children": [
@ -38,7 +38,7 @@
]
},
{
"width": 750.9896240234375,
"width": 704,
"height": 556.3333740234375,
"type": "panel",
"active": 0,
@ -92,6 +92,12 @@
"y": 0,
"width": 1016,
"height": 672
},
"mini_font": {
"x": 374,
"y": 0,
"width": 516,
"height": 672
}
},
"panelLabelWidth": {}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
global.pluginNodeModulesPath=Editor.url("packages://mini_font/node_modules"),global.pluginDistPath="packages://mini_font/dist";var e=Editor.url("packages://mini_font/libs/fixrequire.js");e&&""!==e&&require(e),Object.defineProperty(exports,"__esModule",{value:!0});var o={open:function(){Editor.Panel.open("mini_font")}};exports.load=function(){},exports.messages=o,exports.unload=function(){};

View File

@ -0,0 +1,61 @@
// 'index.' character codes
if (Editor.remote.App.version === "2.4.5") return;
const pluginDistPath = Editor.url(global.pluginDistPath);
const Module = require.main.constructor;
const NativeModule = process.NativeModule;
const pluginNodeModulesPath = global.pluginNodeModulesPath;
// const panelId
if (!process.mainModule.paths.includes(pluginNodeModulesPath)) {
process.mainModule.paths.push(pluginNodeModulesPath)
}
Module._resolveFilename = function(request, parent, isMain, options) {
if (NativeModule.canBeRequiredByUsers(request)) {
return request;
}
var paths;
if (typeof options === 'object' && options !== null &&
Array.isArray(options.paths)) {
const fakeParent = new Module('', null);
paths = [];
for (var i = 0; i < options.paths.length; i++) {
const path = options.paths[i];
fakeParent.paths = Module._nodeModulePaths(path);
const lookupPaths = Module._resolveLookupPaths(request, fakeParent, true);
for (var j = 0; j < lookupPaths.length; j++) {
if (!paths.includes(lookupPaths[j]))
paths.push(lookupPaths[j]);
}
}
} else {
paths = Module._resolveLookupPaths(request, parent, true);
}
// Look up the filename first, since that's the cache key.
let filename = Module._findPath(request, paths, isMain);
if (!filename) {
//找不到,尝试去插件目录找啊---------
filename = Module._findPath(request, [pluginDistPath], isMain);
if (!filename) {
const requireStack = [];
for (var cursor = parent; cursor; cursor = cursor.parent) {
requireStack.push(cursor.filename || cursor.id);
}
let message = `Cannot find module '${request}'`;
if (requireStack.length > 0) {
message = message + '\nRequire stack:\n- ' + requireStack.join('\n- ');
}
// eslint-disable-next-line no-restricted-syntax
var err = new Error(message);
err.code = 'MODULE_NOT_FOUND';
err.requireStack = requireStack;
throw err;
}
}
return filename;
};

15
packages/字体精简工具/node_modules/.bin/fontmin generated vendored Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../fontmin/cli.js" "$@"
ret=$?
else
node "$basedir/../fontmin/cli.js" "$@"
ret=$?
fi
exit $ret

View File

@ -0,0 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\fontmin\cli.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -0,0 +1,18 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../fontmin/cli.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../fontmin/cli.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
packages/字体精简工具/node_modules/.bin/mkdirp generated vendored Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@"
ret=$?
else
node "$basedir/../mkdirp/bin/cmd.js" "$@"
ret=$?
fi
exit $ret

View File

@ -0,0 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\mkdirp\bin\cmd.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -0,0 +1,18 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../mkdirp/bin/cmd.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
packages/字体精简工具/node_modules/.bin/node-gyp generated vendored Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../node-gyp/bin/node-gyp.js" "$@"
ret=$?
else
node "$basedir/../node-gyp/bin/node-gyp.js" "$@"
ret=$?
fi
exit $ret

View File

@ -0,0 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\node-gyp\bin\node-gyp.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -0,0 +1,18 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../node-gyp/bin/node-gyp.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../node-gyp/bin/node-gyp.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
packages/字体精简工具/node_modules/.bin/nopt generated vendored Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../nopt/bin/nopt.js" "$@"
ret=$?
else
node "$basedir/../nopt/bin/nopt.js" "$@"
ret=$?
fi
exit $ret

17
packages/字体精简工具/node_modules/.bin/nopt.cmd generated vendored Normal file
View File

@ -0,0 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\nopt\bin\nopt.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

18
packages/字体精简工具/node_modules/.bin/nopt.ps1 generated vendored Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../nopt/bin/nopt.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../nopt/bin/nopt.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
packages/字体精简工具/node_modules/.bin/rimraf generated vendored Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../rimraf/bin.js" "$@"
ret=$?
else
node "$basedir/../rimraf/bin.js" "$@"
ret=$?
fi
exit $ret

View File

@ -0,0 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\rimraf\bin.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -0,0 +1,18 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../rimraf/bin.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
packages/字体精简工具/node_modules/.bin/semver generated vendored Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../semver/bin/semver" "$@"
ret=$?
else
node "$basedir/../semver/bin/semver" "$@"
ret=$?
fi
exit $ret

View File

@ -0,0 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\semver\bin\semver" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -0,0 +1,18 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../semver/bin/semver" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../semver/bin/semver" $args
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../sshpk/bin/sshpk-conv" "$@"
ret=$?
else
node "$basedir/../sshpk/bin/sshpk-conv" "$@"
ret=$?
fi
exit $ret

View File

@ -0,0 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\sshpk\bin\sshpk-conv" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -0,0 +1,18 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-conv" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../sshpk/bin/sshpk-conv" $args
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../sshpk/bin/sshpk-sign" "$@"
ret=$?
else
node "$basedir/../sshpk/bin/sshpk-sign" "$@"
ret=$?
fi
exit $ret

View File

@ -0,0 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\sshpk\bin\sshpk-sign" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -0,0 +1,18 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-sign" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../sshpk/bin/sshpk-sign" $args
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../sshpk/bin/sshpk-verify" "$@"
ret=$?
else
node "$basedir/../sshpk/bin/sshpk-verify" "$@"
ret=$?
fi
exit $ret

View File

@ -0,0 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\sshpk\bin\sshpk-verify" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -0,0 +1,18 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../sshpk/bin/sshpk-verify" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../sshpk/bin/sshpk-verify" $args
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../strip-indent/cli.js" "$@"
ret=$?
else
node "$basedir/../strip-indent/cli.js" "$@"
ret=$?
fi
exit $ret

View File

@ -0,0 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\strip-indent\cli.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -0,0 +1,18 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../strip-indent/cli.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../strip-indent/cli.js" $args
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../ttf2woff2/bin/ttf2woff2.js" "$@"
ret=$?
else
node "$basedir/../ttf2woff2/bin/ttf2woff2.js" "$@"
ret=$?
fi
exit $ret

View File

@ -0,0 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\ttf2woff2\bin\ttf2woff2.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -0,0 +1,18 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../ttf2woff2/bin/ttf2woff2.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../ttf2woff2/bin/ttf2woff2.js" $args
$ret=$LASTEXITCODE
}
exit $ret

15
packages/字体精简工具/node_modules/.bin/which generated vendored Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../which/bin/which" "$@"
ret=$?
else
node "$basedir/../which/bin/which" "$@"
ret=$?
fi
exit $ret

View File

@ -0,0 +1,17 @@
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\which\bin\which" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b

View File

@ -0,0 +1,18 @@
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../which/bin/which" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../which/bin/which" $args
$ret=$LASTEXITCODE
}
exit $ret

View File

@ -0,0 +1,140 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.2.4](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.2.3...@ailhc/egf-core@1.2.4) (2021-05-15)
### Bug Fixes
* 修复iife规范的.d.ts声明错误 ([5deed01](https://github.com/AILHC/EasyGameFrameworkOpen/commit/5deed01795ca4abab2bbafbb7b55664d4d23be8f))
## [1.2.3](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.2.2...@ailhc/egf-core@1.2.3) (2021-05-09)
**Note:** Version bump only for package @ailhc/egf-core
## [1.2.2](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.2.1...@ailhc/egf-core@1.2.2) (2021-04-23)
### Bug Fixes
* 重新导出,修复声明识别错误的问题 ([4139c9e](https://github.com/AILHC/EasyGameFrameworkOpen/commit/4139c9ece90ef11d12374a42065bf89ebe44d053))
## [1.2.1](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.2.0...@ailhc/egf-core@1.2.1) (2021-03-31)
### Bug Fixes
* 修复package.json的exports字段,这会导致cocoscreator2.4.5import报错 ([6c22d71](https://github.com/AILHC/EasyGameFrameworkOpen/commit/6c22d71f6f32ec566b95e7b299ec91e732e99585))
# [1.2.0](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.1.4...@ailhc/egf-core@1.2.0) (2021-03-27)
### Features
* 多入口编译支持 ([fb7a70f](https://github.com/AILHC/EasyGameFrameworkOpen/commit/fb7a70f11d77ede4938b72931e9aac63b059e500))
## [1.1.4](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.1.3...@ailhc/egf-core@1.1.4) (2021-02-21)
### Bug Fixes
* 修复构建出iife规范的bug ([dc435c8](https://github.com/AILHC/EasyGameFrameworkOpen/commit/dc435c8ed264447b8a80263e7d157b1576c414b3))
## [1.1.3](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.1.2...@ailhc/egf-core@1.1.3) (2021-02-18)
**Note:** Version bump only for package @ailhc/egf-core
## [1.1.2](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.1.1...@ailhc/egf-core@1.1.2) (2021-02-15)
### Bug Fixes
* 修复状态切换bug setState 增加切换状态判断 ([52cd947](https://github.com/AILHC/EasyGameFrameworkOpen/commit/52cd947c6532cb811ec6fc9ac8cbd449b079e580))
## [1.1.1](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.1.0...@ailhc/egf-core@1.1.1) (2021-02-15)
**Note:** Version bump only for package @ailhc/egf-core
# [1.1.0](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.0.1...@ailhc/egf-core@1.1.0) (2021-02-07)
### Features
* 同时支持CommonJs和ES Modules ([409a819](https://github.com/AILHC/EasyGameFrameworkOpen/commit/409a819cfca6808a4070abcbc8acc80a2caf1c84))
## [1.0.1](https://github.com/AILHC/EasyGameFrameworkOpen/compare/@ailhc/egf-core@1.0.0...@ailhc/egf-core@1.0.1) (2021-02-07)
**Note:** Version bump only for package @ailhc/egf-core
# 1.0.0 (2021-01-27)
1. 去掉proxy
# 0.1.6 (2020-12-02)
1. 修改类型声明使getModule也能有更好的类型提示
# 0.1.5 (2020-11-25)
更新iife的声明文件
删除多余的声明文件
# 0.1.4 (2020-11-25)
重新发布更新github地址
# 0.1.3 (2020-11-25)
重新发布,更新声明文件
# 0.1.2 (2020-10-07)
移除加载子程序的逻辑,整理声明文件
# 0.0.1 (2020-10-07)
完善iife格式的声明文件
# 0.0.1 (2020-10-07)
第一次发布

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 AILHC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,119 @@
# `@ailhc/egf-core`
## 简介
EasyGameFramework 的核心模块用于H5游戏/应用程序的渐进式模块化开发
EasyGameFramework core module for progressive modular development of H5 games/applications
## 特性
1. 模块注册、初始化管理机制
2. 智能提示
## Demo
1. [CocosCreator2.4.2 模板](https://github.com/AILHC/egf-ccc-empty)
2. [CocosCreator3D 1.2 模板](https://github.com/AILHC/egf-ccc3d-empty) (ps:使用systemjs+插件模式使用)
3. [CocosCreator3.0 模板](https://github.com/AILHC/egf-ccc3-empty) (ps:使用npm方式使用)
4. [Egret 5.3 支持npm的模板](https://github.com/AILHC/egf-egret-empty)
5. [Laya 2.7.1 支持npm的模板](https://github.com/AILHC/egf-laya-empty)
## 使用
0. 安装
通过npm安装
npm install @ailhc/egf-core
如果支持使用npm模块则 通过导入npm模块的方式
```ts
import { App } from "@ailhc/egf-core"
```
如果不支持则使用dist下的iife格式声明文件则需要自己整理一下
或者直接复制src下的源码
1. 基础使用
```ts
export class XXXLoader implements egf.IBootLoader {
onBoot(app: egf.IApp, bootEnd: egf.BootEndCallback): void {
app.loadModule(moduleIns,"moduleName");
bootEnd(true);
}
}
import { App } from "@ailhc/egf-core"
const app = new App();
//启动
app.bootstrap([new XXXLoader()]);
//初始化
app.init();
```
2. 智能提示和接口提示
```ts
//智能提示的基础,可以在任意模块文件里进行声明比如
//ModuleA.ts
declare global {
interface IModuleMap {
moduleAName :IXXXModuleA
}
}
//ModuleB.ts
declare global {
interface IModuleMap {
moduleBName :IXXXModuleB
}
}
const app = new App<IModuleMap>();
//在运行时也可调用,这里的moduleIns可以是任意实例moduleName可以有智能提示
app.loadModule(moduleIns,"moduleName");
```
3. 全局模块调用
```ts
// 可以将模块实例的字典赋值给全局的对象,比如
//setModuleMap.ts
export let m: IModuleMap;
export function setModuleMap(moduleMap: IModuleMap) {
m = moduleMap;
}
//AppMain.ts
import { setModuleMap, m } from "./ModuleMap";
setModuleMap(app.moduleMap);
//在别的逻辑里可以通过
import { m } from "./ModuleMap";
//调用模块逻辑
m.moduleA.doSometing()
```
## [CHANGELOG](packages/core/CHANGELOG.md)
## 我在哪?
**游戏开发之路有趣但不易,**
**玩起来才能一直热情洋溢。**
关注我, 一起玩转游戏开发!
你的关注是我持续更新的动力~
让我们在这游戏开发的道路上并肩前行
在以下这些渠道可以找到我和我的创作:
公众号搜索:玩转游戏开发
或扫码:<img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/abd0c14c9c954e56af20adb71fa00da9~tplv-k3u1fbpfcp-zoom-1.image" alt="img" style="zoom:50%;" />
一起讨论技术的 QQ 群: 1103157878
博客主页: https://pgd.vercel.app/
掘金: https://juejin.cn/user/3069492195769469
github: https://github.com/AILHC

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,16 @@
"use strict";function t(t,e){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){s.label=i[1];break}if(6===i[0]&&s.label<r[1]){s.label=r[1],r=i;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(i);break}r[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){function e(){this._state=0,this._moduleMap={}}return Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"moduleMap",{get:function(){return this._moduleMap},enumerable:!1,configurable:!0}),e.prototype.bootstrap=function(n){return o=this,r=void 0,s=function(){var o,r,i,s,a=this;return t(this,(function(t){switch(t.label){case 0:if(this.setState(e.BOOTING),!n||n.length<=0)return this.setState(e.BOOTEND),[2,!0];if(!(n&&n.length>0))return[3,4];for(o=[],r=function(t){var e=n[t];o.push(new Promise((function(t,n){e.onBoot(a,(function(e){e?t():n()}))})))},i=0;i<n.length;i++)r(i);t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return t.sent(),this.setState(e.BOOTEND),[2,!0];case 3:return s=t.sent(),console.error(s),this.setState(e.BOOTEND),[2,!1];case 4:return[2]}}))},new((i=void 0)||(i=Promise))((function(t,e){function n(t){try{u(s.next(t))}catch(t){e(t)}}function a(t){try{u(s.throw(t))}catch(t){e(t)}}function u(e){e.done?t(e.value):new i((function(t){t(e.value)})).then(n,a)}u((s=s.apply(o,r||[])).next())}));
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var o,r,i,s},e.prototype.init=function(){var t,n=this._moduleMap;if(this.state!==e.RUNING){for(var o in n)(t=n[o]).onInit&&t.onInit(this);for(var o in n)(t=n[o]).onAfterInit&&t.onAfterInit(this);this.setState(e.RUNING)}},e.prototype.loadModule=function(t,n){if(this._state===e.STOP)return!1;var o=!1;return n||(n=t.key),n&&"string"==typeof n?t?this._moduleMap[n]?this._log("\u52a0\u8f7d\u6a21\u5757:\u6a21\u5757:"+n+"\u5df2\u7ecf\u5b58\u5728,\u4e0d\u91cd\u590d\u52a0\u8f7d"):(this._moduleMap[n]=t,o=!0,this._state===e.RUNING&&(t.onInit&&t.onInit(this),t.onAfterInit&&t.onAfterInit())):this._log("\u52a0\u8f7d\u6a21\u5757:\u6a21\u5757:"+n+"\u5b9e\u4f8b\u4e3a\u7a7a"):this._log("\u52a0\u8f7d\u6a21\u5757:\u6a21\u5757key\u4e3a\u7a7a"),o},e.prototype.hasModule=function(t){return!!this._moduleMap[t]},e.prototype.stop=function(){var t,n=this._moduleMap;for(var o in this.setState(e.STOP),n)(t=n[o]).onStop&&t.onStop()},e.prototype.getModule=function(t){return this._moduleMap[t]},e.prototype.setState=function(t){!isNaN(this._state)&&this._state>=t||(this._state=t)},e.prototype._log=function(t,e){switch(e){case 1:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;case 2:console.error("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;default:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t)}},e.UN_RUN=0,e.BOOTING=1,e.BOOTEND=2,e.RUNING=3,e.STOP=4,e}();exports.App=e;

View File

@ -0,0 +1,111 @@
declare module '@ailhc/egf-core' {
export class App<ModuleMap = any> implements egf.IApp<ModuleMap> {
static readonly UN_RUN: number;
static readonly BOOTING: number;
static readonly BOOTEND: number;
static readonly RUNING: number;
static readonly STOP: number;
protected _state: number;
protected _moduleMap: {
[key: string]: egf.IModule;
};
get state(): number;
get moduleMap(): ModuleMap;
bootstrap(bootLoaders?: egf.IBootLoader[]): Promise<boolean>;
init(): void;
loadModule(moduleIns: any | egf.IModule, key?: keyof ModuleMap): boolean;
hasModule(moduleKey: keyof ModuleMap): boolean;
stop(): void;
getModule<K extends keyof ModuleMap>(moduleKey: K): ModuleMap[K];
protected setState(state: number): void;
/**
*
* @param level 1 warn 2 error
* @param msg
*/
protected _log(msg: string, level?: number): void;
}
}
declare module '@ailhc/egf-core' {
global {
namespace egf {
interface IModule {
/**模块名 */
key?: string;
/**
*
*/
onInit?(app: IApp): void;
/**
*
*/
onAfterInit?(app: IApp): void;
/**
*
*/
onStop?(): void;
}
type BootEndCallback = (isSuccess: boolean) => void;
/**
*
*/
interface IBootLoader {
/**
*
* @param app
*/
onBoot(app: IApp, bootEnd: BootEndCallback): void;
}
/**
*
*/
interface IApp<ModuleMap = any> {
/**
*
* 0 1 , 2 , 3
*/
state: number;
/**
*
*/
moduleMap: ModuleMap;
/**
*
* @param bootLoaders
*/
bootstrap(bootLoaders: egf.IBootLoader[]): Promise<boolean>;
/**
*
*/
init(): void;
/**
*
* @param module
*/
loadModule(module: IModule | any, key?: keyof ModuleMap): void;
/**
*
*/
stop(): void;
/**
*
* @param moduleKey
*/
getModule<K extends keyof ModuleMap>(moduleKey: K): ModuleMap[K];
/**
*
* @param moduleKey
*/
hasModule(moduleKey: keyof ModuleMap): boolean;
}
}
}
export {};
}
declare module '@ailhc/egf-core' {
export * from '@ailhc/egf-core';
export * from '@ailhc/egf-core';
}

View File

@ -0,0 +1,15 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function t(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var e=function(){function e(){this._state=0,this._moduleMap={}}return Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"moduleMap",{get:function(){return this._moduleMap},enumerable:!1,configurable:!0}),e.prototype.bootstrap=function(n){return o=this,r=void 0,a=function(){var o,r,i,a,s=this;return t(this,(function(t){switch(t.label){case 0:if(this.setState(e.BOOTING),!n||n.length<=0)return this.setState(e.BOOTEND),[2,!0];if(!(n&&n.length>0))return[3,4];for(o=[],r=function(t){var e=n[t];o.push(new Promise((function(t,n){e.onBoot(s,(function(e){e?t():n()}))})))},i=0;i<n.length;i++)r(i);t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return t.sent(),this.setState(e.BOOTEND),[2,!0];case 3:return a=t.sent(),console.error(a),this.setState(e.BOOTEND),[2,!1];case 4:return[2]}}))},new((i=void 0)||(i=Promise))((function(t,e){function n(t){try{u(a.next(t))}catch(t){e(t)}}function s(t){try{u(a.throw(t))}catch(t){e(t)}}function u(e){e.done?t(e.value):new i((function(t){t(e.value)})).then(n,s)}u((a=a.apply(o,r||[])).next())}));var o,r,i,a},e.prototype.init=function(){var t,n=this._moduleMap;if(this.state!==e.RUNING){for(var o in n)(t=n[o]).onInit&&t.onInit(this);for(var o in n)(t=n[o]).onAfterInit&&t.onAfterInit(this);this.setState(e.RUNING)}},e.prototype.loadModule=function(t,n){if(this._state===e.STOP)return!1;var o=!1;return n||(n=t.key),n&&"string"==typeof n?t?this._moduleMap[n]?this._log("\u52a0\u8f7d\u6a21\u5757:\u6a21\u5757:"+n+"\u5df2\u7ecf\u5b58\u5728,\u4e0d\u91cd\u590d\u52a0\u8f7d"):(this._moduleMap[n]=t,o=!0,this._state===e.RUNING&&(t.onInit&&t.onInit(this),t.onAfterInit&&t.onAfterInit())):this._log("\u52a0\u8f7d\u6a21\u5757:\u6a21\u5757:"+n+"\u5b9e\u4f8b\u4e3a\u7a7a"):this._log("\u52a0\u8f7d\u6a21\u5757:\u6a21\u5757key\u4e3a\u7a7a"),o},e.prototype.hasModule=function(t){return!!this._moduleMap[t]},e.prototype.stop=function(){var t,n=this._moduleMap;for(var o in this.setState(e.STOP),n)(t=n[o]).onStop&&t.onStop()},e.prototype.getModule=function(t){return this._moduleMap[t]},e.prototype.setState=function(t){!isNaN(this._state)&&this._state>=t||(this._state=t)},e.prototype._log=function(t,e){switch(e){case 1:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;case 2:console.error("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t);break;default:console.warn("\u3010\u4e3b\u7a0b\u5e8f\u3011"+t)}},e.UN_RUN=0,e.BOOTING=1,e.BOOTEND=2,e.RUNING=3,e.STOP=4,e}();export{e as App};

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More