Browse Source

Improve nme POW to support all types

David `Deltakosh` Catuhe 5 năm trước cách đây
mục cha
commit
759c06d51d
2 tập tin đã thay đổi với 20 bổ sung4 xóa
  1. 14 1
      .vscode/launch.json
  2. 6 3
      src/Materials/Node/Blocks/powBlock.ts

+ 14 - 1
.vscode/launch.json

@@ -27,7 +27,20 @@
             "runtimeArgs": [
                 "--enable-unsafe-es3-apis"
             ]
-        },      
+        },               
+        {
+            "name": "Launch Node Material Editor (Edge) - Direct",
+            "type": "edge",
+            "version": "dev",
+            "request": "launch",
+            "url": "http://localhost:1338/nodeEditor/public/index-local.html",
+            "webRoot": "${workspaceRoot}/",
+            "sourceMaps": true,
+            "userDataDir": "${workspaceRoot}/.tempChromeProfileForDebug",
+            "runtimeArgs": [
+                "--enable-unsafe-es3-apis"
+            ]
+        },     
         {
             "name": "Launch Viewer (Chrome)",
             "type": "chrome",

+ 6 - 3
src/Materials/Node/Blocks/powBlock.ts

@@ -15,9 +15,12 @@ export class PowBlock extends NodeMaterialBlock {
     public constructor(name: string) {
         super(name, NodeMaterialBlockTargets.Neutral);
 
-        this.registerInput("value", NodeMaterialBlockConnectionPointTypes.Float);
-        this.registerInput("power", NodeMaterialBlockConnectionPointTypes.Float);
-        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);
+        this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect);
+        this.registerInput("power", NodeMaterialBlockConnectionPointTypes.AutoDetect);
+        this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
+
+        this._outputs[0]._typeConnectionSource = this._inputs[0];
+        this._linkConnectionTypes(0, 1);
     }
 
     /**