Какие файлы находятся в папке project unity
Перейти к содержимому

Какие файлы находятся в папке project unity

  • автор:

Структура Unity проекта

Каждый раз, начиная новый проект, я создаю структуру папок и элементов, которая будет основой. Не важно, какого размера в итоге получится проект, но имея четкую структуру с самого начала, с ним будет удобно работать, масштабировать, передавать другому разработчику.

Можно гуглить «best practices» и смотреть как делают другие, но все равно вы придёте к своему комфортному расположению ресурсов и элементов на сцене. А для тех, кто еще не определился с выбором, предлагаю свой вариант.

И так, структура папок:

Естественно, все нужно подстраивать под конкретную задачу и под команду, но будет лучше если придерживаться общей концепции для всех своих проектов.

Scripts служит для скриптов которые не связаны с объектами, например, менеджер звуков. Plugins нужен если обрабатываете входящие сообщения из плагинов iOS и Android. В Dynamic добавляются динамические, временные элементы созданные в процессе игры. Если вы делаете 2D игру, то в Level разумно было бы добавить разбивку по «слоям»: background, middleground, foreground.

Пробуйте, создавайте! Все придет с опытом. В любом случае, такой шаблон удобнее и практичнее, чем куча файлов в корневой папке и раскиданные элементы по сцене 🙂

Unity — Project Structure Best Practices!

Unity3D is a powerful suite of tools (Project IDE, Code IDE, and run-time) for game development. Unity supports several languages, but the community consensus is to use only C#.

I am a Unity Game & Tools Developer with over 20 years of game development experience. I am available for hire (Remote, Contract).

SamuelAsherRivello.com

Pros of Project Structure

Regardless of which convention you choose to use for Unity or other platforms, having a solid project structure is considered a good idea by the majority of the development community.

Having good coding standards and an established project structure is beneficial to your project and your team.

A hallmark of Getting Things Done efficiently is to automate what can be automated. Once a team has standards and project structure and adopts them (both admittedly time consuming) the time improvements in the daily workflow are notable. There is less discussion on why or how to name things. It just gets done.

Какие файлы находятся в папке project unity

Специальные Папки Проекта

You can usually choose any name you like for the folders you create to organise your Unity project. However, there are a number of folder names that Unity interprets as an instruction that the folder’s contents should be treated in a special way. For example, you must place Editor scripts in a folder called Editor for them to work correctly.

This page contains the full list of special folder names used by Unity.

Assets

Папка Assets — главная папка в которой содержатся все ассеты, которые могут быть использованы проектом на Unity. Содержимое Project view соответствует содержимому папки Assets. Большинство функций API предполагают что всё содержится в папке Assets и не требуют явного указания расположения. Однако есть некоторые функции которым нужно явно указывать папку Assets (напр. некоторые функции класса AssetDatabase).

Editor

Scripts placed in a folder called Editor are treated as Editor scripts rather than runtime scripts. These scripts add functionality to the Editor during development, and are not available in builds at runtime.

You can have multiple Editor folders placed anywhere inside the Assets folder. Place your Editor scripts inside an Editor folder or a subfolder within it.

The exact location of an Editor folder affects the time at which its scripts will be compiled relative to other scripts (see documentation on Special Folders and Script Compilation Order for a full description of this). Use the EditorGUIUtility.Load function in Editor scripts to load Assets from a Resources folder within an Editor folder. These Assets can only be loaded via Editor scripts, and are stripped from builds.

Note: Unity does not allow components derived from MonoBehaviour to be assigned to GameObjects if the scripts are in the Editor folder.

Editor Default Resources

Editor scripts can make use of Asset files loaded on-demand using the EditorGUIUtility.Load function. This function looks for the Asset files in a folder called Editor Default Resources.

You can only have one Editor Default Resources folder and it must be placed in the root of the Project; directly within the Assets folder. Place the needed Asset files in this Editor Default Resources folder or a subfolder within it. Always include the subfolder path in the path passed to the EditorGUIUtility.Load function if your Asset files are in subfolders.

Gizmos

Gizmos allow you to add graphics to the Scene View to help visualise design details that are otherwise invisible. The Gizmos.DrawIcon function places an icon in the Scene to act as a marker for a special object or position. You must place the image file used to draw this icon in a folder called Gizmos in order for it to be located by the DrawIcon function.

You can only have one Gizmos folder and it must be placed in the root of the Project; directly within the Assets folder. Place the needed Asset files in this Gizmos folder or a subfolder within it. Always include the subfolder path in the path passed to the Gizmos.DrawIcon function if your Asset files are in subfolders.

Resources

You can load Assets on-demand from a script instead of creating instances of Assets in a Scene for use in gameplay. You do this by placing the Assets in a folder called Resources. Load these Assets by using the Resources.Load function.

You can have multiple Resources folders placed anywhere inside the Assets folder. Place the needed Asset files in a Resources folder or a subfolder within it. Always include the subfolder path in the path passed to the Resources.Load function if your Asset files are in subfolders.

Note that if the Resources folder is an Editor subfolder, the Assets in it are loadable from Editor scripts but are stripped from builds.

StreamingAssets

Когда вы импортируете какой-либо стандартный пакет с ассетами (menu: Assets > Import Package) ассеты пакета размещаются в папке Standard Assets или Pro Standard Assets в случае если пакет доступен только для Про лицензии. Помимо того что папки содержат ассеты, они также влияют на порядок компиляции скриптов. Подробности смотри на странице Специальные Папки и Порядок Компиляции Скриптов.

You can only have one Standard Assets folder and it must be placed in the root of the Project; directly within the Assets folder. Place the needed Assets files in this Standard Assets folder or a subfolder within it.

StreamingAssets

