참고 문서 : https://unity.com/how-to/organizing-your-project
Assets
+---Art
| +---Materials
| +---Models
| +---Textures
+---Audio
| +---Music
| \---Sound
+---Code
| +---Scripts
| \---Shaders
+---Docs
+---Level
| +---Prefabs
| +---Scenes
| \---UI
Assets
+---Art
| +---Materials
| +---Models
| +---Music
| +---Prefabs
| +---Sound
| +---Textures
| +---UI
+---Levels
+---Src
| +---Framework
| \---Shaders
아래 스크립트를 Editor 폴더 하위에 추가하고 실행하면 된다.
using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
using System.IO;
public class CreateFolders : EditorWindow
{
private static string projectName = "EditorTest";
[MenuItem("Assets/Create Default Folders")]
private static void SetUpFolders()
{
CreateFolders window = ScriptableObject.CreateInstance<CreateFolders>();
window.position = new Rect(Screen.width / 2f, Screen.height / 2f, 400, 150);
window.ShowPopup();
}
private static void CreateAllFolders()
{
var folders = new List<string>
{
"Animations",
"Audio",
"Editor",
"Materials",
"Meshes",
"Prefabs",
"Scripts",
"Scenes",
"Shaders",
"Textures",
"UI"
};
foreach (string folder in folders)
{
if (!Directory.Exists("Assets/" + folder))
{
Directory.CreateDirectory("Assets/" + folder);
}
}
var uiFolders = new List<string>
{
"Assets",
"Fonts",
"Icon"
};
foreach (string subfolder in uiFolders)
{
if (!Directory.Exists("Assets/UI/" + subfolder))
{
Directory.CreateDirectory("Assets/UI/" + subfolder);
}
}
AssetDatabase.Refresh();
}
void OnGUI()
{
EditorGUILayout.LabelField("Insert the Project name used as the root folder");
projectName = EditorGUILayout.TextField("Project Name: ", projectName);
this.Repaint();
GUILayout.Space(70);
if (GUILayout.Button("Generate!"))
{
CreateAllFolders();
this.Close();
}
}
}
Unity는 프로젝트에 있는 모든 폴더에 .meta 파일을 생성한다. meta 파일은 연결된 파일에 대한 많은 중요한 정보를 가지고 있으므로 다른 자동 생성 파일과는 달리 커밋이 필수적이다. 프로젝트에서 Git을 사용할 경우, 빈 폴더는 자동으로 커밋되지 않지만 meta 파일은 커밋된다. 빈 폴더 하위에 .gitkeep 파일을 추가하여 해당 문제를 해결할 수 있다.
largeButton
LargeButton
leftButton
lButton
OutOfMemoryException
dateTimeFormat
Outofmemoryexception
datetimeformat
EnterButton_Active
EnterButton_Inactive
Foliage_Diffuse
Foliage_Normalmap
Building_LOD1
Building_LOD0
Node0
Node1
Node2