Преглед изворни кода

ContextNode: Rename `.context` -> `.value` (#29131)

sunag пре 1 година
родитељ
комит
17c0082f35
2 измењених фајлова са 7 додато и 7 уклоњено
  1. 4 4
      src/nodes/core/ContextNode.js
  2. 3 3
      src/nodes/lighting/LightingContextNode.js

+ 4 - 4
src/nodes/core/ContextNode.js

@@ -3,14 +3,14 @@ import { addNodeElement, nodeProxy } from '../shadernode/ShaderNode.js';
 
 class ContextNode extends Node {
 
-	constructor( node, context = {} ) {
+	constructor( node, value = {} ) {
 
 		super();
 
 		this.isContextNode = true;
 
 		this.node = node;
-		this.context = context;
+		this.value = value;
 
 	}
 
@@ -30,7 +30,7 @@ class ContextNode extends Node {
 
 		const previousContext = builder.getContext();
 
-		builder.setContext( { ...builder.context, ...this.context } );
+		builder.setContext( { ...builder.context, ...this.value } );
 
 		const node = this.node.build( builder );
 
@@ -44,7 +44,7 @@ class ContextNode extends Node {
 
 		const previousContext = builder.getContext();
 
-		builder.setContext( { ...builder.context, ...this.context } );
+		builder.setContext( { ...builder.context, ...this.value } );
 
 		const snippet = this.node.build( builder, output );
 

+ 3 - 3
src/nodes/lighting/LightingContextNode.js

@@ -12,7 +12,7 @@ class LightingContextNode extends ContextNode {
 		this.backdropNode = backdropNode;
 		this.backdropAlphaNode = backdropAlphaNode;
 
-		this._context = null;
+		this._value = null;
 
 	}
 
@@ -48,8 +48,8 @@ class LightingContextNode extends ContextNode {
 
 	setup( builder ) {
 
-		this.context = this._context || ( this._context = this.getContext() );
-		this.context.lightingModel = this.lightingModel || builder.context.lightingModel;
+		this.value = this._value || ( this._value = this.getContext() );
+		this.value.lightingModel = this.lightingModel || builder.context.lightingModel;
 
 		return super.setup( builder );
 

粤ICP备19079148号