SDK相关的整理
This commit is contained in:
@@ -6,6 +6,11 @@ import { sys } from "cc";
|
||||
*/
|
||||
export class PlatformHelper {
|
||||
|
||||
/** 是否Luffa平台 */
|
||||
public static isLuffa(): boolean {
|
||||
return sys.platform === sys.Platform.WECHAT_GAME && typeof window["wx"] !== "undefined";
|
||||
}
|
||||
|
||||
/** 是否微信小游戏 */
|
||||
public static isWechat(): boolean {
|
||||
return sys.platform === sys.Platform.WECHAT_GAME && typeof window["wx"] !== "undefined";
|
||||
@@ -73,6 +78,7 @@ export class PlatformHelper {
|
||||
|
||||
/** 获取当前平台名称(调试用) */
|
||||
public static getPlatformName(): string {
|
||||
if (this.isLuffa()) return "Luffa平台";
|
||||
if (this.isWechat()) return "微信小游戏";
|
||||
if (this.isByteDance()) return "字节跳动小游戏";
|
||||
if (this.isKuaishou()) return "快手小游戏";
|
||||
|
||||
Reference in New Issue
Block a user