Class: MolangVariableMap
Beta
包含一组额外的变量值,用于进一步定义渲染和动画的工作方式。
Contains a set of additional variable values for further defining how rendering and animations function.
Constructors
Constructor
new MolangVariableMap():
MolangVariableMap
Beta
Returns
MolangVariableMap
Methods
setColorRGB()
setColorRGB(
variableName,color):void
Beta
向 Molang 添加以下变量:
<variable_name>.r- 红色颜色值 [0-1]<variable_name>.g- 绿色颜色值 [0-1]<variable_name>.b- 蓝色颜色值 [0-1]
Parameters
variableName
string
color
Returns
void
Remarks
Adds the following variables to Molang:
<variable_name>.r- Red color value [0-1]<variable_name>.g- Green color value [0-1]<variable_name>.b- Blue color value [0-1]
Throws
This function can throw errors.
setColorRGBA()
setColorRGBA(
variableName,color):void
Beta
向 Molang 添加以下变量:
<variable_name>.r- 红色颜色值 [0-1]<variable_name>.g- 绿色颜色值 [0-1]<variable_name>.b- 蓝色颜色值 [0-1]<variable_name>.a- Alpha(透明度)颜色值 [0-1]
Parameters
variableName
string
color
Returns
void
Remarks
Adds the following variables to Molang:
<variable_name>.r- Red color value [0-1]<variable_name>.g- Green color value [0-1]<variable_name>.b- Blue color value [0-1]<variable_name>.a- Alpha (transparency) color value [0-1]
Throws
This function can throw errors.
setFloat()
setFloat(
variableName,number):void
Beta
在 Molang 变量映射中设置一个数值(小数)。
Parameters
variableName
string
要设置的浮点数的名称。 Name of the float-based number to set.
number
number
要为基于 Molang 的变量设置的值。 Value for the Molang-based variable to set.
Returns
void
Remarks
Sets a numeric (decimal) value within the Molang variable map.
Throws
This function can throw errors.
setSpeedAndDirection()
setSpeedAndDirection(
variableName,speed,direction):void
Beta
向 Molang 添加以下变量:
<variable_name>.speed- 提供的速度数值<variable_name>.direction_x- 提供的 Vector3 中的 X 值<variable_name>.direction_y- 提供的 Vector3 中的 Y 值<variable_name>.direction_z- 提供的 Vector3 中的 Z 值
Parameters
variableName
string
speed
number
direction
Returns
void
Remarks
Adds the following variables to Molang:
<variable_name>.speed- Speed number provided<variable_name>.direction_x- X value from the Vector3 provided<variable_name>.direction_y- Y value from the Vector3 provided<variable_name>.direction_z- Z value from the Vector3 provided
Throws
This function can throw errors.
setVector3()
setVector3(
variableName,vector):void
Beta
向 Molang 添加以下变量:
<variable_name>.x- 提供的 Vector3 中的 X 值<variable_name>.y- 提供的 Vector3 中的 Y 值<variable_name>.z- 提供的 Vector3 中的 Z 值
Parameters
variableName
string
vector
Returns
void
Remarks
Adds the following variables to Molang:
<variable_name>.x- X value from the Vector3 provided<variable_name>.y- Y value from the Vector3 provided<variable_name>.z- Z value from the Vector3 provided
Throws
This function can throw errors.
