init
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 146 KiB |
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "e281b3a8-afd6-4850-8742-07d84d1be980",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
@@ -0,0 +1,361 @@
|
||||
{
|
||||
"__version__": "1.3.8",
|
||||
"log": {
|
||||
"level": 4
|
||||
},
|
||||
"common": {
|
||||
"polyfills": {
|
||||
"asyncFunctions": true
|
||||
},
|
||||
"buildPath": "project://build",
|
||||
"outputName": "wechatgame_kuai",
|
||||
"mainBundleCompressionType": "merge_dep",
|
||||
"platform": "wechatgame",
|
||||
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
|
||||
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.wx.1.0.8",
|
||||
"nativeCodeBundleMode": "asmjs",
|
||||
"md5Cache": true,
|
||||
"name": "XiangQin"
|
||||
},
|
||||
"BuildTaskManager": {
|
||||
"taskMap": {
|
||||
"1736231456475": {
|
||||
"type": "build",
|
||||
"id": "1736231456475",
|
||||
"progress": 1,
|
||||
"state": "success",
|
||||
"stage": "build",
|
||||
"message": "2025-5-17 10:25:26 build success in 16 s!",
|
||||
"detailMessage": "builder:build-project-total (15904ms)\r",
|
||||
"options": {
|
||||
"name": "XiangQin",
|
||||
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.wx.1.0.8",
|
||||
"platform": "wechatgame",
|
||||
"buildPath": "project://build",
|
||||
"debug": false,
|
||||
"md5Cache": true,
|
||||
"skipCompressTexture": false,
|
||||
"sourceMaps": false,
|
||||
"overwriteProjectSettings": {
|
||||
"macroConfig": {
|
||||
"cleanupImageCache": "on"
|
||||
},
|
||||
"includeModules": {
|
||||
"physics": "inherit-project-setting",
|
||||
"physics-2d": "inherit-project-setting",
|
||||
"gfx-webgl2": "off"
|
||||
}
|
||||
},
|
||||
"nativeCodeBundleMode": "asmjs",
|
||||
"polyfills": {
|
||||
"asyncFunctions": false
|
||||
},
|
||||
"experimentalEraseModules": false,
|
||||
"startSceneAssetBundle": false,
|
||||
"bundleConfigs": [],
|
||||
"useBuiltinServer": false,
|
||||
"md5CacheOptions": {
|
||||
"excludes": [],
|
||||
"includes": [],
|
||||
"replaceOnly": [],
|
||||
"handleTemplateMd5Link": true
|
||||
},
|
||||
"mainBundleIsRemote": false,
|
||||
"mainBundleCompressionType": "merge_dep",
|
||||
"useSplashScreen": true,
|
||||
"bundleCommonChunk": false,
|
||||
"packAutoAtlas": true,
|
||||
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
|
||||
"outputName": "wechatgame",
|
||||
"taskName": "wechatgame",
|
||||
"scenes": [
|
||||
{
|
||||
"url": "db://assets/Scenes/MainScene.scene",
|
||||
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
|
||||
},
|
||||
{
|
||||
"url": "db://assets/Scenes/PreloadScene.scene",
|
||||
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
|
||||
}
|
||||
],
|
||||
"wasmCompressionMode": false,
|
||||
"packages": {},
|
||||
"__version__": "1.3.8",
|
||||
"logDest": "project://temp/builder/log/wechatgame2025-1-7 14-30.log"
|
||||
},
|
||||
"time": "2025-5-17 10:25:09",
|
||||
"dirty": false
|
||||
},
|
||||
"1736573831185": {
|
||||
"type": "build",
|
||||
"id": "1736573831185",
|
||||
"progress": 1,
|
||||
"state": "success",
|
||||
"stage": "build",
|
||||
"message": "2025-5-17 10:39:11 build success in 15 s!",
|
||||
"detailMessage": "// ---- build task cocos-service:onAfterCompressSettings ----\r",
|
||||
"options": {
|
||||
"name": "XiangQin",
|
||||
"server": "",
|
||||
"platform": "web-mobile",
|
||||
"buildPath": "project://build",
|
||||
"debug": false,
|
||||
"md5Cache": false,
|
||||
"skipCompressTexture": false,
|
||||
"sourceMaps": false,
|
||||
"overwriteProjectSettings": {
|
||||
"includeModules": {
|
||||
"gfx-webgl2": "on",
|
||||
"physics": "inherit-project-setting",
|
||||
"physics-2d": "inherit-project-setting"
|
||||
},
|
||||
"macroConfig": {
|
||||
"cleanupImageCache": "inherit-project-setting"
|
||||
}
|
||||
},
|
||||
"nativeCodeBundleMode": "both",
|
||||
"polyfills": {
|
||||
"asyncFunctions": true
|
||||
},
|
||||
"experimentalEraseModules": false,
|
||||
"startSceneAssetBundle": false,
|
||||
"bundleConfigs": [],
|
||||
"useBuiltinServer": false,
|
||||
"md5CacheOptions": {
|
||||
"excludes": [],
|
||||
"includes": [],
|
||||
"replaceOnly": [],
|
||||
"handleTemplateMd5Link": true
|
||||
},
|
||||
"mainBundleIsRemote": false,
|
||||
"mainBundleCompressionType": "merge_dep",
|
||||
"useSplashScreen": true,
|
||||
"bundleCommonChunk": false,
|
||||
"packAutoAtlas": true,
|
||||
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
|
||||
"outputName": "web-mobile",
|
||||
"taskName": "web-mobile",
|
||||
"scenes": [
|
||||
{
|
||||
"url": "db://assets/Scenes/MainScene.scene",
|
||||
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
|
||||
},
|
||||
{
|
||||
"url": "db://assets/Scenes/PreloadScene.scene",
|
||||
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
|
||||
}
|
||||
],
|
||||
"wasmCompressionMode": false,
|
||||
"packages": {},
|
||||
"__version__": "1.3.8",
|
||||
"buildMode": "normal",
|
||||
"logDest": "project://temp/builder/log/web-mobile2025-1-11 13-37.log"
|
||||
},
|
||||
"time": "2025-5-17 10:38:56",
|
||||
"dirty": false
|
||||
},
|
||||
"1736821502634": {
|
||||
"type": "build",
|
||||
"id": "1736821502634",
|
||||
"progress": 1,
|
||||
"state": "success",
|
||||
"stage": "build",
|
||||
"message": "2025-2-7 09:01:29 build success in 13 s!",
|
||||
"detailMessage": "// ---- build task cocos-service:onAfterCompressSettings ----\r",
|
||||
"options": {
|
||||
"name": "XiangQin",
|
||||
"server": "",
|
||||
"platform": "web-mobile",
|
||||
"buildPath": "project://build",
|
||||
"debug": false,
|
||||
"md5Cache": false,
|
||||
"skipCompressTexture": false,
|
||||
"sourceMaps": false,
|
||||
"overwriteProjectSettings": {
|
||||
"includeModules": {
|
||||
"gfx-webgl2": "on",
|
||||
"physics": "inherit-project-setting",
|
||||
"physics-2d": "inherit-project-setting"
|
||||
},
|
||||
"macroConfig": {
|
||||
"cleanupImageCache": "inherit-project-setting"
|
||||
}
|
||||
},
|
||||
"nativeCodeBundleMode": "both",
|
||||
"polyfills": {
|
||||
"asyncFunctions": true
|
||||
},
|
||||
"experimentalEraseModules": false,
|
||||
"startSceneAssetBundle": false,
|
||||
"bundleConfigs": [],
|
||||
"useBuiltinServer": false,
|
||||
"md5CacheOptions": {
|
||||
"excludes": [],
|
||||
"includes": [],
|
||||
"replaceOnly": [],
|
||||
"handleTemplateMd5Link": true
|
||||
},
|
||||
"mainBundleIsRemote": false,
|
||||
"mainBundleCompressionType": "merge_dep",
|
||||
"useSplashScreen": true,
|
||||
"bundleCommonChunk": false,
|
||||
"packAutoAtlas": true,
|
||||
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
|
||||
"outputName": "web-mobile-console",
|
||||
"taskName": "web-mobile-console",
|
||||
"scenes": [
|
||||
{
|
||||
"url": "db://assets/Scenes/MainScene.scene",
|
||||
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
|
||||
},
|
||||
{
|
||||
"url": "db://assets/Scenes/PreloadScene.scene",
|
||||
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
|
||||
}
|
||||
],
|
||||
"wasmCompressionMode": false,
|
||||
"packages": {},
|
||||
"__version__": "1.3.8",
|
||||
"buildMode": "normal",
|
||||
"logDest": "project://temp/builder/log/web-mobile2025-1-14 10-25.log"
|
||||
},
|
||||
"time": "2025-2-7 09:01:15",
|
||||
"dirty": false
|
||||
},
|
||||
"1736838627770": {
|
||||
"type": "build",
|
||||
"id": "1736838627770",
|
||||
"progress": 1,
|
||||
"state": "success",
|
||||
"stage": "build",
|
||||
"message": "2025-2-28 10:45:42 build success in 22 s!",
|
||||
"detailMessage": "builder:build-project-total (22353ms)\r",
|
||||
"options": {
|
||||
"name": "XiangQin",
|
||||
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.bd.1.0.0",
|
||||
"platform": "bytedance-mini-game",
|
||||
"buildPath": "project://build",
|
||||
"debug": false,
|
||||
"md5Cache": false,
|
||||
"skipCompressTexture": false,
|
||||
"sourceMaps": false,
|
||||
"overwriteProjectSettings": {
|
||||
"macroConfig": {
|
||||
"cleanupImageCache": "inherit-project-setting"
|
||||
},
|
||||
"includeModules": {
|
||||
"physics": "inherit-project-setting",
|
||||
"physics-2d": "inherit-project-setting",
|
||||
"gfx-webgl2": "off"
|
||||
}
|
||||
},
|
||||
"nativeCodeBundleMode": "both",
|
||||
"polyfills": {
|
||||
"asyncFunctions": false
|
||||
},
|
||||
"experimentalEraseModules": false,
|
||||
"startSceneAssetBundle": false,
|
||||
"bundleConfigs": [],
|
||||
"useBuiltinServer": false,
|
||||
"md5CacheOptions": {
|
||||
"excludes": [],
|
||||
"includes": [],
|
||||
"replaceOnly": [],
|
||||
"handleTemplateMd5Link": true
|
||||
},
|
||||
"mainBundleIsRemote": false,
|
||||
"mainBundleCompressionType": "merge_dep",
|
||||
"useSplashScreen": true,
|
||||
"bundleCommonChunk": false,
|
||||
"packAutoAtlas": true,
|
||||
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
|
||||
"outputName": "bytedance-mini-game",
|
||||
"taskName": "bytedance-mini-game",
|
||||
"scenes": [
|
||||
{
|
||||
"url": "db://assets/Scenes/MainScene.scene",
|
||||
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
|
||||
},
|
||||
{
|
||||
"url": "db://assets/Scenes/PreloadScene.scene",
|
||||
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
|
||||
}
|
||||
],
|
||||
"wasmCompressionMode": false,
|
||||
"packages": {},
|
||||
"__version__": "1.3.8",
|
||||
"logDest": "project://temp/builder/log/bytedance-mini-game2025-1-14 15-10.log"
|
||||
},
|
||||
"time": "2025-2-28 10:45:19",
|
||||
"dirty": false
|
||||
},
|
||||
"1736905523241": {
|
||||
"type": "build",
|
||||
"id": "1736905523241",
|
||||
"progress": 1,
|
||||
"state": "success",
|
||||
"stage": "build",
|
||||
"message": "2025-5-6 10:19:35 build success in 24 s!",
|
||||
"detailMessage": "builder:build-project-total (23982ms)\r",
|
||||
"options": {
|
||||
"name": "XiangQin",
|
||||
"server": "https://hxzgame.vip.hnhxzkj.com/lzx/XiangQin/remFile.ks.1.0.7",
|
||||
"platform": "wechatgame",
|
||||
"buildPath": "project://build",
|
||||
"debug": false,
|
||||
"md5Cache": true,
|
||||
"skipCompressTexture": false,
|
||||
"sourceMaps": false,
|
||||
"overwriteProjectSettings": {
|
||||
"macroConfig": {
|
||||
"cleanupImageCache": "on"
|
||||
},
|
||||
"includeModules": {
|
||||
"physics": "inherit-project-setting",
|
||||
"physics-2d": "inherit-project-setting",
|
||||
"gfx-webgl2": "off"
|
||||
}
|
||||
},
|
||||
"nativeCodeBundleMode": "asmjs",
|
||||
"polyfills": {
|
||||
"asyncFunctions": false
|
||||
},
|
||||
"experimentalEraseModules": false,
|
||||
"startSceneAssetBundle": false,
|
||||
"bundleConfigs": [],
|
||||
"useBuiltinServer": false,
|
||||
"md5CacheOptions": {
|
||||
"excludes": [],
|
||||
"includes": [],
|
||||
"replaceOnly": [],
|
||||
"handleTemplateMd5Link": true
|
||||
},
|
||||
"mainBundleIsRemote": false,
|
||||
"mainBundleCompressionType": "merge_dep",
|
||||
"useSplashScreen": true,
|
||||
"bundleCommonChunk": false,
|
||||
"packAutoAtlas": true,
|
||||
"startScene": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4",
|
||||
"outputName": "wechatgame_kuai",
|
||||
"taskName": "wechatgame_kuai",
|
||||
"scenes": [
|
||||
{
|
||||
"url": "db://assets/Scenes/MainScene.scene",
|
||||
"uuid": "1a23cd3e-e487-4fd1-a415-346c2087464d"
|
||||
},
|
||||
{
|
||||
"url": "db://assets/Scenes/PreloadScene.scene",
|
||||
"uuid": "16b0d021-6436-4bbc-ba5e-05ebe3e84ba4"
|
||||
}
|
||||
],
|
||||
"wasmCompressionMode": false,
|
||||
"packages": {},
|
||||
"__version__": "1.3.8",
|
||||
"logDest": "project://temp/builder/log/wechatgame2025-1-15 09-45.log"
|
||||
},
|
||||
"time": "2025-5-6 10:19:10",
|
||||
"dirty": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,315 @@
|
||||
import { _decorator, Component, sys, utils } from "cc";
|
||||
import Utils from "../Common/Utils";
|
||||
import { WXSDK } from "./wxSDK";
|
||||
import { ByteDanceSDK } from "./bdSDK";
|
||||
import { WebSDK } from "./webSDK";
|
||||
import { KSSDK } from "./ksSDK";
|
||||
import AudioManager from "../Manager/AudioManager";
|
||||
import GlobalValue, { VideoRoleType } from "../Common/GlobalValue";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/**运行渠道 */
|
||||
export enum E_SDK_Channel {
|
||||
/**微信 */
|
||||
WX,
|
||||
/**字节跳动 (抖音、头条) */
|
||||
BD,
|
||||
/**网页 */
|
||||
WEB,
|
||||
/**快手 */
|
||||
KS,
|
||||
}
|
||||
|
||||
/**玩家SDK信息 */
|
||||
export interface I_SDK_UserInfo {
|
||||
/**昵称 */
|
||||
nickName: string;
|
||||
/**头像url */
|
||||
avatarUrl: string;
|
||||
}
|
||||
|
||||
/**玩家SDK信息回调 */
|
||||
export interface I_SDK_UserInfo_Callback {
|
||||
(info: I_SDK_UserInfo): void;
|
||||
}
|
||||
|
||||
//渠道管理器
|
||||
@ccclass('SDKManager')
|
||||
export class SDKManager { //extends Component
|
||||
private static _I: SDKManager = null;
|
||||
public static get I(): SDKManager {
|
||||
if (!SDKManager._I) {
|
||||
SDKManager._I = new SDKManager();
|
||||
SDKManager._I.init();
|
||||
}
|
||||
return SDKManager._I;
|
||||
}
|
||||
|
||||
private init(){
|
||||
}
|
||||
initEmpty(){
|
||||
}
|
||||
|
||||
//玩家头像
|
||||
private static _avatarUrl: string = "";
|
||||
public static get avatarUrl(): string {
|
||||
return SDKManager._avatarUrl;
|
||||
}
|
||||
public static set avatarUrl(value: string) {
|
||||
if (value == null) {
|
||||
value = "";
|
||||
}
|
||||
SDKManager._avatarUrl = value;
|
||||
}
|
||||
|
||||
//玩家昵称
|
||||
private static _nickName: string = "";
|
||||
public static get nickName(): string {
|
||||
return SDKManager._nickName;
|
||||
}
|
||||
public static set nickName(value: string) {
|
||||
if (value == null) {
|
||||
value = "游客";
|
||||
}
|
||||
SDKManager._nickName = value;
|
||||
}
|
||||
|
||||
private static sdk_channel:E_SDK_Channel = E_SDK_Channel.WEB //当前SDK渠道
|
||||
private static video_reward_map:any
|
||||
private static share_reward_map:any
|
||||
private static sdk:any
|
||||
|
||||
//初始化SDK
|
||||
static init(cb: Function = null) {
|
||||
this.video_reward_map = {}
|
||||
this.share_reward_map = {}
|
||||
|
||||
console.log("平台值 wx:",window["wx"], typeof window["wx"])
|
||||
console.log("平台值 ks:",window["ks"], typeof window["ks"])
|
||||
console.log("平台值 tt:",window["tt"], typeof window["tt"])
|
||||
|
||||
if (typeof window["ks"] !== 'undefined') {
|
||||
this.sdk_channel = E_SDK_Channel.KS
|
||||
this.sdk = new KSSDK() //快手
|
||||
}else if (sys.platform === sys.Platform.WECHAT_GAME && typeof window["wx"] !== 'undefined') {
|
||||
this.sdk_channel = E_SDK_Channel.WX
|
||||
this.sdk = new WXSDK() //微信
|
||||
} else if (sys.platform === sys.Platform.BYTEDANCE_MINI_GAME && typeof window["tt"] !== 'undefined') {
|
||||
this.sdk_channel = E_SDK_Channel.BD
|
||||
this.sdk = new ByteDanceSDK() //抖音(头条)
|
||||
} else {
|
||||
this.sdk_channel = E_SDK_Channel.WEB
|
||||
this.sdk = new WebSDK()
|
||||
}
|
||||
|
||||
console.log("当前平台:",sys.platform, this.sdk_channel)
|
||||
if (GlobalValue.NpcVideoMod) {
|
||||
GlobalValue.NpcVideoMod = this.sdk_channel === E_SDK_Channel.WX || this.sdk_channel === E_SDK_Channel.WEB
|
||||
}
|
||||
|
||||
this.sdk.init(cb)
|
||||
|
||||
SDKManager.umaInit();
|
||||
}
|
||||
|
||||
|
||||
/**是否是微信平台 */
|
||||
static isWenxin() {
|
||||
return this.sdk_channel === E_SDK_Channel.WX
|
||||
}
|
||||
/**是否是抖音平台 */
|
||||
static isByteDance() {
|
||||
return this.sdk_channel === E_SDK_Channel.BD
|
||||
}
|
||||
/**是否是快手平台 */
|
||||
static isKuaishou() {
|
||||
return this.sdk_channel === E_SDK_Channel.KS
|
||||
}
|
||||
/**是否是web平台 */
|
||||
static isWeb() {
|
||||
return this.sdk_channel === E_SDK_Channel.WEB
|
||||
}
|
||||
|
||||
|
||||
//SDK登录,并返回code
|
||||
static login(cb: Function = null) {
|
||||
this.sdk.login(cb)
|
||||
}
|
||||
|
||||
//检查玩家权限
|
||||
//autoKey 授权类型 : userInfo=用户信息
|
||||
static checkAutoSetting(autoKey:string, cb:Function = null) {
|
||||
this.sdk.checkAutoSetting(autoKey, cb)
|
||||
}
|
||||
|
||||
//获取用户信息
|
||||
static getUserInfo(cb:Function = null) {
|
||||
this.sdk.getUserInfo(cb)
|
||||
}
|
||||
|
||||
//注册视频广告回调
|
||||
static register_video_reward(uuid:string, func:Function) {
|
||||
let video_reward_map = this.video_reward_map || {};
|
||||
video_reward_map[uuid] = func
|
||||
|
||||
this.video_reward_map = video_reward_map;
|
||||
}
|
||||
|
||||
//注册分享回调
|
||||
static register_share_reward(uuid:string, func:Function) {
|
||||
let share_reward_map = this.share_reward_map || {};
|
||||
share_reward_map[uuid] = func
|
||||
|
||||
this.share_reward_map = share_reward_map;
|
||||
}
|
||||
|
||||
//执行视频广告回调
|
||||
private static dispatch_video_reward(uuid:string, tag:number) {
|
||||
let video_reward_map = this.video_reward_map || {};
|
||||
let register_func:Function = video_reward_map[uuid];
|
||||
if (register_func) {
|
||||
register_func(tag)
|
||||
}
|
||||
}
|
||||
|
||||
//执行分享回调
|
||||
private static dispatch_share_reward(uuid:string, tag:number) {
|
||||
let share_reward_map = this.share_reward_map || {};
|
||||
let register_func:Function = share_reward_map[uuid];
|
||||
if (register_func) {
|
||||
register_func(tag)
|
||||
}
|
||||
}
|
||||
|
||||
//视频广告
|
||||
static show_reward_video_ad(uuid:string, tag: number) {
|
||||
SDKManager.video_ad_pre();
|
||||
this.sdk.show_video(()=>{
|
||||
this.dispatch_video_reward(uuid,tag)
|
||||
});
|
||||
}
|
||||
//看视频广告前
|
||||
static video_ad_pre() {
|
||||
console.log("SDKManager 视频广告前")
|
||||
AudioManager.I.PauseMusic();
|
||||
}
|
||||
//看视频广告后返回游戏
|
||||
static video_ad_back() {
|
||||
console.log("SDKManager 视频广告后")
|
||||
AudioManager.I.ResumeMusic();
|
||||
}
|
||||
|
||||
//插屏广告
|
||||
static show_interstitial_ad() {
|
||||
this.sdk.show_splash();
|
||||
}
|
||||
|
||||
//展示BANNER
|
||||
static show_banner_ad() {
|
||||
this.sdk.show_banner();
|
||||
}
|
||||
|
||||
//隐藏BANNBER
|
||||
static hide_banner_ad() {
|
||||
this.sdk.hide_banner();
|
||||
}
|
||||
|
||||
//主动拉起分享
|
||||
static show_share() {
|
||||
this.sdk.show_share();
|
||||
}
|
||||
|
||||
//分享得奖励
|
||||
static show_reward_share(uuid:string, tag: number) {
|
||||
this.sdk.show_share(()=>{
|
||||
this.dispatch_share_reward(uuid,tag)
|
||||
});
|
||||
}
|
||||
|
||||
//获取设备分辨率
|
||||
static getWindowSize() {
|
||||
return this.sdk.getWindowSize();
|
||||
}
|
||||
|
||||
/**显示游戏圈
|
||||
* @param leftRatio 左边距占屏幕宽度的比例
|
||||
* @param topRatio 顶部边距占屏幕高度的比例
|
||||
* @param widthRatio 游戏圈宽度占屏幕宽度的比例
|
||||
* @param heightRatio 游戏圈高度占屏幕高度的比例
|
||||
*/
|
||||
static show_gameClub(leftRatio, topRatio, widthRatio, heightRatio) {
|
||||
this.sdk.show_gameClub(leftRatio, topRatio, widthRatio, heightRatio);
|
||||
}
|
||||
//隐藏游戏圈
|
||||
static hide_gameClub() {
|
||||
this.sdk.hide_gameClub();
|
||||
}
|
||||
|
||||
|
||||
/**检查是否支持base64音频播放*/
|
||||
static checkSupportBase64Audio() {
|
||||
return this.sdk.checkSupportBase64Audio();
|
||||
}
|
||||
/**播放base64音频 */
|
||||
static playBase64Audio(base64: string, loop: boolean = false) {
|
||||
this.sdk.playBase64Audio(base64, loop);
|
||||
}
|
||||
|
||||
|
||||
//记录GM日志
|
||||
private static _gmLogString: string = "";
|
||||
private static _gmLogCount: number = 0; //记录日志条数
|
||||
static get GMLogString(): string {
|
||||
return SDKManager._gmLogString;
|
||||
}
|
||||
static ShowGMLog(log: string){
|
||||
Utils.Log(log);
|
||||
if (SDKManager._gmLogCount > 100){
|
||||
SDKManager.ClearGMLog();
|
||||
}
|
||||
SDKManager._gmLogString += log + "\n";
|
||||
SDKManager._gmLogCount++;
|
||||
}
|
||||
static ClearGMLog(){
|
||||
SDKManager._gmLogString = "";
|
||||
SDKManager._gmLogCount = 0;
|
||||
}
|
||||
|
||||
|
||||
/**是否支持客服功能 */
|
||||
static KefuSupport() {
|
||||
return this.sdk.kefuSupport();
|
||||
}
|
||||
/**打开客服 */
|
||||
static OpenKefu() {
|
||||
this.sdk.openKefu();
|
||||
}
|
||||
|
||||
|
||||
//region 播放背景视频 cbMap = {cbReady, cbEnded}
|
||||
static PlayBgAudio(remoteUrl:string, vtype:VideoRoleType, loop:boolean = false, extra:any = {}) {
|
||||
this.sdk.playBgAudio(remoteUrl, vtype, loop, extra);
|
||||
}
|
||||
//添加要播放的表情视频
|
||||
static AddEmoAudio(remoteUrl:string, vtype:VideoRoleType, loop:boolean = false, extra:any = {}) {
|
||||
this.sdk.addEmoAudio(remoteUrl, vtype, loop, extra);
|
||||
}
|
||||
|
||||
|
||||
//region 友盟+
|
||||
static Uma_Event_TalkRound = "_um.talk.round"; //聊天轮次
|
||||
static Uma_Event_LvUnlock = "_um.lv.unlock"; //解锁新关卡
|
||||
/**初始化友盟 */
|
||||
static umaInit() {
|
||||
this.sdk.umaInit();
|
||||
}
|
||||
/**友盟功能是否生效 */
|
||||
static umaSwt() {
|
||||
return this.sdk.umaSwt();
|
||||
}
|
||||
/**友盟事件上报 */
|
||||
static umaEvent(eventName: string, value: any = {}) {
|
||||
this.sdk.umaEvent(eventName, value);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 458 KiB |
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"ver": "1.0.27",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "422262ff-fce3-4520-a3fe-7b2adeb65c51",
|
||||
"files": [
|
||||
".json",
|
||||
".png"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "422262ff-fce3-4520-a3fe-7b2adeb65c51@6c48a",
|
||||
"displayName": "zjm_3",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "422262ff-fce3-4520-a3fe-7b2adeb65c51",
|
||||
"isUuid": true,
|
||||
"visible": false,
|
||||
"minfilter": "linear",
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"anisotropy": 0
|
||||
},
|
||||
"ver": "1.0.22",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"f9941": {
|
||||
"importer": "sprite-frame",
|
||||
"uuid": "422262ff-fce3-4520-a3fe-7b2adeb65c51@f9941",
|
||||
"displayName": "zjm_3",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 400,
|
||||
"height": 400,
|
||||
"rawWidth": 400,
|
||||
"rawHeight": 400,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-200,
|
||||
-200,
|
||||
0,
|
||||
200,
|
||||
-200,
|
||||
0,
|
||||
-200,
|
||||
200,
|
||||
0,
|
||||
200,
|
||||
200,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
0,
|
||||
400,
|
||||
400,
|
||||
400,
|
||||
0,
|
||||
0,
|
||||
400,
|
||||
0
|
||||
],
|
||||
"nuv": [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"minPos": [
|
||||
-200,
|
||||
-200,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
200,
|
||||
200,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "422262ff-fce3-4520-a3fe-7b2adeb65c51@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": true,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "422262ff-fce3-4520-a3fe-7b2adeb65c51@6c48a"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"ver": "1.0.27",
|
||||
"importer": "image",
|
||||
"imported": true,
|
||||
"uuid": "30f36af2-8bce-4534-8df5-91640d865ba6",
|
||||
"files": [
|
||||
".json",
|
||||
".png"
|
||||
],
|
||||
"subMetas": {
|
||||
"6c48a": {
|
||||
"importer": "texture",
|
||||
"uuid": "30f36af2-8bce-4534-8df5-91640d865ba6@6c48a",
|
||||
"displayName": "may_maria_avatar",
|
||||
"id": "6c48a",
|
||||
"name": "texture",
|
||||
"userData": {
|
||||
"wrapModeS": "clamp-to-edge",
|
||||
"wrapModeT": "clamp-to-edge",
|
||||
"imageUuidOrDatabaseUri": "30f36af2-8bce-4534-8df5-91640d865ba6",
|
||||
"isUuid": true,
|
||||
"visible": false,
|
||||
"minfilter": "linear",
|
||||
"magfilter": "linear",
|
||||
"mipfilter": "none",
|
||||
"anisotropy": 0
|
||||
},
|
||||
"ver": "1.0.22",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
},
|
||||
"f9941": {
|
||||
"importer": "sprite-frame",
|
||||
"uuid": "30f36af2-8bce-4534-8df5-91640d865ba6@f9941",
|
||||
"displayName": "may_maria_avatar",
|
||||
"id": "f9941",
|
||||
"name": "spriteFrame",
|
||||
"userData": {
|
||||
"trimType": "auto",
|
||||
"trimThreshold": 1,
|
||||
"rotated": false,
|
||||
"offsetX": 0,
|
||||
"offsetY": 0,
|
||||
"trimX": 0,
|
||||
"trimY": 0,
|
||||
"width": 80,
|
||||
"height": 80,
|
||||
"rawWidth": 80,
|
||||
"rawHeight": 80,
|
||||
"borderTop": 0,
|
||||
"borderBottom": 0,
|
||||
"borderLeft": 0,
|
||||
"borderRight": 0,
|
||||
"packable": true,
|
||||
"pixelsToUnit": 100,
|
||||
"pivotX": 0.5,
|
||||
"pivotY": 0.5,
|
||||
"meshType": 0,
|
||||
"vertices": {
|
||||
"rawPosition": [
|
||||
-40,
|
||||
-40,
|
||||
0,
|
||||
40,
|
||||
-40,
|
||||
0,
|
||||
-40,
|
||||
40,
|
||||
0,
|
||||
40,
|
||||
40,
|
||||
0
|
||||
],
|
||||
"indexes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"uv": [
|
||||
0,
|
||||
80,
|
||||
80,
|
||||
80,
|
||||
0,
|
||||
0,
|
||||
80,
|
||||
0
|
||||
],
|
||||
"nuv": [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"minPos": [
|
||||
-40,
|
||||
-40,
|
||||
0
|
||||
],
|
||||
"maxPos": [
|
||||
40,
|
||||
40,
|
||||
0
|
||||
]
|
||||
},
|
||||
"isUuid": true,
|
||||
"imageUuidOrDatabaseUri": "30f36af2-8bce-4534-8df5-91640d865ba6@6c48a",
|
||||
"atlasUuid": ""
|
||||
},
|
||||
"ver": "1.0.12",
|
||||
"imported": true,
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {}
|
||||
}
|
||||
},
|
||||
"userData": {
|
||||
"type": "sprite-frame",
|
||||
"hasAlpha": true,
|
||||
"fixAlphaTransparencyArtifacts": false,
|
||||
"redirect": "30f36af2-8bce-4534-8df5-91640d865ba6@6c48a"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user