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

🌅 天空

与内置的天空与天气系统交互。


🗿Static Class
This is a Static Class. Access it's methods directly with .. It's not possible to spawn new instances.
💂Authority
This static class can be accessed only on 🟧 Client side.
🧑‍💻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!

nanos world 原生集成了 Ultra Dynamic Sky,这是虚幻商城中最出色的资产包之一,它为游戏提供了动态的天空和天气解决方案!

通过 Sky 类,我们公开了它的方法,以便允许实时自定义其参数!

🎒 示例

Client/Index.lua
-- 生成一个新的 Ultra Dynamic Sky Actor
Sky.Spawn()

-- 将时间设为 16:30
Sky.SetTimeOfDay(16, 30)

🗿 静态函数

ReturnsNameDescription
ChangeWeather改变天气
DestroyAllSky从关卡中销毁所有的定向光源、天空光源、指数高度雾、体积云、天空大气、超动态天空 Actor 以及所有带有 Sun 标签的 Actor
integer, integer, integerGetTimeOfDay获取当前时间
WeatherTypeGetWeather获取当前天气
booleanIsSpawned返回超动态天空是否已生成
Reconstruct重新构建超动态天空 Actor,强制应用大部分更改
SetAnimateTimeOfDay设置是否为时刻开启动画
SetCloudCoverage云层的覆盖量,从晴空到阴天
SetContrast对天空材质的简单对比度提升。无法影响体积云
SetFog场景的雾度。此设置对雾气密度的影响会根据“雾气密度”类别的数值进行缩放
SetMoonAngle设置月亮角度
SetMoonGlowIntensity设置月亮光晕强度
SetMoonLightIntensity设置月亮光照强度
SetMoonPhase设置月相
SetMoonScale设置月亮大小缩放
SetMoonTexture设置月亮纹理
SetMoonTextureRotation设置月亮纹理旋转
SetMoonVerticalOffset设置月亮垂直偏移
SetNightBrightness可用于缩放夜间天空和照明的亮度
SetOverallIntensity着色器的整体亮度
SetSkyMode设置天空模式
SetSunAngle设置太阳角度
SetSunLightIntensity设置太阳光照强度
SetSunScale设置太阳大小缩放
SetTimeOfDay设置当前时间
SetVolumetricCloudColor设置体积云颜色
booleanSpawn将所有天空/太阳 Actor 替换为超动态天空 Actor,以便能够使用此页面中的函数

ChangeWeather

改变天气

Sky.ChangeWeather(weather, transition_time)
TypeParameterDefaultDescription
WeatherTypeweather Required parameter 要改变到的天气类型
floattransition_time Required parameter 完全渐变到新天气所需的时间

DestroyAllSky

从关卡中销毁所有的定向光源、天空光源、指数高度雾、体积云、天空大气、超动态天空 Actor 以及所有带有 Sun 标签的 Actor

Sky.DestroyAllSky()

GetTimeOfDay

获取当前时间

— Returns integer, integer, integer (hours, minutes, seconds).

local hours, minutes, seconds = Sky.GetTimeOfDay()

See also SetTimeOfDay.


GetWeather

获取当前天气

— Returns WeatherType.

local ret = Sky.GetWeather()

IsSpawned

返回超动态天空是否已生成

— Returns boolean.

local ret = Sky.IsSpawned(including_weather)
TypeParameterDefaultDescription
booleanincluding_weather Required parameter 是否同时检查天气 Actor

Reconstruct

重新构建超动态天空 Actor,强制应用大部分更改

Sky.Reconstruct()

SetAnimateTimeOfDay

设置是否为时刻开启动画

Sky.SetAnimateTimeOfDay(animate, day_length?, night_length?)
TypeParameterDefaultDescription
booleananimate Required parameter 是否为时刻开启动画
float or nilday_length?30.0从日出到日落的时间(分钟)
float or nilnight_length?15.0从日落到日出的时间(分钟)

SetCloudCoverage

云层的覆盖量,从晴空到阴天

Sky.SetCloudCoverage(cloud_coverage)
TypeParameterDefaultDescription
floatcloud_coverage Required parameter No description provided

SetContrast

对天空材质的简单对比度提升。无法影响体积云

