跳至正文
版本:latest - a1.142.x ⚖️

Enums

与其向方法传递数字或在事件回调函数中比较数字,不如使用以下枚举来实现。 示例:

-- 使用枚举来确定角色的 StanceMode
Character.Subscribe("StanceModeChange", function(character, old_stance, new_stance)
if (new_stance == StanceMode.Standing) then
Console.Log("我在站立!")
else if (new_stance == StanceMode.Crouching) then
Console.Log("我在下蹲!")
end
end)

-- 使用枚举将 Light 类型传递给构造函数
local my_light = Light(Vector(-5, 0, 50), Rotator(), Color.RED, LightType.Point)

-- 使用枚举设置角色视图模式
character:SetViewMode(ViewMode.FPS)
信息

使用枚举的函数仍然接收数字作为参数(一如既往),使用枚举只是一种便利措施。

所有枚举

🧑‍💻API Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!

AimMode

角色在持枪时用于改变瞄准模式
LabelValueDescription
AimMode.None0
AimMode.ADS1
AimMode.ZoomedZoom2
AimMode.Zoomed3
AimMode.ZoomedFar4

AnimationSlotType

LabelValueDescription
AnimationSlotType.FullBody0
AnimationSlotType.UpperBody1
AnimationSlotType.Head2

AssetType

LabelValueDescription
AssetType.Map2
AssetType.StaticMesh4
AssetType.SkeletalMesh8
AssetType.Sound16
AssetType.Animation32
AssetType.Particle64
AssetType.Material128
AssetType.Blueprint256
AssetType.Other32768

AttachmentRule

LabelValueDescription
AttachmentRule.KeepRelative0如果已经附加,将保持当前的相对位置/旋转。
AttachmentRule.KeepWorld1将计算新的相对位置/旋转,使 Actor 在附加后保持在相同的位置。
AttachmentRule.SnapToTarget2将 Actor 设为与父 Actor 相同的位置/旋转(或在骨骼位置),并将其相对位置/旋转重置为零。

AttenuationFunction

LabelValueDescription
AttenuationFunction.Linear0
AttenuationFunction.Logarithmic1
AttenuationFunction.Inverse2
AttenuationFunction.LogReverse3
AttenuationFunction.NaturalSound4

BlendMode

LabelValueDescription
BlendMode.Opaque0
BlendMode.Masked1
BlendMode.Translucent2
BlendMode.Additive3
BlendMode.Modulate4
BlendMode.MaskedDistanceField5
BlendMode.MaskedDistanceFieldShadowed6
BlendMode.TranslucentDistanceField7
BlendMode.TranslucentDistanceFieldShadowed8
BlendMode.AlphaComposite9
BlendMode.AlphaHoldout10
BlendMode.AlphaBlend11
BlendMode.TranslucentAlphaOnly12
BlendMode.TranslucentAlphaOnlyWriteAlpha13

CameraMode

LabelValueDescription
CameraMode.FPSTPS0
CameraMode.FPSOnly1
CameraMode.TPSOnly2

CCDMode

LabelValueDescription
CCDMode.Auto0根据对象大小自动启用/禁用
CCDMode.Disabled1禁用 CCD
CCDMode.Enabled2启用 CCD

CollisionChannel

💡TIP
This Enum supports Bitwise Operations!
LabelValueDescription
CollisionChannel.WorldStatic1 << 0WorldStatic 对象类型
CollisionChannel.WorldDynamic1 << 1WorldDynamic 对象类型
CollisionChannel.Pawn1 << 2碰撞胶囊体(通常来自角色)
CollisionChannel.PhysicsBody1 << 5可拾取物与道具网格体
CollisionChannel.Mesh1 << 17角色网格体
CollisionChannel.Water1 << 19水体
CollisionChannel.Foliage1 << 20植被网格体
CollisionChannel.Vehicle1 << 22载具网格体
CollisionChannel.All(1 << 32) - 1所有对象

CollisionType

LabelValueDescription
CollisionType.Normal0阻挡一切
CollisionType.StaticOnly1仅阻挡静态对象
CollisionType.NoCollision2皆不阻挡
CollisionType.IgnoreOnlyPawn3阻挡除 Pawn(角色)以外的一切
CollisionType.Auto4自动选择 - 通常为 Normal。在道具上,它会根据道具大小在 NormalIgnoreOnlyPawn 之间切换

