Hello Guys, I have made a button to change sky box, when someone click on that button, it should change the sky boxes but it doesn't work, so can anyone please check what's wrong with that code
Thanks in advance
def ClickSky(self):
if constInfo.Night == 0:
background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
background.SetEnvironmentData(1)
constInfo.Night = 1
elif constInfo.Night == 2:
background.RegisterEnvironmentData(2, constInfo.ENVIRONMENT_Skybox4)
background.SetEnvironmentData(2)
constInfo.Night = 2
elif constInfo.Night == 3:
background.RegisterEnvironmentData(3, constInfo.ENVIRONMENT_Skybox3)
background.SetEnvironmentData(3)
constInfo.Night = 3
elif constInfo.Night == 4:
background.RegisterEnvironmentData(4, constInfo.ENVIRONMENT_Skybox2)
background.SetEnvironmentData(4)
constInfo.Night = 4
elif constInfo.Night == 0:
background.RegisterEnvironmentData(0, constInfo.ENVIRONMENT_Skybox1)
background.SetEnvironmentData(0)
constInfo.Night = 0
else:
background.SetEnvironmentData(0)
constInfo.Night = 0
snd.PlaySound('sound/ui/pick.wav')