Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Creates the base folder structure for a game in Unity
--created by Corey Wolff
--makes the folder structure as well as the blank unity project.
drvLibGame() --import lib
fn MakePrjDir theArray thePrefix = ( --recursive folder creator
if(classof theArray == array) then (
for i = 1 to theArray.count do(
MakePrjDir theArray[i] thePrefix
)
)
else (
makedir ( thePrefix + theArray)
)
)
fn DefineDirectoryStructure = (
DS = #()
DS[1] = #() --define the Asset creation folders -----------------------------------------------
DS[1][1] = @"Meshes\Character"
DS[1][2] = @"Meshes\Environment"
DS[1][3] = @"Meshes\Props"
DS[2] = #()
DS[2][1] = @"UI\Finished"
DS[2][2] = @"UI\Elements"
DS[3] = #()
DS[3][1] = @"Design"
DS[4] = #()
DS[4][1] = @"FX"
DS[5] = #()
DS[5][1] = @"Unity"
UnityDS = #() -- Defining the Unity structure --------------------------------------------
UnityDS[1] = #()
UnityDS[1][1] = @"Art\Character"
UnityDS[1][2] = @"Art\Environment"
UnityDS[1][3] = @"Art\Props"
UnityDS[1][4] = @"Art\FX"
UnityDS[1][5] = @"Art\UI"
UnityDS[2] = #()
UnityDS[2][1] = @"Prefabs\Characters"
UnityDS[2][2] = @"Prefabs\Environment"
UnityDS[2][3] = @"Prefabs\UI"
UnityDS[3] = @"Code"
UnityDS[4] = @"Scenes"
UnityDS[5] = @"Scratch"
)
makeUnityPrj = ""
try(deleteDialog makeUnityPrj) catch()
rollout makeUnityPrj "Create Unity Project" (
edittext _prjName "Name" text:"Default"
checkbox _openUnity "Open Unity"
button _doTheThing "Create Project"
on _doTheThing pressed do(
if(_prjName.text != "Default") then (
prjName = _prjName.text
MakePrjDir DS (prjDrv+@"\" + prjName +@"\")
unityDir = (prjDrv + prjName+ "\\Unity\\")
assetsDir = unityDir + @"\Assets\"
DOSCommand ("\"C:\Program Files (x86)\Unity\Editor\Unity.exe\" -batchMode -quit -createProject " +unityDir)
MakePrjDir UnityDS assetsDir
if(_openUnity.checked == true) then (
DOSCommand ("\"C:\Program Files (x86)\Unity\Editor\Unity.exe\" -projectpath " +unityDir)
)
)
else (
messagebox "Name your project"
)
)
)
createDialog makeUnityPrj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.