You may want the Asset to be available as a separate file in its original format although it is more common to directly incorporate Assets into a build. For example, you need to access a video file from the filesystem rather than use it as a MovieTexture to play that video on iOS. Place a file in a folder called StreamingAssets, so it is copied unchanged to the target machine, where it is then available from a specific folder. See the page about Streaming Assets for further details.

You can only have one StreamingAssets folder and it must be placed in the root of the Project; directly within the Assets folder. Place the needed Assets files in this StreamingAssets folder or a subfolder within it. Always include the subfolder path in the path used to reference the streaming asset if your Asset files are in subfolders.

Assets

During the import process, Unity completely ignores the following files and folders in the Assets folder (or a sub-folder within it):

  • Hidden folders.
  • Files and folders which start with ‘.’.
  • Files and folders which end with ‘

This is used to prevent importing special and temporary files created by the operating system or other applications.

Изучение структуры папок проекта в Unity — системы контроля версий

Добрый вечер хабрчане, решил перевести один единственный урок из раздела Архитектура — MASTERING UNITY PROJECT FOLDER STRUCTURE — VERSION CONTROL SYSTEMS на официальном сайте Unity. В самом конце статья немного модифицирована, была изменена настройка проекта VCS (Version Control System).

P.S для тех кто только знакомится с Unity3d и предпочитает видеоуроки советую ознакомится с официальными видеоуроками для новичка на русском языке.

В этом уроке я хочу пролить немного света на:
— Структуру папок проекта в Unity.
— Какие папки и файлы необходимы для систем контроля версий (VCS).

Давайте создадим новый проект в Unity под названием «testproject», и импортируем пакет «Standard Assets (Mobile)», создадим новый сценарий Test.cs, присоединим его к камере и проверим нашу структуру папок.

image

Вы увидите, что есть довольно много файлов и папок, хорошие новости в том, что только две папки должны находиться под контролем: Assets и ProjectSettings. Другие папки генерируются на основе этих двух папок.

Вот краткий обзор всех файлов и папок.

Assembly-CSharp-vs.csproj и Assembly-CSharp.csproj – Visual Studio (с окончанием — vs на конце файлов) и MonoDevelop файлы проекта созданные для ваших C# скриптов.

Assembly-UnityScript-vs.unityproj и Assembly-UnityScript.unityproj – те же файлы проекта, но для скриптов JavaScript.

testproject.sln и TestProject-csharp.sln — файлы проектов для интегрированных средств разработки (IDE), первая включает в себя проект с языками — C #, JavaScript и Boo, в то время как второй файл — только для проекта с языком C # и предназначен для открытия в Visual Studio, потому что VS «не знает» скрипты JavaScript и Boo проекта.

testproject.userprefs и TestProject-csharp.userprefs — конфигурационные файлы, где MonoDevelop сохраняет текущие файлы, точки восстановления, время и т.д.

ПРИМЕЧАНИЕ: Все файлы перечисленные выше, за исключением всех файлов .userprefs , которые повторно создаются каждый раз при выборе Assets -> Sync MonoDevelop Project в меню редактора Unity (Синхронизация проекта).

СОВЕТ: После синхронизации проекта в MonoDevelop, тогда откроется testproject.sln со всеми файлами проекта, но если у вас нет кода JavaScript, то в проекте вы можете открыть TestProject-csharp.sln, который иметь в два раза меньше файлов проекта и никаких ошибок связанных с JS.

структура папок проекта в Unity:

image

Assets — папка, в которой хранятся все игровые ресурсы, в том числе скрипты, текстуры, звуки и т.д. Определенно это самая важная папка в вашем проекте.

ProjectSettings — в этой папке хранятся все настройки проекта Unity, такие как физика, теги, игровые настройки и т.д. Другими словами все, настройки которые вы сделали в меню Edit → Project Settings переходит в эту папку.

image

Library – локальный кэш для импортируемых Assets, при использовании внешней системы контроля версий (VCS) эта папка должна быть исключена из списка VCS.

OBJ и Temp — папки для временных файлов, создаваемых во время сборки проекта, OBJ используется MonoDevelop, Temp используется Unity.

Вот краткое руководство для Unity 4.x установка:

Для начала предположим, что у нас есть репозиторий от Subversion по адресу svn://my.svn.server.com/ и мы хотим создать проект по адресу svn://my.svn.server.com/MyUnityProject. Тогда следуйте данным шагам, чтобы сделать начальный импорт в систему:

  • Включите Visible Meta files в меню Edit->Project Settings->Editor
  • Закройте Unity (чтобы убедиться, что все файлы точно сохранились).
  • Удалите каталог Library внутри директории с вашим проектом.
  • Импортируйте папку с вашим проектов в Subversion. Если вы используете командную строку клиента, это делается примерно так, из папки, где ваш начальный проект размещён:
    в случае успеха, теперь проект должен быть импортирован в Subversion, и вы можете удалить каталог InitialUnityProject, если хотите.
  • Проверьте проект в Subversion SVN по адресу svn://my.svn.server.com/MyUnityProject. И проверьте, что бы папки Assets и ProjectSettings были версифицированы.
  • Откройте проект в Unity, запустив его зажав Option или левый Alt. Открытие проекта пересоздаст папку Library, указанную в шаге 4.
  • Опционально: Установите фильтр игнорирования для неверсифицированой папки Library: svn propedit svn:ignore MyUnityProject/ Subversion будет открыт в текстовом редакторе. Добавив каталог Library.
  • Наконец примените изменения. Теперь проект должен быть настроен и готов: SVN CI -m «Окончательный импорт проекта» MyUnityProject

Теперь вы готовы использовать свою любимую систему управления версиями (VCS). Не забудьте добавить все папки в список игнорируемых, кроме Assets и ProjectSettings папок.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *