David Catuhe 4 年之前
父节点
当前提交
fb3af1c83c
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. 7 1
      Playground/src/components/commandBarComponent.tsx
  2. 1 1
      Playground/src/components/rendererComponent.tsx

+ 7 - 1
Playground/src/components/commandBarComponent.tsx

@@ -143,7 +143,13 @@ export class CommandBarComponent extends React.Component<ICommandBarComponentPro
                     {
                         label: "QR code",
                         onClick: () => {this.props.globalState.onQRCodeRequiredObservable.notifyObservers(true)}
-                    }
+                    },                 
+                    {
+                        label: "Load Unity Toolkit",
+                        storeKey: "unity-toolkit",
+                        defaultValue: false,
+                        onCheck: () => {}
+                    }, 
                 ]}/>
                 </div>
                 <div className="commands-right">

+ 1 - 1
Playground/src/components/rendererComponent.tsx

@@ -125,7 +125,7 @@ export class RenderingComponent extends React.Component<IRenderingComponentProps
             }
 
             // Check for Unity Toolkit
-            if (location.href.indexOf("UnityToolkit") !== -1 && !this._unityToolkitWasLoaded) {
+            if ((location.href.indexOf("UnityToolkit") !== -1 || Utilities.ReadBoolFromStore("unity-toolkit", false)) && !this._unityToolkitWasLoaded) {
                 await this._loadScriptAsync("https://raw.githubusercontent.com/MackeyK24/MackeyK24.github.io/master/toolkit/babylon.manager.js");
                 this._unityToolkitWasLoaded = true;
             }