@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
|
@@ -985,7 +985,7 @@ class InventoryManager {
|
|
|
985
985
|
/* ═══════════════════════════════════════════════════════════════
|
|
986
986
|
REACT INTEGRATION
|
|
987
987
|
══════════════════════════════════════════════════════════════════ */
|
|
988
|
-
const InventoryContext = React.createContext(null);
|
|
988
|
+
const InventoryContext = /* @__PURE__ */ React.createContext(null);
|
|
989
989
|
const InventoryProvider = ({ manager, children }) => {
|
|
990
990
|
return React.createElement(InventoryContext.Provider, { value: manager }, children);
|
|
991
991
|
};
|
|
@@ -634,37 +634,48 @@ class PostProcessStack {
|
|
|
634
634
|
this.passes = [];
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
const QUALITY_PRESET_CONFIGS = {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
medium: {
|
|
646
|
-
sampleCount: 1,
|
|
647
|
-
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 1024, cascadeCount: 2 },
|
|
648
|
-
postProcess: { ...DEFAULT_RENDER_CONFIG.postProcess, effects: [FXAA_DEFAULTS] },
|
|
649
|
-
depthPrepassEnabled: false,
|
|
650
|
-
},
|
|
651
|
-
high: {
|
|
652
|
-
sampleCount: 4,
|
|
653
|
-
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 2048, cascadeCount: 4 },
|
|
654
|
-
postProcess: { ...DEFAULT_RENDER_CONFIG.postProcess, effects: [FXAA_DEFAULTS, BLOOM_DEFAULTS] },
|
|
655
|
-
depthPrepassEnabled: true,
|
|
656
|
-
},
|
|
657
|
-
ultra: {
|
|
658
|
-
sampleCount: 4,
|
|
659
|
-
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 4096, cascadeCount: 4, pcfRadius: 3 },
|
|
660
|
-
postProcess: {
|
|
661
|
-
...DEFAULT_RENDER_CONFIG.postProcess,
|
|
662
|
-
effects: [FXAA_DEFAULTS, BLOOM_DEFAULTS, SSAO_DEFAULTS, DOF_DEFAULTS, COLOR_GRADING_DEFAULTS],
|
|
637
|
+
const QUALITY_PRESET_CONFIGS = /* @__PURE__ */ (function () {
|
|
638
|
+
return {
|
|
639
|
+
low: {
|
|
640
|
+
sampleCount: 1,
|
|
641
|
+
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, enabled: false },
|
|
642
|
+
postProcess: { ...DEFAULT_RENDER_CONFIG.postProcess, hdrEnabled: false, effects: [] },
|
|
643
|
+
depthPrepassEnabled: false,
|
|
644
|
+
occlusionCulling: false,
|
|
663
645
|
},
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
}
|
|
646
|
+
medium: {
|
|
647
|
+
sampleCount: 1,
|
|
648
|
+
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 1024, cascadeCount: 2 },
|
|
649
|
+
postProcess: { ...DEFAULT_RENDER_CONFIG.postProcess, effects: [FXAA_DEFAULTS] },
|
|
650
|
+
depthPrepassEnabled: false,
|
|
651
|
+
},
|
|
652
|
+
high: {
|
|
653
|
+
sampleCount: 4,
|
|
654
|
+
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 2048, cascadeCount: 4 },
|
|
655
|
+
postProcess: {
|
|
656
|
+
...DEFAULT_RENDER_CONFIG.postProcess,
|
|
657
|
+
effects: [FXAA_DEFAULTS, BLOOM_DEFAULTS],
|
|
658
|
+
},
|
|
659
|
+
depthPrepassEnabled: true,
|
|
660
|
+
},
|
|
661
|
+
ultra: {
|
|
662
|
+
sampleCount: 4,
|
|
663
|
+
shadows: { ...DEFAULT_RENDER_CONFIG.shadows, mapSize: 4096, cascadeCount: 4, pcfRadius: 3 },
|
|
664
|
+
postProcess: {
|
|
665
|
+
...DEFAULT_RENDER_CONFIG.postProcess,
|
|
666
|
+
effects: [
|
|
667
|
+
FXAA_DEFAULTS,
|
|
668
|
+
BLOOM_DEFAULTS,
|
|
669
|
+
SSAO_DEFAULTS,
|
|
670
|
+
DOF_DEFAULTS,
|
|
671
|
+
COLOR_GRADING_DEFAULTS,
|
|
672
|
+
],
|
|
673
|
+
},
|
|
674
|
+
depthPrepassEnabled: true,
|
|
675
|
+
occlusionCulling: true,
|
|
676
|
+
},
|
|
677
|
+
};
|
|
678
|
+
})();
|
|
668
679
|
function applyQualityPreset(preset) {
|
|
669
680
|
return { ...DEFAULT_RENDER_CONFIG, ...QUALITY_PRESET_CONFIGS[preset] };
|
|
670
681
|
}
|
|
@@ -300,7 +300,7 @@ class UnityProjectImporter {
|
|
|
300
300
|
const parts = path.replace(/\\/g, '/').split('/');
|
|
301
301
|
return parts[parts.length - 1] || 'UnknownProject';
|
|
302
302
|
}
|
|
303
|
-
async detectUnityVersion(
|
|
303
|
+
async detectUnityVersion(_projectPath) {
|
|
304
304
|
// Read ProjectSettings/ProjectVersion.txt
|
|
305
305
|
// In real implementation, read from file system
|
|
306
306
|
// Format: m_EditorVersion: 2022.3.10f1
|
|
@@ -596,7 +596,7 @@ class UnityProjectImporter {
|
|
|
596
596
|
field.tooltip = tooltipMatch[1];
|
|
597
597
|
}
|
|
598
598
|
// Range
|
|
599
|
-
const rangeMatch = attrBlock.match(/\[Range\(([^,]+),\s*([
|
|
599
|
+
const rangeMatch = attrBlock.match(/\[Range\(([^,]+),\s*([^)]+)\)\]/);
|
|
600
600
|
if (rangeMatch) {
|
|
601
601
|
field.range = {
|
|
602
602
|
min: parseFloat(rangeMatch[1]),
|
|
@@ -80,7 +80,7 @@ const INITIAL_STATE = {
|
|
|
80
80
|
view: 'grid',
|
|
81
81
|
myAssets: false,
|
|
82
82
|
};
|
|
83
|
-
const StoreContext = React.createContext(null);
|
|
83
|
+
const StoreContext = /* @__PURE__ */ React.createContext(null);
|
|
84
84
|
function useStore() {
|
|
85
85
|
const ctx = React.useContext(StoreContext);
|
|
86
86
|
if (!ctx) {
|
|
@@ -697,7 +697,8 @@ const DEMO_ASSETS = [
|
|
|
697
697
|
url: 'https://assetstore.unity.com/',
|
|
698
698
|
},
|
|
699
699
|
];
|
|
700
|
-
const UnityAssetStoreBrowser =
|
|
700
|
+
const UnityAssetStoreBrowser = /* @__PURE__ */ Object.assign(
|
|
701
|
+
/* @__PURE__ */ React.forwardRef(({ theme: themeOverride, onDownload, onPurchase: _onPurchase, className, style }, ref) => {
|
|
701
702
|
const [state, dispatch] = React.useReducer(storeReducer, {
|
|
702
703
|
...INITIAL_STATE,
|
|
703
704
|
results: DEMO_ASSETS,
|
|
@@ -793,7 +794,6 @@ const UnityAssetStoreBrowser = React.forwardRef(({ theme: themeOverride, onDownl
|
|
|
793
794
|
overflow: 'hidden',
|
|
794
795
|
...style,
|
|
795
796
|
}, children: [jsxRuntime.jsx(SearchHeader, {}), jsxRuntime.jsx("div", { style: { flex: 1, overflow: 'auto' }, children: jsxRuntime.jsx(AssetGrid, {}) }), jsxRuntime.jsx(AssetDetailModal, {})] }) }));
|
|
796
|
-
});
|
|
797
|
-
UnityAssetStoreBrowser.displayName = 'UnityAssetStoreBrowser';
|
|
797
|
+
}), { displayName: 'UnityAssetStoreBrowser' });
|
|
798
798
|
|
|
799
799
|
exports.UnityAssetStoreBrowser = UnityAssetStoreBrowser;
|
|
@@ -93,7 +93,7 @@ const INITIAL_STATE = {
|
|
|
93
93
|
liveLinkStatus: { connected: false, playMode: 'stopped' },
|
|
94
94
|
tab: 'assets',
|
|
95
95
|
};
|
|
96
|
-
const BrowserContext = React.createContext(null);
|
|
96
|
+
const BrowserContext = /* @__PURE__ */ React.createContext(null);
|
|
97
97
|
function useBrowser() {
|
|
98
98
|
const ctx = React.useContext(BrowserContext);
|
|
99
99
|
if (!ctx) {
|
|
@@ -703,7 +703,8 @@ const DEMO_PROJECT = {
|
|
|
703
703
|
{ path: 'Assets/Scenes/Level2.unity', enabled: true },
|
|
704
704
|
],
|
|
705
705
|
};
|
|
706
|
-
const UnityProjectBrowser =
|
|
706
|
+
const UnityProjectBrowser = /* @__PURE__ */ Object.assign(
|
|
707
|
+
/* @__PURE__ */ React.forwardRef(({ projectPath, theme: themeOverride, onProjectLoad, onImport, onLiveLinkConnect, onLiveLinkDisconnect, className, style, }, ref) => {
|
|
707
708
|
const [state, dispatch] = React.useReducer(browserReducer, {
|
|
708
709
|
...INITIAL_STATE,
|
|
709
710
|
projectInfo: DEMO_PROJECT,
|
|
@@ -791,7 +792,10 @@ const UnityProjectBrowser = React.forwardRef(({ projectPath, theme: themeOverrid
|
|
|
791
792
|
}, [onLiveLinkConnect]);
|
|
792
793
|
const disconnectLiveLink = React.useCallback(() => {
|
|
793
794
|
onLiveLinkDisconnect?.();
|
|
794
|
-
dispatch({
|
|
795
|
+
dispatch({
|
|
796
|
+
type: 'SET_LIVE_LINK_STATUS',
|
|
797
|
+
status: { connected: false, playMode: 'stopped' },
|
|
798
|
+
});
|
|
795
799
|
}, [onLiveLinkDisconnect]);
|
|
796
800
|
// Imperative handle
|
|
797
801
|
React.useImperativeHandle(ref, () => ({
|
|
@@ -828,7 +832,6 @@ const UnityProjectBrowser = React.forwardRef(({ projectPath, theme: themeOverrid
|
|
|
828
832
|
...style,
|
|
829
833
|
}, children: [jsxRuntime.jsx(BrowserHeader, { projectPath: projectPath }), jsxRuntime.jsx(BrowserToolbar, {}), jsxRuntime.jsx(TabBar, {}), jsxRuntime.jsxs("div", { style: { flex: 1, overflow: 'auto' }, children: [state.tab === 'assets' &&
|
|
830
834
|
(state.viewMode === 'tree' && state.projectInfo ? (jsxRuntime.jsx("div", { style: { padding: 8 }, children: jsxRuntime.jsx(FolderTreeItem, { folder: state.projectInfo.folders, indent: 0 }) })) : (jsxRuntime.jsx(AssetGridView, {}))), state.tab === 'scenes' && jsxRuntime.jsx(ScenesPanel, {}), state.tab === 'packages' && jsxRuntime.jsx(PackagesPanel, {}), state.tab === 'settings' && jsxRuntime.jsx(SettingsPanel, {})] }), jsxRuntime.jsx(PreviewPanel, {}), jsxRuntime.jsx(ImportProgressOverlay, {})] }) }));
|
|
831
|
-
});
|
|
832
|
-
UnityProjectBrowser.displayName = 'UnityProjectBrowser';
|
|
835
|
+
}), { displayName: 'UnityProjectBrowser' });
|
|
833
836
|
|
|
834
837
|
exports.UnityProjectBrowser = UnityProjectBrowser;
|
|
@@ -101,7 +101,7 @@ const INITIAL_STATE = {
|
|
|
101
101
|
tab: 'content',
|
|
102
102
|
tileSize: 'medium',
|
|
103
103
|
};
|
|
104
|
-
const BrowserContext = React.createContext(null);
|
|
104
|
+
const BrowserContext = /* @__PURE__ */ React.createContext(null);
|
|
105
105
|
function useBrowser() {
|
|
106
106
|
const ctx = React.useContext(BrowserContext);
|
|
107
107
|
if (!ctx) {
|
|
@@ -698,7 +698,8 @@ const DEMO_PROJECT = {
|
|
|
698
698
|
defaultPawn: '/Game/Blueprints/BP_Player',
|
|
699
699
|
},
|
|
700
700
|
};
|
|
701
|
-
const UnrealProjectBrowser =
|
|
701
|
+
const UnrealProjectBrowser = /* @__PURE__ */ Object.assign(
|
|
702
|
+
/* @__PURE__ */ React.forwardRef(({ projectPath: _projectPath, theme: themeOverride, onProjectLoad, onImport, onLiveLinkConnect, onLiveLinkDisconnect, onHotReload, className, style, }, ref) => {
|
|
702
703
|
const [state, dispatch] = React.useReducer(browserReducer, {
|
|
703
704
|
...INITIAL_STATE,
|
|
704
705
|
projectInfo: DEMO_PROJECT,
|
|
@@ -783,7 +784,7 @@ const UnrealProjectBrowser = React.forwardRef(({ projectPath: _projectPath, them
|
|
|
783
784
|
},
|
|
784
785
|
});
|
|
785
786
|
}
|
|
786
|
-
catch
|
|
787
|
+
catch {
|
|
787
788
|
dispatch({
|
|
788
789
|
type: 'SET_LIVE_LINK_STATUS',
|
|
789
790
|
status: { ...state.liveLinkStatus, compiling: false },
|
|
@@ -830,7 +831,6 @@ const UnrealProjectBrowser = React.forwardRef(({ projectPath: _projectPath, them
|
|
|
830
831
|
overflow: 'hidden',
|
|
831
832
|
...style,
|
|
832
833
|
}, children: [jsxRuntime.jsx(BrowserHeader, {}), jsxRuntime.jsx(BrowserToolbar, {}), jsxRuntime.jsx(TabBar, {}), jsxRuntime.jsxs("div", { style: { flex: 1, overflow: 'auto' }, children: [state.tab === 'content' && jsxRuntime.jsx(ContentPanel, {}), state.tab === 'levels' && jsxRuntime.jsx(LevelsPanel, {}), state.tab === 'plugins' && jsxRuntime.jsx(PluginsPanel, {}), state.tab === 'modules' && jsxRuntime.jsx(ModulesPanel, {}), state.tab === 'settings' && jsxRuntime.jsx(SettingsPanel, {})] })] }) }));
|
|
833
|
-
});
|
|
834
|
-
UnrealProjectBrowser.displayName = 'UnrealProjectBrowser';
|
|
834
|
+
}), { displayName: 'UnrealProjectBrowser' });
|
|
835
835
|
|
|
836
836
|
exports.UnrealProjectBrowser = UnrealProjectBrowser;
|
|
@@ -126,7 +126,7 @@ class BTNode {
|
|
|
126
126
|
this.name = name;
|
|
127
127
|
}
|
|
128
128
|
/** Initialize the node */
|
|
129
|
-
initialize(
|
|
129
|
+
initialize(_context) { }
|
|
130
130
|
/** Reset the node state */
|
|
131
131
|
reset() {
|
|
132
132
|
this.lastStatus = 'inactive';
|
|
@@ -264,7 +264,7 @@ class BTParallel extends BTComposite {
|
|
|
264
264
|
this.failurePolicy = 'one';
|
|
265
265
|
this.childStatuses = [];
|
|
266
266
|
}
|
|
267
|
-
initialize(
|
|
267
|
+
initialize(_context) {
|
|
268
268
|
this.childStatuses = new Array(this.children.length).fill('running');
|
|
269
269
|
}
|
|
270
270
|
tick(context) {
|
|
@@ -348,7 +348,7 @@ class BTRandomSelector extends BTComposite {
|
|
|
348
348
|
super('randomSelector', name);
|
|
349
349
|
this.shuffledOrder = [];
|
|
350
350
|
}
|
|
351
|
-
initialize(
|
|
351
|
+
initialize(_context) {
|
|
352
352
|
this.shuffle();
|
|
353
353
|
}
|
|
354
354
|
shuffle() {
|
|
@@ -398,7 +398,7 @@ class BTRandomSequence extends BTComposite {
|
|
|
398
398
|
super('randomSequence', name);
|
|
399
399
|
this.shuffledOrder = [];
|
|
400
400
|
}
|
|
401
|
-
initialize(
|
|
401
|
+
initialize(_context) {
|
|
402
402
|
this.shuffle();
|
|
403
403
|
}
|
|
404
404
|
shuffle() {
|
|
@@ -452,6 +452,8 @@ const GameAudioSettings = ({ bridge, className, style, }) => {
|
|
|
452
452
|
},
|
|
453
453
|
}, `${Math.round((volumes[bus] ?? 1) * 100)}%`))));
|
|
454
454
|
};
|
|
455
|
-
|
|
455
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
456
|
+
GameAudioSettings.displayName = 'GameAudioSettings';
|
|
457
|
+
}
|
|
456
458
|
|
|
457
459
|
export { AudioBusMixer, DEFAULT_SPATIAL, GameAudioBridge, GameAudioSettings, MusicManager, SFXPool, useGameAudio };
|
|
@@ -272,7 +272,7 @@ window/size/viewport_height=1080
|
|
|
272
272
|
renderer/rendering_method="${config.scriptLanguage === 'csharp' ? 'forward_plus' : 'mobile'}"
|
|
273
273
|
`;
|
|
274
274
|
}
|
|
275
|
-
generateExportPresets(
|
|
275
|
+
generateExportPresets(_config) {
|
|
276
276
|
return `[preset.0]
|
|
277
277
|
|
|
278
278
|
name="Linux/X11"
|
|
@@ -331,7 +331,7 @@ class UnrealBuildCloud {
|
|
|
331
331
|
],
|
|
332
332
|
}, null, 2);
|
|
333
333
|
}
|
|
334
|
-
generateDefaultGameIni(
|
|
334
|
+
generateDefaultGameIni(_config) {
|
|
335
335
|
return `[/Script/EngineSettings.GeneralProjectSettings]
|
|
336
336
|
ProjectID=${this.generateGuid()}
|
|
337
337
|
ProjectName=Nice2Dev Project
|
|
@@ -19,15 +19,17 @@ const DEFAULT_RENDERING = {
|
|
|
19
19
|
antiAlias: true,
|
|
20
20
|
backgroundColor: WHITE,
|
|
21
21
|
};
|
|
22
|
-
const DEFAULT_SETTINGS = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
22
|
+
const DEFAULT_SETTINGS = /* @__PURE__ */ (function () {
|
|
23
|
+
return {
|
|
24
|
+
width: 1280,
|
|
25
|
+
height: 720,
|
|
26
|
+
targetFps: 60,
|
|
27
|
+
maxPlayers: 4,
|
|
28
|
+
physics: { ...DEFAULT_PHYSICS },
|
|
29
|
+
audio: { ...DEFAULT_AUDIO },
|
|
30
|
+
rendering: { ...DEFAULT_RENDERING },
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
31
33
|
class GameConfig {
|
|
32
34
|
constructor(overrides) {
|
|
33
35
|
this._settings = mergeSettings(DEFAULT_SETTINGS, overrides ?? {});
|
|
@@ -661,6 +661,8 @@ const AnalyticsDashboard = ({ analytics, className, style, }) => {
|
|
|
661
661
|
style: { padding: 16, fontFamily: 'monospace', fontSize: 13, ...style },
|
|
662
662
|
}, React.createElement('h3', { style: { margin: '0 0 12px 0' } }, 'Gameplay Analytics'), React.createElement('div', { style: statStyle }, React.createElement('span', null, 'Session ID'), React.createElement('code', null, summary.sessionId)), React.createElement('div', { style: statStyle }, React.createElement('span', null, 'Total Events'), React.createElement('span', null, String(summary.totalEvents))), React.createElement('div', { style: statStyle }, React.createElement('span', null, 'Heatmaps'), React.createElement('span', null, String(summary.heatmapCount))), React.createElement('div', { style: statStyle }, React.createElement('span', null, 'Recording'), React.createElement('span', null, summary.isRecording ? `ON (${summary.recordedFrames} frames)` : 'OFF')));
|
|
663
663
|
};
|
|
664
|
-
|
|
664
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
665
|
+
AnalyticsDashboard.displayName = 'AnalyticsDashboard';
|
|
666
|
+
}
|
|
665
667
|
|
|
666
668
|
export { AnalyticsDashboard, DEFAULT_HEATMAP_CONFIG, DEFAULT_RECORDING_CONFIG, DEFAULT_TELEMETRY_CONFIG, FunnelTracker, GameplayAnalytics, HeatmapGenerator, SessionPlayer, SessionRecorder, TelemetryPipeline, useGameplayAnalytics };
|
|
@@ -19,114 +19,116 @@
|
|
|
19
19
|
// ============================================================
|
|
20
20
|
// Math Utilities
|
|
21
21
|
// ============================================================
|
|
22
|
-
const MathUtils = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
dot
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
22
|
+
const MathUtils = /* @__PURE__ */ (function () {
|
|
23
|
+
return {
|
|
24
|
+
vector3Zero() {
|
|
25
|
+
return { x: 0, y: 0, z: 0 };
|
|
26
|
+
},
|
|
27
|
+
vector3One() {
|
|
28
|
+
return { x: 1, y: 1, z: 1 };
|
|
29
|
+
},
|
|
30
|
+
quaternionIdentity() {
|
|
31
|
+
return { x: 0, y: 0, z: 0, w: 1 };
|
|
32
|
+
},
|
|
33
|
+
multiplyQuaternion(a, b) {
|
|
34
|
+
return {
|
|
35
|
+
x: a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,
|
|
36
|
+
y: a.w * b.y - a.x * b.z + a.y * b.w + a.z * b.x,
|
|
37
|
+
z: a.w * b.z + a.x * b.y - a.y * b.x + a.z * b.w,
|
|
38
|
+
w: a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z,
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
inverseQuaternion(q) {
|
|
42
|
+
const lengthSq = q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w;
|
|
43
|
+
if (lengthSq === 0) {
|
|
44
|
+
return this.quaternionIdentity();
|
|
45
|
+
}
|
|
46
|
+
const inv = 1 / lengthSq;
|
|
47
|
+
return {
|
|
48
|
+
x: -q.x * inv,
|
|
49
|
+
y: -q.y * inv,
|
|
50
|
+
z: -q.z * inv,
|
|
51
|
+
w: q.w * inv,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
slerpQuaternion(a, b, t) {
|
|
55
|
+
let dot = a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w;
|
|
56
|
+
// Ensure shortest path
|
|
57
|
+
const bNeg = { ...b };
|
|
58
|
+
if (dot < 0) {
|
|
59
|
+
dot = -dot;
|
|
60
|
+
bNeg.x = -bNeg.x;
|
|
61
|
+
bNeg.y = -bNeg.y;
|
|
62
|
+
bNeg.z = -bNeg.z;
|
|
63
|
+
bNeg.w = -bNeg.w;
|
|
64
|
+
}
|
|
65
|
+
// Linear interpolation for very close quaternions
|
|
66
|
+
if (dot > 0.9995) {
|
|
67
|
+
return this.normalizeQuaternion({
|
|
68
|
+
x: a.x + t * (bNeg.x - a.x),
|
|
69
|
+
y: a.y + t * (bNeg.y - a.y),
|
|
70
|
+
z: a.z + t * (bNeg.z - a.z),
|
|
71
|
+
w: a.w + t * (bNeg.w - a.w),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const theta = Math.acos(dot);
|
|
75
|
+
const sinTheta = Math.sin(theta);
|
|
76
|
+
const wa = Math.sin((1 - t) * theta) / sinTheta;
|
|
77
|
+
const wb = Math.sin(t * theta) / sinTheta;
|
|
78
|
+
return {
|
|
79
|
+
x: wa * a.x + wb * bNeg.x,
|
|
80
|
+
y: wa * a.y + wb * bNeg.y,
|
|
81
|
+
z: wa * a.z + wb * bNeg.z,
|
|
82
|
+
w: wa * a.w + wb * bNeg.w,
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
normalizeQuaternion(q) {
|
|
86
|
+
const length = Math.sqrt(q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w);
|
|
87
|
+
if (length === 0) {
|
|
88
|
+
return this.quaternionIdentity();
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
x: q.x / length,
|
|
92
|
+
y: q.y / length,
|
|
93
|
+
z: q.z / length,
|
|
94
|
+
w: q.w / length,
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
lerpVector3(a, b, t) {
|
|
98
|
+
return {
|
|
99
|
+
x: a.x + (b.x - a.x) * t,
|
|
100
|
+
y: a.y + (b.y - a.y) * t,
|
|
101
|
+
z: a.z + (b.z - a.z) * t,
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
multiplyVector3(v, scalar) {
|
|
105
|
+
return { x: v.x * scalar, y: v.y * scalar, z: v.z * scalar };
|
|
106
|
+
},
|
|
107
|
+
addVector3(a, b) {
|
|
108
|
+
return { x: a.x + b.x, y: a.y + b.y, z: a.z + b.z };
|
|
109
|
+
},
|
|
110
|
+
mirrorVector3X(v) {
|
|
111
|
+
return { x: -v.x, y: v.y, z: v.z };
|
|
112
|
+
},
|
|
113
|
+
mirrorQuaternionX(q) {
|
|
114
|
+
return { x: q.x, y: -q.y, z: -q.z, w: q.w };
|
|
115
|
+
},
|
|
116
|
+
eulerToQuaternion(euler) {
|
|
117
|
+
const c1 = Math.cos(euler.x / 2);
|
|
118
|
+
const c2 = Math.cos(euler.y / 2);
|
|
119
|
+
const c3 = Math.cos(euler.z / 2);
|
|
120
|
+
const s1 = Math.sin(euler.x / 2);
|
|
121
|
+
const s2 = Math.sin(euler.y / 2);
|
|
122
|
+
const s3 = Math.sin(euler.z / 2);
|
|
123
|
+
return {
|
|
124
|
+
x: s1 * c2 * c3 + c1 * s2 * s3,
|
|
125
|
+
y: c1 * s2 * c3 - s1 * c2 * s3,
|
|
126
|
+
z: c1 * c2 * s3 + s1 * s2 * c3,
|
|
127
|
+
w: c1 * c2 * c3 - s1 * s2 * s3,
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
})();
|
|
130
132
|
// ============================================================
|
|
131
133
|
// Animation Retargeting System
|
|
132
134
|
// ============================================================
|
|
@@ -415,7 +415,7 @@ class CraftingEditor {
|
|
|
415
415
|
this.activeProgress.delete(progressId);
|
|
416
416
|
this.onCraftingCompleted?.(recipe, outputs, quality);
|
|
417
417
|
}
|
|
418
|
-
determineQuality(recipe,
|
|
418
|
+
determineQuality(recipe, _playerId) {
|
|
419
419
|
const qualities = [
|
|
420
420
|
'poor',
|
|
421
421
|
'normal',
|
|
@@ -533,7 +533,7 @@ class CraftingEditor {
|
|
|
533
533
|
return this.discoveredRecipes.has(recipeId);
|
|
534
534
|
}
|
|
535
535
|
// ─── Salvage ───────────────────────────────────────────
|
|
536
|
-
canSalvage(itemId,
|
|
536
|
+
canSalvage(itemId, _playerId) {
|
|
537
537
|
const rule = this.salvageRules.get(itemId);
|
|
538
538
|
if (!rule) {
|
|
539
539
|
return false;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { NiceTutorialButton, resolveTutorial, NiceIcon } from '@nice2dev/ui';
|
|
3
|
-
import React, {
|
|
3
|
+
import React, { useReducer, useRef, useState, useCallback, useMemo, useContext, useEffect, createContext } from 'react';
|
|
4
4
|
import { EventBus } from '../core/EventBus.js';
|
|
5
5
|
import { World } from '../ecs/World.js';
|
|
6
6
|
import { useTranslation } from '../i18n/useTranslation.js';
|
|
@@ -119,7 +119,7 @@ function editorReducer(state, action) {
|
|
|
119
119
|
return state;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
const EditorContext = createContext(null);
|
|
122
|
+
const EditorContext = /* @__PURE__ */ createContext(null);
|
|
123
123
|
function useEditor() {
|
|
124
124
|
const ctx = useContext(EditorContext);
|
|
125
125
|
if (!ctx) {
|