add skybox||doc135728

September 20, 2022

Format

 GameSettings:addSky(right, left, top, bottom, back, front, time, transition) 

Description

Add skybox.


Precautions

  • When more than one skybox information is added, the skybox in the scene will switch to the skybox of the corresponding time period according to the day length of the game, so as to achieve the sky change when day and night alternate.
  • The value range of the time parameter here is 0 ~ 23.999, which refers to the time value calculated by the ratio of the one-day duration of the scene in the editor game settings

Parameters

Variable name type Description
right string Right image path
left string left image path
top string top image path
bottom string bottom image path
back string back image path
front string previous image path
time float Skybox existence time, the value range is 0 ~ 23.999
transition float The speed of transition to the current skybox, ranging from 0 to 1


Code Samples

Blockman.Instance().gameSettings:addSky( "Media/Textures/pocket_edition/sky/Sky03_right.png",
"Media/Textures/pocket_edition/sky/Sky03_left.png",
"Media/Textures/pocket_edition/sky/Sky03_top.png",
"Media/Textures/pocket_edition/sky/Sky03_bottom.png",
"Media/Textures/pocket_edition/sky/Sky03_back.png",
"Media/Textures/pocket_edition/sky/Sky03_front.png",1000.0,80.0
)