Sky.SetContrast(contrast)
TypeParameterDefaultDescription
floatcontrast Required parameter No description provided

SetFog

场景的雾度。此设置对雾气密度的影响会根据“雾气密度”类别的数值进行缩放

Sky.SetFog(fog_percentage)
TypeParameterDefaultDescription
floatfog_percentage Required parameter No description provided

SetMoonAngle

设置月亮角度

Sky.SetMoonAngle(yaw, pitch)
TypeParameterDefaultDescription
floatyaw Required parameter No description provided
floatpitch Required parameter No description provided

SetMoonGlowIntensity

设置月亮光晕强度

Sky.SetMoonGlowIntensity(glow_intensity)
TypeParameterDefaultDescription
floatglow_intensity Required parameter No description provided

SetMoonLightIntensity

设置月亮光照强度

Sky.SetMoonLightIntensity(intensity)
TypeParameterDefaultDescription
floatintensity Required parameter No description provided

SetMoonPhase

设置月相

Sky.SetMoonPhase(phase)
TypeParameterDefaultDescription
floatphase Required parameter 范围为 0-30

SetMoonScale

设置月亮大小缩放

Sky.SetMoonScale(scale)
TypeParameterDefaultDescription
floatscale Required parameter No description provided

SetMoonTexture

设置月亮纹理

设为空可恢复默认值。设置后,必须调用 Sky.Reconstruct() 才能正确应用

Sky.SetMoonTexture(texture)
TypeParameterDefaultDescription
Image Pathtexture Required parameter No description provided

SetMoonTextureRotation

设置月亮纹理旋转

Sky.SetMoonTextureRotation(rotation)
TypeParameterDefaultDescription
floatrotation Required parameter No description provided

SetMoonVerticalOffset

设置月亮垂直偏移

Sky.SetMoonVerticalOffset(offset)
TypeParameterDefaultDescription
floatoffset Required parameter No description provided

SetNightBrightness

可用于缩放夜间天空和照明的亮度

Sky.SetNightBrightness(brightness)
TypeParameterDefaultDescription
floatbrightness Required parameter No description provided

SetOverallIntensity

着色器的整体亮度

Sky.SetOverallIntensity(intensity)
TypeParameterDefaultDescription
floatintensity Required parameter No description provided

SetSkyMode

设置天空模式

设置后,必须调用 Sky.Reconstruct() 才能正确应用

Sky.SetSkyMode(sky_mode)
TypeParameterDefaultDescription
SkyModesky_mode Required parameter No description provided

SetSunAngle

设置太阳角度

Sky.SetSunAngle(yaw, pitch)
TypeParameterDefaultDescription
floatyaw Required parameter No description provided
floatpitch Required parameter No description provided

SetSunLightIntensity

设置太阳光照强度

Sky.SetSunLightIntensity(intensity)
TypeParameterDefaultDescription
floatintensity Required parameter No description provided

SetSunScale

设置太阳大小缩放

Sky.SetSunScale(radius)
TypeParameterDefaultDescription
floatradius Required parameter No description provided

SetTimeOfDay

设置当前时间

Sky.SetTimeOfDay(hours, minutes, transition_time?)
TypeParameterDefaultDescription
integerhours Required parameter No description provided
integerminutes Required parameter No description provided
float or niltransition_time?0.0No description provided

See also GetTimeOfDay.


SetVolumetricCloudColor

设置体积云颜色

这仅在设置了 SetSkyMode(SkyMode.VolumetricClouds) 时才会应用

Sky.SetVolumetricCloudColor(color)
TypeParameterDefaultDescription
Colorcolor Required parameter No description provided

Spawn

将所有天空/太阳 Actor 替换为超动态天空 Actor,以便能够使用此页面中的函数。在内部,这会自动调用 Sky.DestroyAllSky()

— Returns boolean (如果地图中找到了现有的超动态天空 Actor 并使用了其引用,则返回 true;如果生成了一个新的,则返回 false).

local ret = Sky.Spawn(spawn_weather?, find_existing?)
TypeParameterDefaultDescription
booleanspawn_weather?false是否生成天气 Actor(以便能够使用与天气相关的方法)
booleanfind_existing?true是否尝试寻找地图中已生成的现有天空与天气 Actor,并改用它们的引用

🚀 事件

This class doesn't have own events.