CursorType

LabelValueDescription
CursorType.None0
CursorType.Default1
CursorType.TextEditBeam2
CursorType.ResizeLeftRight3
CursorType.ResizeUpDown4
CursorType.ResizeSouthEast5
CursorType.ResizeSouthWest6
CursorType.CardinalCross7
CursorType.Crosshairs8
CursorType.Hand9
CursorType.GrabHand10
CursorType.GrabHandClosed11
CursorType.SlashedCircle12
CursorType.EyeDropper13

ConstraintMotion

LabelValueDescription
ConstraintMotion.Free0
ConstraintMotion.Limited1
ConstraintMotion.Locked2

DamageType

LabelValueDescription
DamageType.Shot0
DamageType.Explosion1
DamageType.Punch2
DamageType.Fall3
DamageType.RunOverProp4
DamageType.RunOverVehicle5
DamageType.Melee6
DamageType.Unknown7

DatabaseEngine

LabelValueDescription
DatabaseEngine.SQLite0
DatabaseEngine.MySQL1
DatabaseEngine.PostgreSQL2

DifferentialType

LabelValueDescription
DifferentialType.Undefined0
DifferentialType.AllWheelDrive1
DifferentialType.FrontWheelDrive2
DifferentialType.RearWheelDrive3

FallingMode

LabelValueDescription
FallingMode.None0
FallingMode.Jumping1
FallingMode.Climbing2
FallingMode.Vaulting3
FallingMode.Falling4
FallingMode.HighFalling5
FallingMode.Parachuting6
FallingMode.SkyDiving7

FontType

LabelValueDescription
FontType.Roboto0
FontType.GothicA11
FontType.PoiretOne2
FontType.Oswald3
FontType.RobotoMono4
FontType.OpenSans5

GaitMode

LabelValueDescription
GaitMode.None0
GaitMode.Walking1
GaitMode.Sprinting2

GizmoTransformMode

LabelValueDescription
GizmoTransformMode.Translation0
GizmoTransformMode.Rotation1
GizmoTransformMode.Scale2

GizmoAlignSpace

LabelValueDescription
GizmoAlignSpace.Local0
GizmoAlignSpace.World1

GrabMode

LabelValueDescription
GrabMode.Disabled0禁用抓取
GrabMode.Auto1根据道具大小自动启用/禁用
GrabMode.Enabled2启用抓取

HandlingMode

LabelValueDescription
HandlingMode.SingleHandedWeapon0
HandlingMode.DoubleHandedWeapon1
HandlingMode.SingleHandedMelee2
HandlingMode.DoubleHandedMelee3
HandlingMode.Throwable4
HandlingMode.Torch5
HandlingMode.Barrel6
HandlingMode.Box7

HighlightMode

LabelValueDescription
HighlightMode.Always0
HighlightMode.OnlyHidden1
HighlightMode.OnlyVisible2

HTTPMethod

HTTP 定义了一组请求方法,用以指示针对给定资源要执行的期望操作。欲了解更多信息,请在此进一步阅读。
LabelValueDescription
HTTPMethod.GET0GET 方法请求特定资源的表示形式。使用 GET 的请求应该只用于检索数据。
HTTPMethod.POST1POST 方法将实体提交给指定的资源,通常会导致服务器上的状态更改或副作用。
HTTPMethod.PUT2PUT 方法用请求有效负载替换目标资源的所有当前表示形式。
HTTPMethod.HEAD3HEAD 方法要求一个与 GET 请求相同的响应,但没有响应体。
HTTPMethod.DELETE4DELETE 方法删除指定的资源。
HTTPMethod.PATCH5PATCH 方法对资源应用部分修改。
HTTPMethod.OPTIONS6OPTIONS 方法描述目标资源的通信选项。

ImageFormat

LabelValueDescription
ImageFormat.JPEG0
ImageFormat.PNG1
ImageFormat.BMP2

InputEvent

LabelValueDescription
InputEvent.Pressed0
InputEvent.Released1

KeyModifier

