@nice2dev/game-engine 1.2.0 → 1.2.1
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/CHANGELOG.md +103 -0
- package/dist/cjs/ai/BehaviorTree.js +4 -4
- package/dist/cjs/audio/AudioBridge.js +3 -1
- package/dist/cjs/build-cloud/GodotBuildCloud.js +1 -1
- package/dist/cjs/build-cloud/UnrealBuildCloud.js +1 -1
- package/dist/cjs/core/GameConfig.js +11 -9
- package/dist/cjs/devtools/GameplayAnalytics.js +3 -1
- package/dist/cjs/editor/AnimationRetargeting.js +110 -108
- package/dist/cjs/editor/CraftingEditor.js +2 -2
- package/dist/cjs/editor/NiceGameEditor.js +1 -1
- package/dist/cjs/editor/UndoRedoPro.js +49 -47
- package/dist/cjs/export/BevyExporter.js +1 -1
- package/dist/cjs/export/CocosExporter.js +4 -4
- package/dist/cjs/export/Construct3Exporter.js +4 -4
- package/dist/cjs/export/DefoldExporter.js +4 -4
- package/dist/cjs/export/GDevelopExporter.js +2 -2
- package/dist/cjs/export/GameMakerExporter.js +3 -3
- package/dist/cjs/export/GodotExporter.js +3 -3
- package/dist/cjs/export/MinecraftBedrockExporter.js +2 -2
- package/dist/cjs/export/MonoGameExporter.js +2 -2
- package/dist/cjs/export/Pico8Exporter.js +6 -6
- package/dist/cjs/export/RPGMakerExporter.js +4 -4
- package/dist/cjs/export/RobloxExporter.js +5 -5
- package/dist/cjs/export/Solar2DExporter.js +2 -2
- package/dist/cjs/export/ThreeJSExporter.js +3 -3
- package/dist/cjs/export/Tic80Exporter.js +6 -6
- package/dist/cjs/export/UnityExporter.js +4 -4
- package/dist/cjs/export/UnrealExporter.js +7 -7
- package/dist/cjs/export/WebExporter.js +2 -2
- package/dist/cjs/godot-integration/components/GodotProjectBrowser.js +4 -4
- package/dist/cjs/i18n/useTranslation.js +1 -1
- package/dist/cjs/import/GodotSceneImporter.js +4 -4
- package/dist/cjs/import/LDtkImporter.js +1 -1
- package/dist/cjs/import/OgmoImporter.js +1 -1
- package/dist/cjs/import/TiledMapImporter.js +1 -1
- package/dist/cjs/input/GamepadNavigation.js +1 -1
- package/dist/cjs/inventory/InventorySystem.js +1 -1
- package/dist/cjs/native-engine/NetworkingSystem.js +1 -1
- package/dist/cjs/rendering/WebGPURenderPipeline.js +41 -30
- package/dist/cjs/unity-integration/UnityImport.js +2 -2
- package/dist/cjs/unity-integration/components/UnityAssetStoreBrowser.js +4 -4
- package/dist/cjs/unity-integration/components/UnityProjectBrowser.js +8 -5
- package/dist/cjs/unreal-integration/components/UnrealProjectBrowser.js +5 -5
- package/dist/esm/ai/BehaviorTree.js +4 -4
- package/dist/esm/audio/AudioBridge.js +3 -1
- package/dist/esm/build-cloud/GodotBuildCloud.js +1 -1
- package/dist/esm/build-cloud/UnrealBuildCloud.js +1 -1
- package/dist/esm/core/GameConfig.js +11 -9
- package/dist/esm/devtools/GameplayAnalytics.js +3 -1
- package/dist/esm/editor/AnimationRetargeting.js +110 -108
- package/dist/esm/editor/CraftingEditor.js +2 -2
- package/dist/esm/editor/NiceGameEditor.js +2 -2
- package/dist/esm/editor/UndoRedoPro.js +49 -47
- package/dist/esm/export/BevyExporter.js +1 -1
- package/dist/esm/export/CocosExporter.js +4 -4
- package/dist/esm/export/Construct3Exporter.js +4 -4
- package/dist/esm/export/DefoldExporter.js +4 -4
- package/dist/esm/export/GDevelopExporter.js +2 -2
- package/dist/esm/export/GameMakerExporter.js +3 -3
- package/dist/esm/export/GodotExporter.js +3 -3
- package/dist/esm/export/MinecraftBedrockExporter.js +2 -2
- package/dist/esm/export/MonoGameExporter.js +2 -2
- package/dist/esm/export/Pico8Exporter.js +6 -6
- package/dist/esm/export/RPGMakerExporter.js +4 -4
- package/dist/esm/export/RobloxExporter.js +5 -5
- package/dist/esm/export/Solar2DExporter.js +2 -2
- package/dist/esm/export/ThreeJSExporter.js +3 -3
- package/dist/esm/export/Tic80Exporter.js +6 -6
- package/dist/esm/export/UnityExporter.js +4 -4
- package/dist/esm/export/UnrealExporter.js +7 -7
- package/dist/esm/export/WebExporter.js +2 -2
- package/dist/esm/godot-integration/components/GodotProjectBrowser.js +5 -5
- package/dist/esm/i18n/useTranslation.js +2 -2
- package/dist/esm/import/GodotSceneImporter.js +4 -4
- package/dist/esm/import/LDtkImporter.js +1 -1
- package/dist/esm/import/OgmoImporter.js +1 -1
- package/dist/esm/import/TiledMapImporter.js +1 -1
- package/dist/esm/input/GamepadNavigation.js +2 -2
- package/dist/esm/inventory/InventorySystem.js +1 -1
- package/dist/esm/native-engine/NetworkingSystem.js +1 -1
- package/dist/esm/rendering/WebGPURenderPipeline.js +41 -30
- package/dist/esm/unity-integration/UnityImport.js +2 -2
- package/dist/esm/unity-integration/components/UnityAssetStoreBrowser.js +5 -5
- package/dist/esm/unity-integration/components/UnityProjectBrowser.js +9 -6
- package/dist/esm/unreal-integration/components/UnrealProjectBrowser.js +6 -6
- package/dist/types/ai/BehaviorTree.d.ts +4 -4
- package/dist/types/editor/CraftingEditor.d.ts +1 -1
- package/dist/types/godot-integration/components/GodotProjectBrowser.d.ts +3 -1
- package/dist/types/unity-integration/components/UnityAssetStoreBrowser.d.ts +3 -1
- package/dist/types/unity-integration/components/UnityProjectBrowser.d.ts +3 -1
- package/dist/types/unreal-integration/components/UnrealProjectBrowser.d.ts +3 -1
- package/package.json +5 -5
|
@@ -229,7 +229,7 @@ class UnrealExporter extends PlatformExporter {
|
|
|
229
229
|
};
|
|
230
230
|
this.addTextFile(`${projectName}.uproject`, JSON.stringify(uproject, null, 2));
|
|
231
231
|
}
|
|
232
|
-
async generateBuildFiles(
|
|
232
|
+
async generateBuildFiles(_project, _options) {
|
|
233
233
|
// Module Build.cs
|
|
234
234
|
const buildCs = `// Copyright Nice2Dev. All Rights Reserved.
|
|
235
235
|
|
|
@@ -330,7 +330,7 @@ IMPLEMENT_PRIMARY_GAME_MODULE(F${this.moduleName}Module, ${this.moduleName}, "${
|
|
|
330
330
|
this.generateActorClass(prefab.entity, prefab.name, options);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
generateGameMode(project,
|
|
333
|
+
generateGameMode(project, _options) {
|
|
334
334
|
const className = `A${this.moduleName}GameMode`;
|
|
335
335
|
// Header
|
|
336
336
|
const header = `// Copyright Nice2Dev. All Rights Reserved.
|
|
@@ -411,7 +411,7 @@ void ${className}::StartPlay()
|
|
|
411
411
|
`;
|
|
412
412
|
this.addTextFile(`Source/${this.moduleName}/${this.moduleName}GameMode.cpp`, source);
|
|
413
413
|
}
|
|
414
|
-
generateActorClass(entity, className,
|
|
414
|
+
generateActorClass(entity, className, _options) {
|
|
415
415
|
const sanitizedName = className.replace(/[^a-zA-Z0-9]/g, '');
|
|
416
416
|
const fullClassName = `A${sanitizedName}`;
|
|
417
417
|
this.usedHeaders.clear();
|
|
@@ -569,7 +569,7 @@ void ${fullClassName}::OnNiceUpdate_Implementation(float DeltaTime)
|
|
|
569
569
|
}
|
|
570
570
|
return String(value);
|
|
571
571
|
}
|
|
572
|
-
async generateConfigFiles(project,
|
|
572
|
+
async generateConfigFiles(project, _options) {
|
|
573
573
|
// Default Engine.ini
|
|
574
574
|
const engineIni = `[/Script/EngineSettings.GameMapsSettings]
|
|
575
575
|
GameDefaultMap=/Game/Maps/MainMenu
|
|
@@ -601,7 +601,7 @@ DefaultGravityZ=${project.settings.physics?.gravity?.y ?? -980}
|
|
|
601
601
|
this.addTextFile('Config/DefaultGame.ini', gameIni);
|
|
602
602
|
}
|
|
603
603
|
/* ── Scene Export ───────────────────────────────────────────── */
|
|
604
|
-
async exportScene(scene, project,
|
|
604
|
+
async exportScene(scene, project, _options) {
|
|
605
605
|
// Generate level blueprint
|
|
606
606
|
const levelHeader = this.generateLevelBlueprint(scene, project);
|
|
607
607
|
this.addTextFile(`Content/Maps/${scene.name}_LevelScript.h`, levelHeader.header);
|
|
@@ -610,7 +610,7 @@ DefaultGravityZ=${project.settings.physics?.gravity?.y ?? -980}
|
|
|
610
610
|
const spawnData = this.generateSpawnData(scene);
|
|
611
611
|
this.addTextFile(`Content/Data/${scene.name}_SpawnData.json`, JSON.stringify(spawnData, null, 2));
|
|
612
612
|
}
|
|
613
|
-
generateLevelBlueprint(scene,
|
|
613
|
+
generateLevelBlueprint(scene, _project) {
|
|
614
614
|
const className = `A${scene.name.replace(/[^a-zA-Z0-9]/g, '')}LevelScript`;
|
|
615
615
|
const header = `// Copyright Nice2Dev. All Rights Reserved.
|
|
616
616
|
|
|
@@ -711,7 +711,7 @@ ${scene.entities.map((e) => this.generateEntitySpawnCode(e)).join('\n')}
|
|
|
711
711
|
};
|
|
712
712
|
}
|
|
713
713
|
/* ── Asset Export ───────────────────────────────────────────── */
|
|
714
|
-
async exportAsset(asset,
|
|
714
|
+
async exportAsset(asset, _options) {
|
|
715
715
|
switch (asset.type) {
|
|
716
716
|
case 'sprite':
|
|
717
717
|
case 'texture':
|
|
@@ -376,7 +376,7 @@ export default class ${sceneName}Scene ${useTS ? 'implements Scene' : ''} {
|
|
|
376
376
|
}
|
|
377
377
|
return code;
|
|
378
378
|
}
|
|
379
|
-
async exportScripts(project, options,
|
|
379
|
+
async exportScripts(project, options, _useTS) {
|
|
380
380
|
for (const script of project.scripts) {
|
|
381
381
|
try {
|
|
382
382
|
const ast = this.graphToAST.convert(script);
|
|
@@ -968,7 +968,7 @@ export class ${sceneName}Scene extends Phaser.Scene {
|
|
|
968
968
|
(scene.tilemaps ?? []).forEach((tm) => assetIds.add(tm.tilesetId));
|
|
969
969
|
return project.assets.filter((a) => assetIds.has(a.id));
|
|
970
970
|
}
|
|
971
|
-
async exportScripts(project, options,
|
|
971
|
+
async exportScripts(project, options, _useTS) {
|
|
972
972
|
for (const script of project.scripts) {
|
|
973
973
|
try {
|
|
974
974
|
const ast = this.graphToAST.convert(script);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { NiceIcon } from '@nice2dev/ui';
|
|
3
|
-
import {
|
|
3
|
+
import { forwardRef, useReducer, useMemo, useCallback, useImperativeHandle, createContext, useContext } from 'react';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_THEME = {
|
|
6
6
|
background: '#1d2229',
|
|
@@ -91,7 +91,7 @@ const INITIAL_STATE = {
|
|
|
91
91
|
importProgress: 0,
|
|
92
92
|
tab: 'files',
|
|
93
93
|
};
|
|
94
|
-
const BrowserContext = createContext(null);
|
|
94
|
+
const BrowserContext = /* @__PURE__ */ createContext(null);
|
|
95
95
|
function useBrowser() {
|
|
96
96
|
const ctx = useContext(BrowserContext);
|
|
97
97
|
if (!ctx) {
|
|
@@ -579,7 +579,8 @@ const DEMO_PROJECT = {
|
|
|
579
579
|
{ name: 'Web Build', platform: 'Web' },
|
|
580
580
|
],
|
|
581
581
|
};
|
|
582
|
-
const GodotProjectBrowser =
|
|
582
|
+
const GodotProjectBrowser = /* @__PURE__ */ Object.assign(
|
|
583
|
+
/* @__PURE__ */ forwardRef(({ projectPath: _projectPath, theme: themeOverride, onProjectLoad, onImport, onSyncConnect, onSyncDisconnect, className, style, }, ref) => {
|
|
583
584
|
const [state, dispatch] = useReducer(browserReducer, {
|
|
584
585
|
...INITIAL_STATE,
|
|
585
586
|
projectInfo: DEMO_PROJECT,
|
|
@@ -661,7 +662,6 @@ const GodotProjectBrowser = forwardRef(({ projectPath: _projectPath, theme: them
|
|
|
661
662
|
overflow: 'hidden',
|
|
662
663
|
...style,
|
|
663
664
|
}, children: [jsx(BrowserHeader, {}), jsx(BrowserToolbar, {}), jsx(TabBar, {}), jsxs("div", { style: { flex: 1, overflow: 'auto' }, children: [state.tab === 'files' && jsx(FilesPanel, {}), state.tab === 'autoloads' && jsx(AutoloadsPanel, {}), state.tab === 'plugins' && jsx(PluginsPanel, {}), state.tab === 'exports' && jsx(ExportsPanel, {})] })] }) }));
|
|
664
|
-
});
|
|
665
|
-
GodotProjectBrowser.displayName = 'GodotProjectBrowser';
|
|
665
|
+
}), { displayName: 'GodotProjectBrowser' });
|
|
666
666
|
|
|
667
667
|
export { GodotProjectBrowser };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useContext, useState, useRef, useEffect, useCallback, createContext } from 'react';
|
|
3
3
|
import { getI18n, LOCALE_NAMES, SUPPORTED_LOCALES } from './I18n.js';
|
|
4
4
|
|
|
5
5
|
/* ── Context ──────────────────────────────────────────────────── */
|
|
6
|
-
const I18nContext = createContext(null);
|
|
6
|
+
const I18nContext = /* @__PURE__ */ createContext(null);
|
|
7
7
|
/**
|
|
8
8
|
* Provider component to supply a custom I18nManager to the tree.
|
|
9
9
|
* If not used, the global singleton (getI18n()) is used automatically.
|
|
@@ -193,8 +193,8 @@ class GodotSceneImporter extends SceneImporter {
|
|
|
193
193
|
// Handle multiline values
|
|
194
194
|
if (multilineKey) {
|
|
195
195
|
multilineValue += '\n' + line;
|
|
196
|
-
bracketDepth += (line.match(/[
|
|
197
|
-
bracketDepth -= (line.match(/[\]
|
|
196
|
+
bracketDepth += (line.match(/[[{]/g) || []).length;
|
|
197
|
+
bracketDepth -= (line.match(/[\]}]/g) || []).length;
|
|
198
198
|
if (bracketDepth === 0) {
|
|
199
199
|
currentItem[multilineKey] = this.parseGodotValue(multilineValue);
|
|
200
200
|
multilineKey = '';
|
|
@@ -208,8 +208,8 @@ class GodotSceneImporter extends SceneImporter {
|
|
|
208
208
|
const key = propMatch[1];
|
|
209
209
|
const value = propMatch[2];
|
|
210
210
|
// Check if value starts multiline
|
|
211
|
-
bracketDepth = (value.match(/[
|
|
212
|
-
bracketDepth -= (value.match(/[\]
|
|
211
|
+
bracketDepth = (value.match(/[[{]/g) || []).length;
|
|
212
|
+
bracketDepth -= (value.match(/[\]}]/g) || []).length;
|
|
213
213
|
if (bracketDepth > 0) {
|
|
214
214
|
multilineKey = key;
|
|
215
215
|
multilineValue = value;
|
|
@@ -150,7 +150,7 @@ class LDtkImporter extends SceneImporter {
|
|
|
150
150
|
const externalLevel = JSON.parse(content);
|
|
151
151
|
level.layerInstances = externalLevel.layerInstances;
|
|
152
152
|
}
|
|
153
|
-
catch
|
|
153
|
+
catch {
|
|
154
154
|
this.addWarning('LEVEL_LOAD_ERROR', `Failed to load external level: ${level.externalRelPath}`, level.externalRelPath);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
@@ -565,7 +565,7 @@ class TiledMapImporter extends SceneImporter {
|
|
|
565
565
|
// Merge external tileset data
|
|
566
566
|
Object.assign(tileset, externalTileset, { firstGid: tileset.firstGid });
|
|
567
567
|
}
|
|
568
|
-
catch
|
|
568
|
+
catch {
|
|
569
569
|
this.addWarning('TILESET_LOAD_ERROR', `Failed to load external tileset: ${tileset.source}`, tileset.source);
|
|
570
570
|
}
|
|
571
571
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useState, useRef, useCallback, useEffect, useContext, createContext } from 'react';
|
|
3
3
|
|
|
4
|
-
const Ctx = createContext(undefined);
|
|
4
|
+
const Ctx = /* @__PURE__ */ createContext(undefined);
|
|
5
5
|
/* ── Provider ──────────────────────────────────────────────────── */
|
|
6
6
|
function GamepadNavigationProvider({ children }) {
|
|
7
7
|
const [focusables, setFocusables] = useState([]);
|
|
@@ -983,7 +983,7 @@ class InventoryManager {
|
|
|
983
983
|
/* ═══════════════════════════════════════════════════════════════
|
|
984
984
|
REACT INTEGRATION
|
|
985
985
|
══════════════════════════════════════════════════════════════════ */
|
|
986
|
-
const InventoryContext = React.createContext(null);
|
|
986
|
+
const InventoryContext = /* @__PURE__ */ React.createContext(null);
|
|
987
987
|
const InventoryProvider = ({ manager, children }) => {
|
|
988
988
|
return React.createElement(InventoryContext.Provider, { value: manager }, children);
|
|
989
989
|
};
|
|
@@ -632,37 +632,48 @@ class PostProcessStack {
|
|
|
632
632
|
this.passes = [];
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
|
-
const QUALITY_PRESET_CONFIGS = {
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
medium: {
|
|
644
|
-
sampleCount: 1,
|
|
645
|
-
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 1024, cascadeCount: 2 },
|
|
646
|
-
postProcess: { ...DEFAULT_RENDER_CONFIG.postProcess, effects: [FXAA_DEFAULTS] },
|
|
647
|
-
depthPrepassEnabled: false,
|
|
648
|
-
},
|
|
649
|
-
high: {
|
|
650
|
-
sampleCount: 4,
|
|
651
|
-
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 2048, cascadeCount: 4 },
|
|
652
|
-
postProcess: { ...DEFAULT_RENDER_CONFIG.postProcess, effects: [FXAA_DEFAULTS, BLOOM_DEFAULTS] },
|
|
653
|
-
depthPrepassEnabled: true,
|
|
654
|
-
},
|
|
655
|
-
ultra: {
|
|
656
|
-
sampleCount: 4,
|
|
657
|
-
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 4096, cascadeCount: 4, pcfRadius: 3 },
|
|
658
|
-
postProcess: {
|
|
659
|
-
...DEFAULT_RENDER_CONFIG.postProcess,
|
|
660
|
-
effects: [FXAA_DEFAULTS, BLOOM_DEFAULTS, SSAO_DEFAULTS, DOF_DEFAULTS, COLOR_GRADING_DEFAULTS],
|
|
635
|
+
const QUALITY_PRESET_CONFIGS = /* @__PURE__ */ (function () {
|
|
636
|
+
return {
|
|
637
|
+
low: {
|
|
638
|
+
sampleCount: 1,
|
|
639
|
+
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, enabled: false },
|
|
640
|
+
postProcess: { ...DEFAULT_RENDER_CONFIG.postProcess, hdrEnabled: false, effects: [] },
|
|
641
|
+
depthPrepassEnabled: false,
|
|
642
|
+
occlusionCulling: false,
|
|
661
643
|
},
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
}
|
|
644
|
+
medium: {
|
|
645
|
+
sampleCount: 1,
|
|
646
|
+
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 1024, cascadeCount: 2 },
|
|
647
|
+
postProcess: { ...DEFAULT_RENDER_CONFIG.postProcess, effects: [FXAA_DEFAULTS] },
|
|
648
|
+
depthPrepassEnabled: false,
|
|
649
|
+
},
|
|
650
|
+
high: {
|
|
651
|
+
sampleCount: 4,
|
|
652
|
+
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 2048, cascadeCount: 4 },
|
|
653
|
+
postProcess: {
|
|
654
|
+
...DEFAULT_RENDER_CONFIG.postProcess,
|
|
655
|
+
effects: [FXAA_DEFAULTS, BLOOM_DEFAULTS],
|
|
656
|
+
},
|
|
657
|
+
depthPrepassEnabled: true,
|
|
658
|
+
},
|
|
659
|
+
ultra: {
|
|
660
|
+
sampleCount: 4,
|
|
661
|
+
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 4096, cascadeCount: 4, pcfRadius: 3 },
|
|
662
|
+
postProcess: {
|
|
663
|
+
...DEFAULT_RENDER_CONFIG.postProcess,
|
|
664
|
+
effects: [
|
|
665
|
+
FXAA_DEFAULTS,
|
|
666
|
+
BLOOM_DEFAULTS,
|
|
667
|
+
SSAO_DEFAULTS,
|
|
668
|
+
DOF_DEFAULTS,
|
|
669
|
+
COLOR_GRADING_DEFAULTS,
|
|
670
|
+
],
|
|
671
|
+
},
|
|
672
|
+
depthPrepassEnabled: true,
|
|
673
|
+
occlusionCulling: true,
|
|
674
|
+
},
|
|
675
|
+
};
|
|
676
|
+
})();
|
|
666
677
|
function applyQualityPreset(preset) {
|
|
667
678
|
return { ...DEFAULT_RENDER_CONFIG, ...QUALITY_PRESET_CONFIGS[preset] };
|
|
668
679
|
}
|
|
@@ -298,7 +298,7 @@ class UnityProjectImporter {
|
|
|
298
298
|
const parts = path.replace(/\\/g, '/').split('/');
|
|
299
299
|
return parts[parts.length - 1] || 'UnknownProject';
|
|
300
300
|
}
|
|
301
|
-
async detectUnityVersion(
|
|
301
|
+
async detectUnityVersion(_projectPath) {
|
|
302
302
|
// Read ProjectSettings/ProjectVersion.txt
|
|
303
303
|
// In real implementation, read from file system
|
|
304
304
|
// Format: m_EditorVersion: 2022.3.10f1
|
|
@@ -594,7 +594,7 @@ class UnityProjectImporter {
|
|
|
594
594
|
field.tooltip = tooltipMatch[1];
|
|
595
595
|
}
|
|
596
596
|
// Range
|
|
597
|
-
const rangeMatch = attrBlock.match(/\[Range\(([^,]+),\s*([
|
|
597
|
+
const rangeMatch = attrBlock.match(/\[Range\(([^,]+),\s*([^)]+)\)\]/);
|
|
598
598
|
if (rangeMatch) {
|
|
599
599
|
field.range = {
|
|
600
600
|
min: parseFloat(rangeMatch[1]),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { NiceIcon } from '@nice2dev/ui';
|
|
3
|
-
import {
|
|
3
|
+
import { forwardRef, useReducer, useMemo, useCallback, useImperativeHandle, createContext, useState, useContext } from 'react';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_THEME = {
|
|
6
6
|
background: '#0f0f17',
|
|
@@ -78,7 +78,7 @@ const INITIAL_STATE = {
|
|
|
78
78
|
view: 'grid',
|
|
79
79
|
myAssets: false,
|
|
80
80
|
};
|
|
81
|
-
const StoreContext = createContext(null);
|
|
81
|
+
const StoreContext = /* @__PURE__ */ createContext(null);
|
|
82
82
|
function useStore() {
|
|
83
83
|
const ctx = useContext(StoreContext);
|
|
84
84
|
if (!ctx) {
|
|
@@ -695,7 +695,8 @@ const DEMO_ASSETS = [
|
|
|
695
695
|
url: 'https://assetstore.unity.com/',
|
|
696
696
|
},
|
|
697
697
|
];
|
|
698
|
-
const UnityAssetStoreBrowser =
|
|
698
|
+
const UnityAssetStoreBrowser = /* @__PURE__ */ Object.assign(
|
|
699
|
+
/* @__PURE__ */ forwardRef(({ theme: themeOverride, onDownload, onPurchase: _onPurchase, className, style }, ref) => {
|
|
699
700
|
const [state, dispatch] = useReducer(storeReducer, {
|
|
700
701
|
...INITIAL_STATE,
|
|
701
702
|
results: DEMO_ASSETS,
|
|
@@ -791,7 +792,6 @@ const UnityAssetStoreBrowser = forwardRef(({ theme: themeOverride, onDownload, o
|
|
|
791
792
|
overflow: 'hidden',
|
|
792
793
|
...style,
|
|
793
794
|
}, children: [jsx(SearchHeader, {}), jsx("div", { style: { flex: 1, overflow: 'auto' }, children: jsx(AssetGrid, {}) }), jsx(AssetDetailModal, {})] }) }));
|
|
794
|
-
});
|
|
795
|
-
UnityAssetStoreBrowser.displayName = 'UnityAssetStoreBrowser';
|
|
795
|
+
}), { displayName: 'UnityAssetStoreBrowser' });
|
|
796
796
|
|
|
797
797
|
export { UnityAssetStoreBrowser };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { NiceIcon } from '@nice2dev/ui';
|
|
3
|
-
import {
|
|
3
|
+
import { forwardRef, useReducer, useMemo, useCallback, useImperativeHandle, createContext, useContext } from 'react';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_THEME = {
|
|
6
6
|
background: '#1e1e2e',
|
|
@@ -91,7 +91,7 @@ const INITIAL_STATE = {
|
|
|
91
91
|
liveLinkStatus: { connected: false, playMode: 'stopped' },
|
|
92
92
|
tab: 'assets',
|
|
93
93
|
};
|
|
94
|
-
const BrowserContext = createContext(null);
|
|
94
|
+
const BrowserContext = /* @__PURE__ */ createContext(null);
|
|
95
95
|
function useBrowser() {
|
|
96
96
|
const ctx = useContext(BrowserContext);
|
|
97
97
|
if (!ctx) {
|
|
@@ -701,7 +701,8 @@ const DEMO_PROJECT = {
|
|
|
701
701
|
{ path: 'Assets/Scenes/Level2.unity', enabled: true },
|
|
702
702
|
],
|
|
703
703
|
};
|
|
704
|
-
const UnityProjectBrowser =
|
|
704
|
+
const UnityProjectBrowser = /* @__PURE__ */ Object.assign(
|
|
705
|
+
/* @__PURE__ */ forwardRef(({ projectPath, theme: themeOverride, onProjectLoad, onImport, onLiveLinkConnect, onLiveLinkDisconnect, className, style, }, ref) => {
|
|
705
706
|
const [state, dispatch] = useReducer(browserReducer, {
|
|
706
707
|
...INITIAL_STATE,
|
|
707
708
|
projectInfo: DEMO_PROJECT,
|
|
@@ -789,7 +790,10 @@ const UnityProjectBrowser = forwardRef(({ projectPath, theme: themeOverride, onP
|
|
|
789
790
|
}, [onLiveLinkConnect]);
|
|
790
791
|
const disconnectLiveLink = useCallback(() => {
|
|
791
792
|
onLiveLinkDisconnect?.();
|
|
792
|
-
dispatch({
|
|
793
|
+
dispatch({
|
|
794
|
+
type: 'SET_LIVE_LINK_STATUS',
|
|
795
|
+
status: { connected: false, playMode: 'stopped' },
|
|
796
|
+
});
|
|
793
797
|
}, [onLiveLinkDisconnect]);
|
|
794
798
|
// Imperative handle
|
|
795
799
|
useImperativeHandle(ref, () => ({
|
|
@@ -826,7 +830,6 @@ const UnityProjectBrowser = forwardRef(({ projectPath, theme: themeOverride, onP
|
|
|
826
830
|
...style,
|
|
827
831
|
}, children: [jsx(BrowserHeader, { projectPath: projectPath }), jsx(BrowserToolbar, {}), jsx(TabBar, {}), jsxs("div", { style: { flex: 1, overflow: 'auto' }, children: [state.tab === 'assets' &&
|
|
828
832
|
(state.viewMode === 'tree' && state.projectInfo ? (jsx("div", { style: { padding: 8 }, children: jsx(FolderTreeItem, { folder: state.projectInfo.folders, indent: 0 }) })) : (jsx(AssetGridView, {}))), state.tab === 'scenes' && jsx(ScenesPanel, {}), state.tab === 'packages' && jsx(PackagesPanel, {}), state.tab === 'settings' && jsx(SettingsPanel, {})] }), jsx(PreviewPanel, {}), jsx(ImportProgressOverlay, {})] }) }));
|
|
829
|
-
});
|
|
830
|
-
UnityProjectBrowser.displayName = 'UnityProjectBrowser';
|
|
833
|
+
}), { displayName: 'UnityProjectBrowser' });
|
|
831
834
|
|
|
832
835
|
export { UnityProjectBrowser };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { NiceIcon } from '@nice2dev/ui';
|
|
3
|
-
import {
|
|
3
|
+
import { forwardRef, useReducer, useMemo, useCallback, useImperativeHandle, createContext, useContext } from 'react';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_THEME = {
|
|
6
6
|
background: '#1c1c1c',
|
|
@@ -99,7 +99,7 @@ const INITIAL_STATE = {
|
|
|
99
99
|
tab: 'content',
|
|
100
100
|
tileSize: 'medium',
|
|
101
101
|
};
|
|
102
|
-
const BrowserContext = createContext(null);
|
|
102
|
+
const BrowserContext = /* @__PURE__ */ createContext(null);
|
|
103
103
|
function useBrowser() {
|
|
104
104
|
const ctx = useContext(BrowserContext);
|
|
105
105
|
if (!ctx) {
|
|
@@ -696,7 +696,8 @@ const DEMO_PROJECT = {
|
|
|
696
696
|
defaultPawn: '/Game/Blueprints/BP_Player',
|
|
697
697
|
},
|
|
698
698
|
};
|
|
699
|
-
const UnrealProjectBrowser =
|
|
699
|
+
const UnrealProjectBrowser = /* @__PURE__ */ Object.assign(
|
|
700
|
+
/* @__PURE__ */ forwardRef(({ projectPath: _projectPath, theme: themeOverride, onProjectLoad, onImport, onLiveLinkConnect, onLiveLinkDisconnect, onHotReload, className, style, }, ref) => {
|
|
700
701
|
const [state, dispatch] = useReducer(browserReducer, {
|
|
701
702
|
...INITIAL_STATE,
|
|
702
703
|
projectInfo: DEMO_PROJECT,
|
|
@@ -781,7 +782,7 @@ const UnrealProjectBrowser = forwardRef(({ projectPath: _projectPath, theme: the
|
|
|
781
782
|
},
|
|
782
783
|
});
|
|
783
784
|
}
|
|
784
|
-
catch
|
|
785
|
+
catch {
|
|
785
786
|
dispatch({
|
|
786
787
|
type: 'SET_LIVE_LINK_STATUS',
|
|
787
788
|
status: { ...state.liveLinkStatus, compiling: false },
|
|
@@ -828,7 +829,6 @@ const UnrealProjectBrowser = forwardRef(({ projectPath: _projectPath, theme: the
|
|
|
828
829
|
overflow: 'hidden',
|
|
829
830
|
...style,
|
|
830
831
|
}, children: [jsx(BrowserHeader, {}), jsx(BrowserToolbar, {}), jsx(TabBar, {}), jsxs("div", { style: { flex: 1, overflow: 'auto' }, children: [state.tab === 'content' && jsx(ContentPanel, {}), state.tab === 'levels' && jsx(LevelsPanel, {}), state.tab === 'plugins' && jsx(PluginsPanel, {}), state.tab === 'modules' && jsx(ModulesPanel, {}), state.tab === 'settings' && jsx(SettingsPanel, {})] })] }) }));
|
|
831
|
-
});
|
|
832
|
-
UnrealProjectBrowser.displayName = 'UnrealProjectBrowser';
|
|
832
|
+
}), { displayName: 'UnrealProjectBrowser' });
|
|
833
833
|
|
|
834
834
|
export { UnrealProjectBrowser };
|
|
@@ -108,7 +108,7 @@ export declare abstract class BTNode {
|
|
|
108
108
|
lastExecutionTime: number;
|
|
109
109
|
constructor(type: string, category: BTNodeType, name: string);
|
|
110
110
|
/** Initialize the node */
|
|
111
|
-
initialize(
|
|
111
|
+
initialize(_context: BTContext): void;
|
|
112
112
|
/** Tick the node */
|
|
113
113
|
abstract tick(context: BTContext): BTStatus;
|
|
114
114
|
/** Reset the node state */
|
|
@@ -161,7 +161,7 @@ export declare class BTParallel extends BTComposite {
|
|
|
161
161
|
failurePolicy: 'all' | 'one';
|
|
162
162
|
private childStatuses;
|
|
163
163
|
constructor(name?: string);
|
|
164
|
-
initialize(
|
|
164
|
+
initialize(_context: BTContext): void;
|
|
165
165
|
tick(context: BTContext): BTStatus;
|
|
166
166
|
reset(): void;
|
|
167
167
|
clone(): BTParallel;
|
|
@@ -170,7 +170,7 @@ export declare class BTParallel extends BTComposite {
|
|
|
170
170
|
export declare class BTRandomSelector extends BTComposite {
|
|
171
171
|
private shuffledOrder;
|
|
172
172
|
constructor(name?: string);
|
|
173
|
-
initialize(
|
|
173
|
+
initialize(_context: BTContext): void;
|
|
174
174
|
private shuffle;
|
|
175
175
|
tick(context: BTContext): BTStatus;
|
|
176
176
|
clone(): BTRandomSelector;
|
|
@@ -179,7 +179,7 @@ export declare class BTRandomSelector extends BTComposite {
|
|
|
179
179
|
export declare class BTRandomSequence extends BTComposite {
|
|
180
180
|
private shuffledOrder;
|
|
181
181
|
constructor(name?: string);
|
|
182
|
-
initialize(
|
|
182
|
+
initialize(_context: BTContext): void;
|
|
183
183
|
private shuffle;
|
|
184
184
|
tick(context: BTContext): BTStatus;
|
|
185
185
|
clone(): BTRandomSequence;
|
|
@@ -176,7 +176,7 @@ export declare class CraftingEditor {
|
|
|
176
176
|
processQueueItem(playerId: string): CraftingProgress | null;
|
|
177
177
|
discoverRecipe(recipeId: string, playerId: string): boolean;
|
|
178
178
|
isRecipeDiscovered(recipeId: string): boolean;
|
|
179
|
-
canSalvage(itemId: string,
|
|
179
|
+
canSalvage(itemId: string, _playerId: string): boolean;
|
|
180
180
|
salvageItem(itemId: string, _playerId: string, quantity?: number): CraftingOutput[] | null;
|
|
181
181
|
setPlayerSkill(skillId: string, level: number): void;
|
|
182
182
|
setPlayerItem(itemId: string, count: number): void;
|
|
@@ -82,5 +82,7 @@ export interface GodotProjectBrowserRef {
|
|
|
82
82
|
getSelectedResources: () => GodotResource[];
|
|
83
83
|
importSelected: () => Promise<void>;
|
|
84
84
|
}
|
|
85
|
-
export declare const GodotProjectBrowser: React.ForwardRefExoticComponent<GodotProjectBrowserProps & React.RefAttributes<GodotProjectBrowserRef
|
|
85
|
+
export declare const GodotProjectBrowser: React.ForwardRefExoticComponent<GodotProjectBrowserProps & React.RefAttributes<GodotProjectBrowserRef>> & {
|
|
86
|
+
displayName: string;
|
|
87
|
+
};
|
|
86
88
|
export default GodotProjectBrowser;
|
|
@@ -63,5 +63,7 @@ export interface UnityAssetStoreBrowserRef {
|
|
|
63
63
|
getCart: () => string[];
|
|
64
64
|
clearCart: () => void;
|
|
65
65
|
}
|
|
66
|
-
export declare const UnityAssetStoreBrowser: React.ForwardRefExoticComponent<UnityAssetStoreBrowserProps & React.RefAttributes<UnityAssetStoreBrowserRef
|
|
66
|
+
export declare const UnityAssetStoreBrowser: React.ForwardRefExoticComponent<UnityAssetStoreBrowserProps & React.RefAttributes<UnityAssetStoreBrowserRef>> & {
|
|
67
|
+
displayName: string;
|
|
68
|
+
};
|
|
67
69
|
export default UnityAssetStoreBrowser;
|
|
@@ -86,5 +86,7 @@ export interface UnityProjectBrowserRef {
|
|
|
86
86
|
getSelectedAssets: () => UnityProjectAsset[];
|
|
87
87
|
importSelected: () => Promise<void>;
|
|
88
88
|
}
|
|
89
|
-
export declare const UnityProjectBrowser: React.ForwardRefExoticComponent<UnityProjectBrowserProps & React.RefAttributes<UnityProjectBrowserRef
|
|
89
|
+
export declare const UnityProjectBrowser: React.ForwardRefExoticComponent<UnityProjectBrowserProps & React.RefAttributes<UnityProjectBrowserRef>> & {
|
|
90
|
+
displayName: string;
|
|
91
|
+
};
|
|
90
92
|
export default UnityProjectBrowser;
|
|
@@ -94,5 +94,7 @@ export interface UnrealProjectBrowserRef {
|
|
|
94
94
|
importSelected: () => Promise<void>;
|
|
95
95
|
triggerHotReload: () => Promise<void>;
|
|
96
96
|
}
|
|
97
|
-
export declare const UnrealProjectBrowser: React.ForwardRefExoticComponent<UnrealProjectBrowserProps & React.RefAttributes<UnrealProjectBrowserRef
|
|
97
|
+
export declare const UnrealProjectBrowser: React.ForwardRefExoticComponent<UnrealProjectBrowserProps & React.RefAttributes<UnrealProjectBrowserRef>> & {
|
|
98
|
+
displayName: string;
|
|
99
|
+
};
|
|
98
100
|
export default UnrealProjectBrowser;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice2dev/game-engine",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Nice2Dev Game Engine — No-code game engine and editor for React",
|
|
5
5
|
"author": "NiceToDev <contact@nicetodev.com>",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"nicetodev"
|
|
61
61
|
],
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@nice2dev/icons-gaming": "^1.0
|
|
64
|
-
"@nice2dev/ui": "^1.0
|
|
65
|
-
"@nice2dev/ui-graphics": "^1.
|
|
63
|
+
"@nice2dev/icons-gaming": "^1.2.0",
|
|
64
|
+
"@nice2dev/ui": "^1.2.0",
|
|
65
|
+
"@nice2dev/ui-graphics": "^1.2.0",
|
|
66
66
|
"react": ">=17.0.0",
|
|
67
67
|
"react-dom": ">=17.0.0"
|
|
68
68
|
},
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@microsoft/signalr": "^10.0.11",
|
|
76
|
-
"@nice2dev/ui": "^1.2.
|
|
76
|
+
"@nice2dev/ui": "^1.2.1",
|
|
77
77
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
78
78
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
79
79
|
"@rollup/plugin-typescript": "^12.3.0",
|