@esengine/blueprint 4.2.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4852,7 +4852,7 @@ WhileLoopExecutor = _ts_decorate8([
4852
4852
  RegisterNode(WhileLoopTemplate)
4853
4853
  ], WhileLoopExecutor);
4854
4854
 
4855
- // src/nodes/math/MathOperations.ts
4855
+ // src/nodes/variables/VariableNodes.ts
4856
4856
  function _ts_decorate9(decorators, target, key, desc) {
4857
4857
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4858
4858
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -4860,6 +4860,342 @@ function _ts_decorate9(decorators, target, key, desc) {
4860
4860
  return c > 3 && r && Object.defineProperty(target, key, r), r;
4861
4861
  }
4862
4862
  __name(_ts_decorate9, "_ts_decorate");
4863
+ var GetVariableTemplate = {
4864
+ type: "GetVariable",
4865
+ title: "Get Variable",
4866
+ category: "variable",
4867
+ color: "#4a9c6d",
4868
+ isPure: true,
4869
+ description: "Gets the value of a variable (\u83B7\u53D6\u53D8\u91CF\u7684\u503C)",
4870
+ keywords: [
4871
+ "variable",
4872
+ "get",
4873
+ "read",
4874
+ "value"
4875
+ ],
4876
+ menuPath: [
4877
+ "Variable",
4878
+ "Get Variable"
4879
+ ],
4880
+ inputs: [
4881
+ {
4882
+ name: "variableName",
4883
+ type: "string",
4884
+ displayName: "Variable Name",
4885
+ defaultValue: ""
4886
+ }
4887
+ ],
4888
+ outputs: [
4889
+ {
4890
+ name: "value",
4891
+ type: "any",
4892
+ displayName: "Value"
4893
+ }
4894
+ ]
4895
+ };
4896
+ var _GetVariableExecutor = class _GetVariableExecutor {
4897
+ execute(node, context) {
4898
+ const variableName = context.evaluateInput(node.id, "variableName", "");
4899
+ if (!variableName) {
4900
+ return {
4901
+ outputs: {
4902
+ value: null
4903
+ }
4904
+ };
4905
+ }
4906
+ const value = context.getVariable(variableName);
4907
+ return {
4908
+ outputs: {
4909
+ value
4910
+ }
4911
+ };
4912
+ }
4913
+ };
4914
+ __name(_GetVariableExecutor, "GetVariableExecutor");
4915
+ var GetVariableExecutor = _GetVariableExecutor;
4916
+ GetVariableExecutor = _ts_decorate9([
4917
+ RegisterNode(GetVariableTemplate)
4918
+ ], GetVariableExecutor);
4919
+ var SetVariableTemplate = {
4920
+ type: "SetVariable",
4921
+ title: "Set Variable",
4922
+ category: "variable",
4923
+ color: "#4a9c6d",
4924
+ description: "Sets the value of a variable (\u8BBE\u7F6E\u53D8\u91CF\u7684\u503C)",
4925
+ keywords: [
4926
+ "variable",
4927
+ "set",
4928
+ "write",
4929
+ "assign",
4930
+ "value"
4931
+ ],
4932
+ menuPath: [
4933
+ "Variable",
4934
+ "Set Variable"
4935
+ ],
4936
+ inputs: [
4937
+ {
4938
+ name: "exec",
4939
+ type: "exec",
4940
+ displayName: ""
4941
+ },
4942
+ {
4943
+ name: "variableName",
4944
+ type: "string",
4945
+ displayName: "Variable Name",
4946
+ defaultValue: ""
4947
+ },
4948
+ {
4949
+ name: "value",
4950
+ type: "any",
4951
+ displayName: "Value"
4952
+ }
4953
+ ],
4954
+ outputs: [
4955
+ {
4956
+ name: "exec",
4957
+ type: "exec",
4958
+ displayName: ""
4959
+ },
4960
+ {
4961
+ name: "value",
4962
+ type: "any",
4963
+ displayName: "Value"
4964
+ }
4965
+ ]
4966
+ };
4967
+ var _SetVariableExecutor = class _SetVariableExecutor {
4968
+ execute(node, context) {
4969
+ const variableName = context.evaluateInput(node.id, "variableName", "");
4970
+ const value = context.evaluateInput(node.id, "value", null);
4971
+ if (!variableName) {
4972
+ return {
4973
+ outputs: {
4974
+ value: null
4975
+ },
4976
+ nextExec: "exec"
4977
+ };
4978
+ }
4979
+ context.setVariable(variableName, value);
4980
+ return {
4981
+ outputs: {
4982
+ value
4983
+ },
4984
+ nextExec: "exec"
4985
+ };
4986
+ }
4987
+ };
4988
+ __name(_SetVariableExecutor, "SetVariableExecutor");
4989
+ var SetVariableExecutor = _SetVariableExecutor;
4990
+ SetVariableExecutor = _ts_decorate9([
4991
+ RegisterNode(SetVariableTemplate)
4992
+ ], SetVariableExecutor);
4993
+ var GetBoolVariableTemplate = {
4994
+ type: "GetBoolVariable",
4995
+ title: "Get Bool",
4996
+ category: "variable",
4997
+ color: "#8b1e3f",
4998
+ isPure: true,
4999
+ description: "Gets a boolean variable (\u83B7\u53D6\u5E03\u5C14\u53D8\u91CF)",
5000
+ keywords: [
5001
+ "variable",
5002
+ "get",
5003
+ "bool",
5004
+ "boolean"
5005
+ ],
5006
+ menuPath: [
5007
+ "Variable",
5008
+ "Get Bool"
5009
+ ],
5010
+ inputs: [
5011
+ {
5012
+ name: "variableName",
5013
+ type: "string",
5014
+ displayName: "Variable Name",
5015
+ defaultValue: ""
5016
+ }
5017
+ ],
5018
+ outputs: [
5019
+ {
5020
+ name: "value",
5021
+ type: "bool",
5022
+ displayName: "Value"
5023
+ }
5024
+ ]
5025
+ };
5026
+ var _GetBoolVariableExecutor = class _GetBoolVariableExecutor {
5027
+ execute(node, context) {
5028
+ const variableName = context.evaluateInput(node.id, "variableName", "");
5029
+ const value = context.getVariable(variableName);
5030
+ return {
5031
+ outputs: {
5032
+ value: Boolean(value)
5033
+ }
5034
+ };
5035
+ }
5036
+ };
5037
+ __name(_GetBoolVariableExecutor, "GetBoolVariableExecutor");
5038
+ var GetBoolVariableExecutor = _GetBoolVariableExecutor;
5039
+ GetBoolVariableExecutor = _ts_decorate9([
5040
+ RegisterNode(GetBoolVariableTemplate)
5041
+ ], GetBoolVariableExecutor);
5042
+ var GetFloatVariableTemplate = {
5043
+ type: "GetFloatVariable",
5044
+ title: "Get Float",
5045
+ category: "variable",
5046
+ color: "#39c5bb",
5047
+ isPure: true,
5048
+ description: "Gets a float variable (\u83B7\u53D6\u6D6E\u70B9\u53D8\u91CF)",
5049
+ keywords: [
5050
+ "variable",
5051
+ "get",
5052
+ "float",
5053
+ "number"
5054
+ ],
5055
+ menuPath: [
5056
+ "Variable",
5057
+ "Get Float"
5058
+ ],
5059
+ inputs: [
5060
+ {
5061
+ name: "variableName",
5062
+ type: "string",
5063
+ displayName: "Variable Name",
5064
+ defaultValue: ""
5065
+ }
5066
+ ],
5067
+ outputs: [
5068
+ {
5069
+ name: "value",
5070
+ type: "float",
5071
+ displayName: "Value"
5072
+ }
5073
+ ]
5074
+ };
5075
+ var _GetFloatVariableExecutor = class _GetFloatVariableExecutor {
5076
+ execute(node, context) {
5077
+ const variableName = context.evaluateInput(node.id, "variableName", "");
5078
+ const value = context.getVariable(variableName);
5079
+ return {
5080
+ outputs: {
5081
+ value: Number(value) || 0
5082
+ }
5083
+ };
5084
+ }
5085
+ };
5086
+ __name(_GetFloatVariableExecutor, "GetFloatVariableExecutor");
5087
+ var GetFloatVariableExecutor = _GetFloatVariableExecutor;
5088
+ GetFloatVariableExecutor = _ts_decorate9([
5089
+ RegisterNode(GetFloatVariableTemplate)
5090
+ ], GetFloatVariableExecutor);
5091
+ var GetIntVariableTemplate = {
5092
+ type: "GetIntVariable",
5093
+ title: "Get Int",
5094
+ category: "variable",
5095
+ color: "#1c8b8b",
5096
+ isPure: true,
5097
+ description: "Gets an integer variable (\u83B7\u53D6\u6574\u6570\u53D8\u91CF)",
5098
+ keywords: [
5099
+ "variable",
5100
+ "get",
5101
+ "int",
5102
+ "integer",
5103
+ "number"
5104
+ ],
5105
+ menuPath: [
5106
+ "Variable",
5107
+ "Get Int"
5108
+ ],
5109
+ inputs: [
5110
+ {
5111
+ name: "variableName",
5112
+ type: "string",
5113
+ displayName: "Variable Name",
5114
+ defaultValue: ""
5115
+ }
5116
+ ],
5117
+ outputs: [
5118
+ {
5119
+ name: "value",
5120
+ type: "int",
5121
+ displayName: "Value"
5122
+ }
5123
+ ]
5124
+ };
5125
+ var _GetIntVariableExecutor = class _GetIntVariableExecutor {
5126
+ execute(node, context) {
5127
+ const variableName = context.evaluateInput(node.id, "variableName", "");
5128
+ const value = context.getVariable(variableName);
5129
+ return {
5130
+ outputs: {
5131
+ value: Math.floor(Number(value) || 0)
5132
+ }
5133
+ };
5134
+ }
5135
+ };
5136
+ __name(_GetIntVariableExecutor, "GetIntVariableExecutor");
5137
+ var GetIntVariableExecutor = _GetIntVariableExecutor;
5138
+ GetIntVariableExecutor = _ts_decorate9([
5139
+ RegisterNode(GetIntVariableTemplate)
5140
+ ], GetIntVariableExecutor);
5141
+ var GetStringVariableTemplate = {
5142
+ type: "GetStringVariable",
5143
+ title: "Get String",
5144
+ category: "variable",
5145
+ color: "#e91e8c",
5146
+ isPure: true,
5147
+ description: "Gets a string variable (\u83B7\u53D6\u5B57\u7B26\u4E32\u53D8\u91CF)",
5148
+ keywords: [
5149
+ "variable",
5150
+ "get",
5151
+ "string",
5152
+ "text"
5153
+ ],
5154
+ menuPath: [
5155
+ "Variable",
5156
+ "Get String"
5157
+ ],
5158
+ inputs: [
5159
+ {
5160
+ name: "variableName",
5161
+ type: "string",
5162
+ displayName: "Variable Name",
5163
+ defaultValue: ""
5164
+ }
5165
+ ],
5166
+ outputs: [
5167
+ {
5168
+ name: "value",
5169
+ type: "string",
5170
+ displayName: "Value"
5171
+ }
5172
+ ]
5173
+ };
5174
+ var _GetStringVariableExecutor = class _GetStringVariableExecutor {
5175
+ execute(node, context) {
5176
+ const variableName = context.evaluateInput(node.id, "variableName", "");
5177
+ const value = context.getVariable(variableName);
5178
+ return {
5179
+ outputs: {
5180
+ value: String(value ?? "")
5181
+ }
5182
+ };
5183
+ }
5184
+ };
5185
+ __name(_GetStringVariableExecutor, "GetStringVariableExecutor");
5186
+ var GetStringVariableExecutor = _GetStringVariableExecutor;
5187
+ GetStringVariableExecutor = _ts_decorate9([
5188
+ RegisterNode(GetStringVariableTemplate)
5189
+ ], GetStringVariableExecutor);
5190
+
5191
+ // src/nodes/math/MathOperations.ts
5192
+ function _ts_decorate10(decorators, target, key, desc) {
5193
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5194
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5195
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5196
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
5197
+ }
5198
+ __name(_ts_decorate10, "_ts_decorate");
4863
5199
  var AddTemplate = {
4864
5200
  type: "Add",
4865
5201
  title: "Add",
@@ -4909,7 +5245,7 @@ var _AddExecutor = class _AddExecutor {
4909
5245
  };
4910
5246
  __name(_AddExecutor, "AddExecutor");
4911
5247
  var AddExecutor = _AddExecutor;
4912
- AddExecutor = _ts_decorate9([
5248
+ AddExecutor = _ts_decorate10([
4913
5249
  RegisterNode(AddTemplate)
4914
5250
  ], AddExecutor);
4915
5251
  var SubtractTemplate = {
@@ -4960,7 +5296,7 @@ var _SubtractExecutor = class _SubtractExecutor {
4960
5296
  };
4961
5297
  __name(_SubtractExecutor, "SubtractExecutor");
4962
5298
  var SubtractExecutor = _SubtractExecutor;
4963
- SubtractExecutor = _ts_decorate9([
5299
+ SubtractExecutor = _ts_decorate10([
4964
5300
  RegisterNode(SubtractTemplate)
4965
5301
  ], SubtractExecutor);
4966
5302
  var MultiplyTemplate = {
@@ -5011,7 +5347,7 @@ var _MultiplyExecutor = class _MultiplyExecutor {
5011
5347
  };
5012
5348
  __name(_MultiplyExecutor, "MultiplyExecutor");
5013
5349
  var MultiplyExecutor = _MultiplyExecutor;
5014
- MultiplyExecutor = _ts_decorate9([
5350
+ MultiplyExecutor = _ts_decorate10([
5015
5351
  RegisterNode(MultiplyTemplate)
5016
5352
  ], MultiplyExecutor);
5017
5353
  var DivideTemplate = {
@@ -5068,18 +5404,18 @@ var _DivideExecutor = class _DivideExecutor {
5068
5404
  };
5069
5405
  __name(_DivideExecutor, "DivideExecutor");
5070
5406
  var DivideExecutor = _DivideExecutor;
5071
- DivideExecutor = _ts_decorate9([
5407
+ DivideExecutor = _ts_decorate10([
5072
5408
  RegisterNode(DivideTemplate)
5073
5409
  ], DivideExecutor);
5074
5410
 
5075
5411
  // src/nodes/time/GetDeltaTime.ts
5076
- function _ts_decorate10(decorators, target, key, desc) {
5412
+ function _ts_decorate11(decorators, target, key, desc) {
5077
5413
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5078
5414
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5079
5415
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5080
5416
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5081
5417
  }
5082
- __name(_ts_decorate10, "_ts_decorate");
5418
+ __name(_ts_decorate11, "_ts_decorate");
5083
5419
  var GetDeltaTimeTemplate = {
5084
5420
  type: "GetDeltaTime",
5085
5421
  title: "Get Delta Time",
@@ -5113,18 +5449,18 @@ var _GetDeltaTimeExecutor = class _GetDeltaTimeExecutor {
5113
5449
  };
5114
5450
  __name(_GetDeltaTimeExecutor, "GetDeltaTimeExecutor");
5115
5451
  var GetDeltaTimeExecutor = _GetDeltaTimeExecutor;
5116
- GetDeltaTimeExecutor = _ts_decorate10([
5452
+ GetDeltaTimeExecutor = _ts_decorate11([
5117
5453
  RegisterNode(GetDeltaTimeTemplate)
5118
5454
  ], GetDeltaTimeExecutor);
5119
5455
 
5120
5456
  // src/nodes/time/GetTime.ts
5121
- function _ts_decorate11(decorators, target, key, desc) {
5457
+ function _ts_decorate12(decorators, target, key, desc) {
5122
5458
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5123
5459
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5124
5460
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5125
5461
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5126
5462
  }
5127
- __name(_ts_decorate11, "_ts_decorate");
5463
+ __name(_ts_decorate12, "_ts_decorate");
5128
5464
  var GetTimeTemplate = {
5129
5465
  type: "GetTime",
5130
5466
  title: "Get Game Time",
@@ -5158,18 +5494,18 @@ var _GetTimeExecutor = class _GetTimeExecutor {
5158
5494
  };
5159
5495
  __name(_GetTimeExecutor, "GetTimeExecutor");
5160
5496
  var GetTimeExecutor = _GetTimeExecutor;
5161
- GetTimeExecutor = _ts_decorate11([
5497
+ GetTimeExecutor = _ts_decorate12([
5162
5498
  RegisterNode(GetTimeTemplate)
5163
5499
  ], GetTimeExecutor);
5164
5500
 
5165
5501
  // src/nodes/time/Delay.ts
5166
- function _ts_decorate12(decorators, target, key, desc) {
5502
+ function _ts_decorate13(decorators, target, key, desc) {
5167
5503
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5168
5504
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5169
5505
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5170
5506
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5171
5507
  }
5172
- __name(_ts_decorate12, "_ts_decorate");
5508
+ __name(_ts_decorate13, "_ts_decorate");
5173
5509
  var DelayTemplate = {
5174
5510
  type: "Delay",
5175
5511
  title: "Delay",
@@ -5215,18 +5551,18 @@ var _DelayExecutor = class _DelayExecutor {
5215
5551
  };
5216
5552
  __name(_DelayExecutor, "DelayExecutor");
5217
5553
  var DelayExecutor = _DelayExecutor;
5218
- DelayExecutor = _ts_decorate12([
5554
+ DelayExecutor = _ts_decorate13([
5219
5555
  RegisterNode(DelayTemplate)
5220
5556
  ], DelayExecutor);
5221
5557
 
5222
5558
  // src/nodes/debug/Print.ts
5223
- function _ts_decorate13(decorators, target, key, desc) {
5559
+ function _ts_decorate14(decorators, target, key, desc) {
5224
5560
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5225
5561
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5226
5562
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5227
5563
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5228
5564
  }
5229
- __name(_ts_decorate13, "_ts_decorate");
5565
+ __name(_ts_decorate14, "_ts_decorate");
5230
5566
  var PrintTemplate = {
5231
5567
  type: "Print",
5232
5568
  title: "Print String",
@@ -5299,7 +5635,7 @@ var _PrintExecutor = class _PrintExecutor {
5299
5635
  };
5300
5636
  __name(_PrintExecutor, "PrintExecutor");
5301
5637
  var PrintExecutor = _PrintExecutor;
5302
- PrintExecutor = _ts_decorate13([
5638
+ PrintExecutor = _ts_decorate14([
5303
5639
  RegisterNode(PrintTemplate)
5304
5640
  ], PrintExecutor);
5305
5641