@chiyou/minigame-framework 1.4.9 → 1.4.10

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chiyou/minigame-framework",
3
- "version": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "description": "基于 Cocos Creator 3.x 的小游戏开发框架,支持多平台发布",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -3,6 +3,7 @@ import { LogUtils } from "../Utils/LogUtils";
3
3
  import { ServiceLocator } from "../Utils/ServiceLocator";
4
4
  import { BaseMgr } from "./BaseMgr";
5
5
  import { EventMgr } from "./EventMgr";
6
+ import { LaunchCategory } from "../Definition/AnalyticsDefinition";
6
7
  import type { AnalyticsMgr } from "./AnalyticsMgr";
7
8
 
8
9
  /** 生命周期管理器 */
@@ -181,7 +182,7 @@ export class LifeCycleMgr extends BaseMgr {
181
182
  }
182
183
 
183
184
  /** 获取冷启动场景信息 */
184
- public getColdStartSceneInfo(): { scene: string; category: string } | null {
185
+ public getColdStartSceneInfo(): { scene: string; category: LaunchCategory } | null {
185
186
  if (this.getPlatformAdapter() === null) {
186
187
  return null;
187
188
  }
@@ -190,7 +191,7 @@ export class LifeCycleMgr extends BaseMgr {
190
191
  }
191
192
 
192
193
  /** 获取热启动场景信息 */
193
- public getWarmStartSceneInfo(): { scene: string; category: string } | null {
194
+ public getWarmStartSceneInfo(): { scene: string; category: LaunchCategory } | null {
194
195
  if (this.getPlatformAdapter() === null) {
195
196
  return null;
196
197
  }
@@ -199,7 +200,7 @@ export class LifeCycleMgr extends BaseMgr {
199
200
  }
200
201
 
201
202
  /** 获取当前启动场景分类(兼容原 isLaunchFromXxx 逻辑) */
202
- public getLaunchCategory(): string | null {
203
+ public getLaunchCategory(): LaunchCategory | null {
203
204
  if (this.getPlatformAdapter() === null) {
204
205
  return null;
205
206
  }
@@ -208,11 +209,11 @@ export class LifeCycleMgr extends BaseMgr {
208
209
  }
209
210
 
210
211
  /** 判断是否从指定分类启动 */
211
- public isLaunchFrom(category: string): boolean {
212
+ public isLaunchFrom(category: LaunchCategory): boolean {
212
213
  if (this.getPlatformAdapter() === null) {
213
214
  return false;
214
215
  }
215
216
 
216
- return this.getPlatformAdapter().isLaunchFrom(category as any);
217
+ return this.getPlatformAdapter().isLaunchFrom(category);
217
218
  }
218
219
  }