💡TIP
This Enum supports Bitwise Operations!
LabelValueDescription
KeyModifier.None0
KeyModifier.LeftShiftDown1 << 0
KeyModifier.RightShiftDown1 << 1
KeyModifier.LeftControlDown1 << 2
KeyModifier.RightControlDown1 << 3
KeyModifier.LeftAltDown1 << 4
KeyModifier.RightAltDown1 << 5
KeyModifier.LeftCommandDown1 << 6
KeyModifier.RightCommandDown1 << 7
KeyModifier.CapsLocked1 << 8

LightProfile

LabelValueDescription
LightProfile.None0
LightProfile.Arrow_Star1
LightProfile.Arrow_Up2
LightProfile.Beam_013
LightProfile.Beam_024
LightProfile.Beam_035
LightProfile.Beam_046
LightProfile.Beam_057
LightProfile.Beam_068
LightProfile.Beam_079
LightProfile.Beam_0810
LightProfile.Beam_LED_0111
LightProfile.Beam_LED_0212
LightProfile.Beam_LED_0313
LightProfile.Beam_LED_0414
LightProfile.Beam_LED_0515
LightProfile.Beam_LED_0616
LightProfile.Beam_LED_0717
LightProfile.Bow18
LightProfile.Capped_0119
LightProfile.Capped_0220
LightProfile.Shattered_0121
LightProfile.Shattered_0222
LightProfile.Shattered_0323
LightProfile.Shattered_0424
LightProfile.Shattered_0525
LightProfile.SpotLight_0126
LightProfile.SpotLight_0227
LightProfile.SpotLight_0328
LightProfile.SpotLight_0429
LightProfile.Spreadout_0130
LightProfile.Spreadout_0231
LightProfile.Spreadout_0332
LightProfile.Spreadout_0433
LightProfile.Star_Bow34
LightProfile.Star_Burst_0135
LightProfile.Star_Burst_0236
LightProfile.Star_Burst_0337
LightProfile.Star_Burst_0438
LightProfile.Star_Burst_0539
LightProfile.Star_Burst_0640
LightProfile.Star_Burst_0741
LightProfile.Star_Burst_0842
LightProfile.Star_X_0143
LightProfile.Star_X_0244
LightProfile.Wall_Boomerang45
LightProfile.Wall_Inverted_V46
LightProfile.Wall_Star_T47
LightProfile.Wing_648
LightProfile.Wing_V_0149
LightProfile.Wing_V_0250

LogType

LabelValueDescription
LogType.Display0
LogType.Warning1
LogType.Error2
LogType.Debug3
LogType.Verbose4
LogType.Scripting5
LogType.ScriptingWarn6
LogType.ScriptingError7
LogType.Chat8
LogType.WebUI9
LogType.Success10
LogType.Fatal11

LightType

LabelValueDescription
LightType.Point0
LightType.Spot1
LightType.React2

NativeWidget

LabelValueDescription
NativeWidget.Border0
NativeWidget.Button1
NativeWidget.CheckBox2
NativeWidget.Image3
NativeWidget.ProgressBar4
NativeWidget.RichTextBlock5
NativeWidget.Slider6
NativeWidget.Text7
NativeWidget.ComboBox8
NativeWidget.EditableText9
NativeWidget.EditableTextMultiLine10
NativeWidget.SpinBox11
NativeWidget.TextBox12
NativeWidget.TextBoxMultiLine13
NativeWidget.CanvasPanel14
NativeWidget.GridPanel15
NativeWidget.HorizontalBox16
NativeWidget.Overlay17
NativeWidget.ScaleBox18
NativeWidget.ScrollBox19
NativeWidget.SizeBox20
NativeWidget.UniformGridPanel21
NativeWidget.VerticalBox22
NativeWidget.WrapBox23
NativeWidget.BackgroundBlur24

NotificationType

LabelValueDescription
NotificationType.Info0
NotificationType.Warning1
NotificationType.Error2
NotificationType.Fatal3
NotificationType.Success4

PackageType

💡TIP
This Enum supports Bitwise Operations!
LabelValueDescription
PackageType.Script1
PackageType.GameMode2
PackageType.LoadingScreen4
PackageType.Map16
PackageType.CModule32
PackageType.All-1

Reliability

