天气资源(Weather Asset)
约 693 字大约 2 分钟
Weather Asset 用自定义事件覆盖内置 Rain / Snow。该功能仍在持续开发。
地图可通过 Level Asset 的 Weather_Types 安排自然发生的随机天气。
如何测试?
给 weather 命令传 GUID 可启动自定义天气;传 0 可结束:
/weather 819982d7a2b6453488a8c4c5d9efe67f属性
Type:SDG.Unturned.WeatherAsset。Volume_Masku32 Bitmask:仅在当前 Ambience Volume 与该 Mask 的按位 AND 非零时启用。默认0xFFFFFFFF。Fade_In_Durationfloat:天气开始到达到完整强度的秒数。Fade_Out_Durationfloat:天气结束到强度归零的秒数。Ambient_Audio_ClipMaster Bundle Pointer:全局播放的 Audio Clip,音量随天气强度变化。Ambient_Audio_Takes_Priority_Over_Ambiance_Volumesbool:true 时,全局天气音频会让各 Ambiance Volume 音频淡出。默认 false。Override_Fogbool:是否覆盖 Lighting 中配置的 Fog。Override_Atmospheric_Fogbool:Fog 是否影响 Skybox。Shadow_Strength_Multiplierfloat:Directional Light Shadow Strength 倍率。Fog_Blend_Exponentfloat:Fog Blend Alpha 的指数。Cloud_Blend_Exponentfloat:Cloud Blend Alpha 的指数。Wind_Mainfloat:Wind Zone 的windMain。未来会被更完整的游戏专用 Wind 配置替代。Dawn/Midday/Dusk/Midnight:见下方“时段属性”。Effectsarray:见下方“Effect 属性”。Stamina_Per_Secondfloat:每秒 Stamina 增减。Health_Per_Secondfloat:每秒 Health 增减。Food_Per_Secondfloat:每秒 Food 增减。Water_Per_Secondfloat:每秒 Water 增减。Virus_Per_Secondfloat:每秒 Virus 增减。Has_Lightningbool:true 时启用 Lightning。当前为分配 Net ID 仍有硬编码,未来计划整理。Min_Lightning_Intervalfloat:两次雷击最短秒数。Max_Lightning_Intervalfloat:最长秒数。Fish_Bite_Interval_Multiplierfloat:鱼咬钩前等待时间倍率,默认 1。
时段属性
四个主要时段都可以覆盖:
Fog_Colorstruct:距离 Fog,可选覆盖 Skybox Color。Fog_Densityfloat:类似 Ambiance Volume 的 Fog Intensity,必须在 [0,1]。Cloud_Colorstruct:云内部主体颜色。Cloud_Rim_Colorstruct:云外缘颜色,比内部更明显。Brightness_Multiplierfloat:乘算全部 Ambient Lighting Color。
Effect 属性
天气启用期间可实例化多个 Effect。
PrefabMaster Bundle Pointer:包含 Particle System 的 GameObject。PlayOnAwake应关闭。与 View 绑定的效果可考虑将 Culling Mode 改为 Always Simulate。Emission_Exponentfloat:应用到“天气强度 × 默认 Constant Rate Over Time”的指数。Pitchfloat:Rotate_Yaw_With_Wind启用时的 X 轴旋转。Translate_With_Viewbool:World Space Position 是否跟 Camera。内置雨雪会跟随视角;false 时位置归零。可用于沙尘暴开始时“沙尘吹进地图”之类过渡效果。Rotate_Yaw_With_Windbool:Y 轴旋转是否跟随风向。内置雨雪会跟风转向。
Color 属性
每种颜色可使用自定义 Override,也可以引用 Level Editor Lighting Panel 中的颜色。引用 Level Color 主要为了兼容旧 Rain/Snow。
Level_Enumenum:设置后,RGB 会乘以该 Level Color。R/G/Buint8:颜色通道。
NPC Conditions
NPC Condition 可以检查全局天气状态以及当前 Weather Intensity Blend。详见后续 NPC Conditions 文档。
更新日志
2026/10/7 16:27
查看所有更新日志
ec4d3-进一步同步文档内容于
