@yangyongtao/gaea 1.0.2 → 1.0.3

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": "@yangyongtao/gaea",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Gaea 3D 可视化组件库,包含天气控制、沿线飞行、台风标注、模型加载等功能",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -384,13 +384,16 @@ export class GaeaApp {
384
384
  }
385
385
 
386
386
  /** 初始化基础环境(关闭默认雾、设置默认光照等) */
387
- initDefaultEnvironment() {
388
- const Gaea = window.Gaea;
389
- if (!Gaea || !Gaea.World || !Gaea.World.Instance) {
390
- console.warn('Gaea 尚未加载完毕,请确保在 Gaea 初始化之后调用此方法');
387
+ async initDefaultEnvironment() {
388
+ // 等待 Gaea 就绪
389
+ const ready = await waitForGaea(15000);
390
+ if (!ready) {
391
+ console.error('Gaea 引擎初始化超时');
391
392
  return;
392
393
  }
393
394
 
395
+ const Gaea = window.Gaea;
396
+
394
397
  // 关闭默认雾
395
398
  const fogEnv = Gaea.Environment.ConvertBy(
396
399
  Gaea.GaeaResourceLoader.Instance.LoadLoaclResource('res://default_env.tres')