平台判断辅助工具类:PlatformHelper.ts
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { _decorator, assetManager, Component, game, macro, sys } from "cc";
|
||||
import { SDKManager } from "../Main/Channel/SDKManager";
|
||||
import PlayerDataManager from "../Main/Manager/PlayerDataManager";
|
||||
import { PlatformHelper } from "../Main/Channel/PlatformHelper";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -14,7 +15,7 @@ export class GameEntry extends Component {
|
||||
|
||||
assetManager.downloader.maxConcurrency = 20;
|
||||
assetManager.downloader.maxRequestsPerFrame = 10;
|
||||
if (sys.platform == sys.Platform.WECHAT_GAME) {
|
||||
if (PlatformHelper.isWechat()) {
|
||||
assetManager.cacheManager.cacheEnabled = true;
|
||||
macro.CLEANUP_IMAGE_CACHE = true;
|
||||
// DynamicAtlasManager.instance.enabled = false; //关闭动态图集
|
||||
|
||||
Reference in New Issue
Block a user