File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,16 @@ const useUnityContext = (unityConfig: UnityConfig): UnityContext => {
100100 [ unityInstance ]
101101 ) ;
102102
103+ /**
104+ * Gets the metrics information from the Unity Instance.
105+ * This includes performance metrics such as FPS, memory usage, etc.
106+ * @returns A function that returns the metrics information.
107+ */
108+ const getMetricsInfo = useCallback (
109+ ( ) => unityInstance ?. GetMetricsInfo ?.( ) ,
110+ [ unityInstance ]
111+ ) ;
112+
103113 // Initialize the UnityProvider with the provided configuration
104114 // This is where you would typically load the Unity instance
105115 // and set up event listeners, etc.
@@ -113,6 +123,7 @@ const useUnityContext = (unityConfig: UnityConfig): UnityContext => {
113123 sendMessage,
114124 takeScreenshot,
115125 unload,
126+ getMetricsInfo,
116127 addEventListener : eventSystem . addEventListener ,
117128 removeEventListener : eventSystem . removeEventListener ,
118129 UNSAFE__unityInstance : unityInstance ,
You can’t perform that action at this time.
0 commit comments