LabelValueDescription
Reliability.Unreliable0以不可靠的方式发送消息,消息可能会丢失(无重传机制)或接收顺序与发送顺序不一致。但相比可靠传输,其开销更小、速度更快。适用于发送对游戏玩法不关键的短暂且非核心的事件
Reliability.Reliable1以可靠的方式发送消息,保证消息能够按顺序发送和接收,但开销比不可靠传输更大。当你想确保事件一定能被对方接收到时使用此方式

SkyMode

LabelValueDescription
SkyMode.VolumetricClouds0使用 3D 体积云层
SkyMode.StaticClouds1旨在模拟体积云的外观,但采用静态云贴图。性能开销远低于体积云。
SkyMode.DynamicClouds2D2使用简单的 2D 动态云
SkyMode.NoClouds3禁用所有形式的动态云
SkyMode.VolumetricAurora4将云替换为全 3D 体积极光,比 2D 效果更逼真。
SkyMode.Space5关闭所有天空颜色、大气散射、云层等。专门用于设置在外太空中、且相机下方没有行星/地面的环境。

SoundType

LabelValueDescription
SoundType.SFX0
SoundType.Music1
SoundType.UI2
SoundType.Ambient3

SoundLoopMode

LabelValueDescription
SoundLoopMode.Default0资产中定义的默认值
SoundLoopMode.Forever1覆盖资产设置,使其无限循环
SoundLoopMode.Never2覆盖资产设置,使其仅播放一次

StanceMode

LabelValueDescription
StanceMode.None0
StanceMode.Standing1
StanceMode.Crouching2
StanceMode.Proning3

SteeringType

LabelValueDescription
SteeringType.SingleAngle0两侧车轮的转向角度相同
SteeringType.AngleRatio1转弯时外侧车轮的转向角度按设定比例小于内侧车轮
SteeringType.Ackermann2应用阿克曼转向原理

SurfaceType

LabelValueDescription
SurfaceType.Default0
SurfaceType.Carpet1
SurfaceType.Concrete2
SurfaceType.Grass3
SurfaceType.Gravel4
SurfaceType.Ground5
SurfaceType.MetalLight6
SurfaceType.Plastic7
SurfaceType.Sand8
SurfaceType.Snow9
SurfaceType.Water10
SurfaceType.WoodLight11
SurfaceType.Flesh12
SurfaceType.MetalHeavy13
SurfaceType.WoodHeavy14
SurfaceType.Ice15
SurfaceType.Mud16
SurfaceType.Rock17
SurfaceType.Thump18
SurfaceType.Glass19
SurfaceType.Rubber20
SurfaceType.Air21

SuspensionSweepShape

LabelValueDescription
SuspensionSweepShape.Raycast0使用射线测定悬挂至地面的长度 - 最快
SuspensionSweepShape.Spherecast1使用球体测定悬挂至地面的长度
SuspensionSweepShape.Shapecast2使用车轮碰撞形状测定悬挂至地面的长度 - 最慢

SwimmingMode

LabelValueDescription
SwimmingMode.None0
SwimmingMode.Surface1
SwimmingMode.Underwater2

TextRenderAlignCamera

LabelValueDescription
TextRenderAlignCamera.Unaligned0
TextRenderAlignCamera.AlignCameraRotation1
TextRenderAlignCamera.FaceCamera2

TextRenderBevelType

LabelValueDescription
TextRenderBevelType.Linear0
TextRenderBevelType.HalfCircle1
TextRenderBevelType.Convex2
TextRenderBevelType.Concave3
TextRenderBevelType.OneStep4
TextRenderBevelType.TwoSteps5
TextRenderBevelType.Engraved6

TextRenderHorizontalAlignment

LabelValueDescription
TextRenderHorizontalAlignment.Left0
TextRenderHorizontalAlignment.Center1
TextRenderHorizontalAlignment.Right2

TextRenderRenderingType

LabelValueDescription
TextRenderRenderingType.Lit0
TextRenderRenderingType.Unlit1
TextRenderRenderingType.UnlitCameraAligned2
TextRenderRenderingType.UnlitCameraAlignedDepth3

TextRenderVerticalAlignment

LabelValueDescription
TextRenderVerticalAlignment.Top0
TextRenderVerticalAlignment.Center1
TextRenderVerticalAlignment.Bottom2
TextRenderVerticalAlignment.QuadTop3

TriggerType

