@chiyou/minigame-framework 1.4.4 → 1.4.6

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.4",
3
+ "version": "1.4.6",
4
4
  "description": "基于 Cocos Creator 3.x 的小游戏开发框架,支持多平台发布",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -100,16 +100,18 @@ export abstract class AbsPlatformAdapter extends Component{
100
100
  return { scene: this.warmStartScene, category: LaunchCategory.Other };
101
101
  }
102
102
 
103
- /** 获取当前启动场景分类(兼容原 isLaunchFromXxx 逻辑:冷启动优先,未命中再查热启动) */
103
+ /** 获取当前启动场景分类(热启动优先,未命中再查冷启动) */
104
104
  public getLaunchCategory(): LaunchCategory {
105
- const cold = this.getColdStartSceneInfo();
106
- if (cold.category !== LaunchCategory.Other) return cold.category;
107
- return this.getWarmStartSceneInfo().category;
105
+ const warm = this.getWarmStartSceneInfo();
106
+ if (warm.category !== LaunchCategory.Other) return warm.category;
107
+ return this.getColdStartSceneInfo().category;
108
108
  }
109
109
 
110
- /** 判断是否从指定分类启动(兼容原 isLaunchFromRecentUse/isLaunchFromDesktopShortcut/isLaunchFromAdvertisement) */
110
+ /** 判断是否从指定分类启动(OR逻辑:冷启动或热启动任意匹配即返回true,兼容原 isLaunchFromXxx) */
111
111
  public isLaunchFrom(category: LaunchCategory): boolean {
112
- return this.getLaunchCategory() === category;
112
+ const coldInfo = this.getColdStartSceneInfo();
113
+ const warmInfo = this.getWarmStartSceneInfo();
114
+ return coldInfo.category === category || warmInfo.category === category;
113
115
  }
114
116
 
115
117
  abstract isNavigateToRecentUseAvailable(callback: Function): void;