@chiyou/minigame-framework 1.4.3 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -107,6 +107,13 @@ export abstract class AbsPlatformAdapter extends Component{
|
|
|
107
107
|
return this.getWarmStartSceneInfo().category;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
/** 判断是否从指定分类启动(OR逻辑:冷启动或热启动任意匹配即返回true,兼容原 isLaunchFromXxx) */
|
|
111
|
+
public isLaunchFrom(category: LaunchCategory): boolean {
|
|
112
|
+
const coldInfo = this.getColdStartSceneInfo();
|
|
113
|
+
const warmInfo = this.getWarmStartSceneInfo();
|
|
114
|
+
return coldInfo.category === category || warmInfo.category === category;
|
|
115
|
+
}
|
|
116
|
+
|
|
110
117
|
abstract isNavigateToRecentUseAvailable(callback: Function): void;
|
|
111
118
|
|
|
112
119
|
abstract navigateToRecentUse(): void;
|
|
@@ -203,4 +203,13 @@ export class LifeCycleMgr extends BaseMgr {
|
|
|
203
203
|
|
|
204
204
|
return this.getPlatformAdapter().getLaunchCategory();
|
|
205
205
|
}
|
|
206
|
+
|
|
207
|
+
/** 判断是否从指定分类启动 */
|
|
208
|
+
public isLaunchFrom(category: string): boolean {
|
|
209
|
+
if (this.getPlatformAdapter() === null) {
|
|
210
|
+
return false;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return this.getPlatformAdapter().isLaunchFrom(category as any);
|
|
214
|
+
}
|
|
206
215
|
}
|