LabelValueDescription
TriggerType.Sphere0
TriggerType.Box1

TraceMode

💡TIP
This Enum supports Bitwise Operations!
LabelValueDescription
TraceMode.DrawDebug1 << 0是否绘制代表射线的 3D 线条
TraceMode.TraceComplex1 << 1是否应对复杂碰撞进行追踪
TraceMode.ReturnPhysicalMaterial1 << 2是否要在结果中包含物理材质(将 SurfaceType 添加到结果中)
TraceMode.ReturnEntity1 << 3是否要返回命中的实体(将 Entity 添加到结果中)
TraceMode.ReturnNames1 << 4是否应该返回名称(将 ActorNameComponentNameBoneName 添加到结果中)
TraceMode.ReturnUV1 << 5是否要追踪并返回 UV 信息(将 UV 添加到结果中)
TraceMode.TraceOnlyVisibility1 << 6是否只对未忽略可见性碰撞通道的对象进行追踪
TraceMode.ReturnItem1 << 7是否应该返回关于被命中物品的额外数据(特定于命中图元 - 通常是实例索引)(将 Item 添加到结果中)

ViewMode

LabelValueDescription
ViewMode.FPS0第一人称视角
ViewMode.TPS11第三人称近距离视角
ViewMode.TPS22第三人称中距离视角
ViewMode.TPS33第三人称远距离视角
ViewMode.TopDown4俯视视角

VOIPSetting

LabelValueDescription
VOIPSetting.None0
VOIPSetting.ListenOnly1
VOIPSetting.SpeakOnly2
VOIPSetting.Both3

WeatherType

LabelValueDescription
WeatherType.ClearSkies1
WeatherType.Cloudy2
WeatherType.Foggy3
WeatherType.Overcast4
WeatherType.PartlyCloudy5
WeatherType.Rain6
WeatherType.RainLight7
WeatherType.RainThunderstorm8
WeatherType.SandDustCalm9
WeatherType.SandDustStorm10
WeatherType.Snow11
WeatherType.SnowBlizzard12
WeatherType.SnowLight13

WebUIModifier

💡TIP
This Enum supports Bitwise Operations!
LabelValueDescription
WebUIModifier.None0
WebUIModifier.CapsLockOn1 << 0
WebUIModifier.ShiftDown1 << 1
WebUIModifier.ControlDown1 << 2
WebUIModifier.AltDown1 << 3
WebUIModifier.LeftMouseButton1 << 4
WebUIModifier.MiddleMouseButton1 << 5
WebUIModifier.RightMouseButton1 << 6
WebUIModifier.CommandDown1 << 7
WebUIModifier.NumLockOn1 << 8
WebUIModifier.IsKeyPad1 << 9
WebUIModifier.IsLeft1 << 10
WebUIModifier.IsRight1 << 11
WebUIModifier.AltgrDown1 << 12
WebUIModifier.IsRepeat1 << 13

WebUIKeyType

LabelValueDescription
WebUIKeyType.Down0
WebUIKeyType.Up1
WebUIKeyType.Char2

WebUIMouseType

LabelValueDescription
WebUIMouseType.Left0
WebUIMouseType.Right1
WebUIMouseType.Middle2

WidgetHorizontalAlignment

LabelValueDescription
WidgetHorizontalAlignment.Fill0
WidgetHorizontalAlignment.Left1
WidgetHorizontalAlignment.Center2
WidgetHorizontalAlignment.Right3

WidgetVerticalAlignment

LabelValueDescription
WidgetVerticalAlignment.Fill0
WidgetVerticalAlignment.Top1
WidgetVerticalAlignment.Center2
WidgetVerticalAlignment.Bottom3

WidgetVisibility

LabelValueDescription
WidgetVisibility.Hidden0
WidgetVisibility.Visible1
WidgetVisibility.VisibleNotHitTestable2

WidgetSizeRule

LabelValueDescription
WidgetSizeRule.Automatic0
WidgetSizeRule.Fill1

WidgetSpace

LabelValueDescription
WidgetSpace.World0控件在世界中被渲染为网格体,它可以像世界中的任何其他网格体一样被遮挡
WidgetSpace.Screen1控件在屏幕上渲染,完全独立于世界之外,绝不会被遮挡