Created
September 22, 2016 21:08
-
-
Save AMD-NICK/dc492adad7341cb4b3c83fbf08d42b04 to your computer and use it in GitHub Desktop.
Переключалка скайбоксов для выбора более подходящего на карте
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local ignore = { | |
["sky_day03_06b_hdr"] = true, | |
} | |
local skys = {} | |
for _,name in ipairs( file.Find("materials/skybox/*","GAME") ) do | |
local sb = string.StripExtension(name) | |
local skybox = string.sub(sb,0,-3) | |
if ignore[skybox] then continue end | |
skys[skybox] = true -- убираем дубликаты | |
end | |
print("Всего скайбоксов: " .. table.Count(skys)) | |
local funcs = {} | |
for name in pairs(skys) do | |
funcs[#funcs + 1] = function() | |
print( ("--== СМЕНА SKYBOX НА %s ==--"):format(name) ) | |
util.SetSkybox(name) | |
end | |
end | |
TL.startTask(3,funcs) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment