Skip to content

Commit 1bee99f

Browse files
Refactor event parameter types to unify Unity event handling and remove React-specific types
1 parent ae0237e commit 1bee99f

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

module/declarations/global.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReactUnityEventParameter } from "../source/types/react-unity-event-parameters";
1+
import { UnityEventParameter } from "../source/types/unity-event-parameters";
22
import { UnityArguments } from "../source/types/unity-arguments";
33
import { UnityInstance } from "../source/types/unity-instance";
44

@@ -13,7 +13,7 @@ declare global {
1313
*/
1414
function dispatchReactUnityEvent(
1515
eventName: string,
16-
...parameters: ReactUnityEventParameter[]
16+
...parameters: UnityEventParameter[]
1717
): void;
1818

1919
/**

module/source/components/unity.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import { UnityInstance } from "../types/unity-instance";
1111
import { UnityProps } from "../types/unity-props";
1212
import { useCanvasIdentifier } from "../hooks/use-canvas-identifier";
1313
import { useUnityLoader } from "../hooks/use-unity-loader";
14-
import { UnityConfig } from "../types/unity-config";
1514
import { UnityArguments } from "../types/unity-arguments";
1615

1716
const Unity: ForwardRefExoticComponent<

module/source/hooks/use-canvas-identifier.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useCallback, useMemo, useState } from "react";
2-
import { UnityProps } from "../types/unity-props";
32

43
/**
54
* The canvas count is used to generate a unique Unity canvas ID.

module/source/types/react-unity-event-parameters.d.ts renamed to module/source/types/unity-event-parameters.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
* texture objects. WebGL functions can be called on emscripten’s WebGL context,
2323
* GLctx.
2424
*/
25-
type ReactUnityEventParameter = string | number | undefined | void;
25+
type UnityEventParameter = string | number | undefined | void;
2626

27-
export type { ReactUnityEventParameter };
27+
export type { UnityEventParameter };

module/source/types/unity-instance.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReactUnityEventParameter } from "./react-unity-event-parameters";
1+
import { UnityEventParameter } from "./unity-event-parameters";
22
import { UnityBooleanLike } from "./unity-boolean-like";
33
import { UnityModule } from "./unity-module";
44

@@ -15,7 +15,7 @@ type UnityInstance = {
1515
SendMessage(
1616
gameObjectName: string,
1717
methodName: string,
18-
parameter?: ReactUnityEventParameter
18+
parameter?: UnityEventParameter
1919
): void;
2020

2121
/**

0 commit comments

Comments
 (0)