External tools unity где
Перейти к содержимому

External tools unity где

  • автор:

Preferences

Use preferences to customize the behavior of the Unity Editor.

To access the Preferences window, go to Edit > Preferences (Windows) or Unity > Preferences (macOS) from the main menu in Unity.

To navigate the Preferences window, use the search box to filter the list of settings categories and highlight keywords in the details pane on the right of the Preferences window.

The following preference categories are available:

General

General preferences let you customize the overall behavior for working in Unity.

This allows you to throttle Editor performance, and reduce consumption of CPU resources and power.

For example, if you want to test the Editor’s performance, set this property to No Throttling. If you want to conserve power (for example, to prolong battery life on a laptop computer), set this property to one of the throttled modes.

In throttled modes, the Editor stops idling if you interact with it (for example, by panning in the Scene view).

The 2D preference settings allow you to define the settings of 2D-related features and packages. When you install 2D related packages (such as the Tilemap Editor package) into your Project, their preference settings will appear in this section.

Physics

Use the Physics preferences to configure the 2D physics settings, such as the colors used in the UI (User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
See in Glossary .

Property Function
Colliders An invisible shape that is used to handle physical collisions for an object. A collider doesn’t need to be exactly the same shape as the object’s mesh — a rough approximation is often more efficient and indistinguishable in gameplay. More info
See in Glossary
Set the colors for the following UI elements.
Awake Color (Outline) Set the color of the Collider 2D Gizmo A graphic overlay associated with a GameObject in a Scene, and displayed in the Scene View. Built-in scene tools such as the move tool are Gizmos, and you can create custom Gizmos using textures or scripting. Some Gizmos are only drawn when the GameObject is selected, while other Gizmos are drawn by the Editor regardless of which GameObjects are selected. More info
See in Glossary ’s outline when the Rigidbody A component that allows a GameObject to be affected by simulated gravity and other forces. More info
See in Glossary 2D it’s attached to is Awake.
Awake Color (Filled) Set the color of the Collider 2D Gizmo’s interior fill when the Rigidbody 2D it’s attached to is Awake.
Asleep Color (Outline) Set the color of the Collider 2D Gizmo’s outline when the Rigidbody 2D it’s attached to is Asleep.
Asleep Color (Filled) Set the color of the Collider 2D Gizmo’s interior fill when the Rigidbody 2D it’s attached to is Asleep.
Bounds Color Set the color of the bounds for all PhysicsShape2D that a Collider 2D creates.
Contacts Set the colors used for the following UI elements.
Contact Color Set the color of the Collider 2D Gizmo’s contacts which are displayed as a directional arrow starting at the contact point in the direction of the contact normal.
Contact Arrow Scale Set the scale of the Collider 2D contacts arrow. Larger values draw the arrow larger.

Analysis

The Analysis preferences let you define settings for the Profiler A window that helps you to optimize your game. It shows how much time is spent in the various areas of your game. For example, it can report the percentage of time spent rendering, animating, or in your game logic. More info
See in Glossary .

Property Function
Frame count Set the maximum number of frames for the Profiler to capture. You can set this number between 300 and 2,000.
Show stats for ‘current frame’ By default, when you select the Current Frame button and enter Current Frame mode, the frame indicator line doesn’t have annotations with the stats for the current frame. This is because the stats annotations might make it difficult to view data in real-time. To display the annotations, enable this setting.
Default recording state Select which recording state the Profiler should open in. Choose from Enabled, Disabled, or Remember. Enabled keeps the Record button enabled between sessions, while Disbled disables it, regardless of whether you turn it on or off during your profiling session. The Remember state remembers whether you have enabled or disabled the Record button during your session and keeps it at its last state next time you open the Profiler window.
Default editor target mode Select what mode the Attach to Player dropdown should target by default. Choose from either Playmode or Editor.
Custom connection ID Enter the connection name that you want to use for the device that’s running your application in the Attach to Player drop down in the Profiler Window or Console Window A Unity Editor window that shows errors, warnings and other messages generated by Unity, or your own scripts. More info
See in Glossary .

Asset Pipeline

Property Function
Auto Refresh Enable this setting to import Assets automatically as they change.
Import Worker Count % Enter your Desired Import Worker Count for new projects in percentage of available logical CPU cores. For example, if your system has 16 logical cores and this preference is set to 25%, the Desired Import Worker Count for new projects is set to 4. If you set this value too high, your import worker processes need to compete over other processes and system resources such as reading and writing files. The default value of 25% is suitable for most situations.
Directory Monitoring (available only on Windows) Enable this setting to monitor directories instead of scanning all project files to detect asset changes.
Compress Textures on Import Disable this setting to skip texture compression A method of storing data that reduces the amount of storage space it requires. See Texture Compression, Animation Compression, Audio Compression, Build Compression.
See in Glossary during import. Textures are typically imported into uncompressed formats.
Verify Saving Assets Enable this setting to verify which Assets to save individually. A dialog is shown any time Unity saves any assets.
Unity Accelerator (Cache Server)
Default Mode Define the default setting for the Cache Server, whether to enable or disable it by default. You can override this per Project in the Unity Editor settings. For more information, see Unity Accelerator.
Default IP address Set the default IP address for the Cache Server to use. You can override this per Project in the Unity Editor settings.
Check Connection Click this button to attempt to connect to the remote Cache Server.

Colors

The Colors preferences let you pick colors for various user interface elements in the Unity Editor.

Property Function
Animation Use this setting to customize color preferences for animated properties.
Property Animated The color to indicate a property that’s currently being animated.
Property Candidate The color to indicate the animated property that you modified recently.
Property Recorded The color to indicate that an animated property automatically records changes in the animation clip Animation data that can be used for animated characters or simple animations. It is a simple “unit” piece of motion, such as (one specific instance of) “Idle”, “Walk” or “Run”. More info
See in Glossary .
General Use this setting to customize color preferences for General settings.
Playmode Tint The color to tint the editor to for ease of identifying when you’re in Play mode. Unity tints the whole editor with the color you pick here when you enter Play mode. Some operations in the Editor aren’t available when in Play mode, and you can reset some edited values when exiting the Play mode.
Scene Use this setting to customize preferences for a Scene.
Background Set the color for the scene camera A component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary to clear to when the Scene FX skybox A special type of Material used to represent skies. Usually six-sided. More info
See in Glossary setting is turned off.
Background for Prefabs An asset type that allows you to store a GameObject complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. More info
See in Glossary
Set the color for the scene camera to clear to when the Scene FX skybox setting is turned off.
Contribute GI: Off / Receive GI: Light Probes Light probes store information about how light passes through space in your scene. A collection of light probes arranged within a given space can improve lighting on moving objects and static LOD scenery within that space. More info
See in Glossary
Set the color to display when ContributeGI is disabled in the GameObject The fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary ’s Static Editor Flags.
Contribute GI: On / Receive GI: Light Probes Set the color to display when ContributorGI is enabled in the GameObject’s Static Editor Flags, and the Renderer’s ReceiveGI property is set to Lightmaps A pre-rendered texture that contains the effects of light sources on static objects in the scene. Lightmaps are overlaid on top of scene geometry to create the effect of lighting. More info
See in Glossary
.
Contribute GI: On / Receive GI: Lightmaps Set the color to display when ContributeGI is enabled in the GameObject’s Static Editor Flags, and the Renderer’s ReceiveGI property is set to Light Probes.
Grid Set the color of the grid in the Scene view.
Guide Line Set the color of the Guide Line in the Scene view.
Material Validator Pure Metal Set the color for the Validate Albedo/Metal Specular debug render mode to indicate the material properties.
Material Validator Value Too High Set the color for the Validate Albedo/Metal Specular debug render mode to indicate when the material value is too high.
Material Validator Value Too Low Set the color for the Validate Albedo/Metal Specular debug render mode to indicate when the material value is too low.
Selected Axis Set the color for the selected handle to show highlighted in, when Move, Rotate, or the Scale tool is engaged.
Selected Children Outline Set the outline color for the children of the selected objects.
Selected Material Highlight Set the outline color that shows when clicking on a mesh The main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary in the MeshRenderer to ping the submesh in the Scene view.
Selected Outline Set the outline color for the selected GameObjects.
UI Collider Handle Set the color to use for the Unity UI’s padding visualization.
Volume Gizmo Set the color to indicate the audio source A component which plays back an Audio Clip in the scene to an audio listener or through an audio mixer. More info
See in Glossary in Gizmo.
Wireframe Set the color of the wireframe when the wireframe render mode is active.
Wireframe Overlay Set the color of the wireframe when the textured wireframe render mode is active.
Wireframe Selected If you’ve enabled Selection Wire in the Gizmo options, then the selected wireframes appear in the color that you set here.
X Axis The color that you set here is indicated for any built-in transform tool handle affecting x-axis.
Y Axis The color that you set here is indicated for any built-in transform tool handle affecting y-axis.
Z Axis The color that you set here is indicated for any built-in transform tool handle affecting z-axis.

Diagnostics

When you report a problem to Unity, the Unity Support Team might need you to enable diagnostic switches to help identify the cause. Running diagnostics on an application, whether in the Editor or a player, impacts performance and user experience. You should only run diagnostics when the Unity Support Team requires them.

If diagnostic switches are active in your application, Unity shows a warning in the console. To reset switches, in the Diagnostics tab, click Reset all.

If an active diagnostic switch prevents the Unity Editor from opening, use the —reset-diagnostic-switches parameter to reset all switches from the command line. For more information on using command line arguments at launch, see Command line arguments.

External Tools

Use the External Tools preferences to set up external applications for scripting, working with images, and source control.

SETTING UP VSCODE FOR UNITY

Visual Studio Code is one of the more popular code editors out there. It is lightweight and extensible making it one of the more versatile options when programming. Getting it set up to use with Unity requires a few configuration changes and the installation of an extension.

About

  • Subjects: VSCode and Unity
  • Objective: The purpose of this post is to walk you through how to install VSCode and get it setup to work with Unity.
  • Time Allotment: 15 min

Getting Started

Installing VSCode

First thing you will need is a copy of VSCode. You can download the latest version of Visual Studio Here. Find the version you need from the dropdown and select the stable version.

Install Unity

Next, you will need Unity. There are quite a few options when selecting your plan for Unity, you can read over all the details here, or check out our article on setting up Unity here.

Update Unity Preferences

Once you have your project opened inside of Unity, select Edit and then Preferences.

This will open up a window that has a few general settings. We are looking for External Tools. In the panel on the right, you will now see the External Tools settings. Locate the External Script Editor setting and change the drop down to Visual Studio Code. Just close the window to save these changes.

Installing the C# extension

Now you will want to install the C# extension for VSCode to gain access to more features with intellisense, code snippets, and refactoring for C#. To get the extension locate the extensions marketplace on the left side of the editor, it is the one that looks like four cubes.

From here search for C# in the search bar. You will then see a list of extensions related to C#. The one we are looking for is simply titled C# and is developed by Microsoft.

Click the install button located in the bottom right corner of the C# search result and installation will begin. The editor will need to refresh before the extension can take effect. This can either be done by selecting reload when prompted or by closing and reopening the editor.

Try it out

Now we are able to test out our new editor from Unity. Head over to Unity and select Assets > Create > C# Script. This will generate a C# script in projects asset folder.

The script will be selected automatically and selected for renaming. Name the script whatever you would like and double click the file.

This will open up the file in VSCode and automatically load the project folder into the workspace on the left side of the editor. From here you can edit the file or create new files and when you go back to Unity the updates will be loaded instantly.

Errors

Occasionally, normally after software updates, Unity will show an error stating IndexOutOfRangeException and lists VSCodeEditor.ProjectGeneration as the issue.

To solve this error, in Unity go to Window > Package Manager.

This will open a new window. From here make sure that All Packages is selected in the top left. Scroll down until you see Visual Studio Code Editor. There should be multiple versions listed. Select the latest version, which will display the version information on the right-side panel. At the bottom select Update to the selected version number. Once this is done clear the console and the error message will not reappear.

Another common error that can occur is when importing UnityEngine.UI into your scripts you will get an error that the namespace cannot be found. This will not cause issues with your scripts running inside of Unity but can be annoying since you will have red showing in any file using the package.

The fix for this is quite simple, just follow the steps listed above for the IndexOutOfRangeException with one exception. If upgrading the Visual Studio Code Editor does not fix the issue then you may need to downgrade to the previous version. This can be done by selecting See all versions and looking for a version number lower than the currently enabled version.

That is all for this tutorial on setting up VSCode for Unity. If you found this helpful leave a comment down below letting us know. Having a problem beyond what we talked about here? Tell us what it is in the comment section and we will find a solution and add it to the list of error fixes.

Настройки Preferences

Unity предоставляет ряд настроек, позволяющих настроить поведение редактора Unity.

Чтобы получить доступ к окну Настройки, выберите Правка > Настройки (Windows) или Unity > Настройки (macOS) из главного меню Unity. Доступны следующие категории предпочтений:

Навигация в окне настроек

Используйте окно поиска, чтобы отфильтровать список категорий настроек, и выделите ключевые слова на панели сведений справа.

General

Общие настройки позволяют настроить общее поведение для работы в Unity.

Покрытие кода помогает определить, какая часть вашего кода была выполнена. Обычно это связано с автоматическими тестами, но вы можете собирать данные о покрытии в Unity в любое время, когда работает редактор.

Это позволяет снизить производительность редактора и снизить потребление ресурсов ЦП и мощности.

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

В регулируемых режимах редактор перестает простаивать, если вы взаимодействуете с ним (например, панорамируя в представлении «Сцена»).

Примечание. В режиме воспроизведения Unity игнорирует любое регулирование, которое вы применяете с помощью этого параметра. Редактор обновляется максимально быстро, если только вы не включите параметр VSync в виде игры или не установите значение Application.targetFrameRate кроме –1.

Этот режим потребляет много ресурсов ЦП. Если вы используете портативный компьютер, это может привести к быстрой разрядке аккумулятора.

При выборе этого параметра появляется свойство Дросселирование кадров (в миллисекундах).

Используйте Max Sprite A 2D-графические объекты. Если вы привыкли работать в 3D, спрайты — это, по сути, просто стандартные текстуры, но существуют специальные приемы комбинирования текстур спрайтов и управления ими для повышения эффективности и удобства во время разработки. Подробнее
См. в Словарь Размер кэша Atlas (ГБ)
установка максимального размера Атласа спрайтов текстуры, состоящей из нескольких меньших текстуры. Также называется атласом текстуры, спрайтом изображения, листом спрайта или упакованной текстурой. Подробнее
Смотрите в Словарь . Когда это возможно, Unity сохраняет размер этой папки ниже этого уровня.

2D-область в окне настроек2D-область в окне настроек

Analysis

Настройки Анализ позволяют определить настройки для Profiler Окно, помогающее оптимизировать игру. Он показывает, сколько времени вы тратите на различные области вашей игры. Например, он может сообщать о проценте времени, затраченном на рендеринг, анимацию или игровую логику. Подробнее
См. в Словарь .

Область анализа в окне настроекОбласть анализа в окне настроек

Свойство Функция
Frame count Установите максимальное количество кадров для захвата профилировщиком. Вы можете установить это число от 300 до 2000.
Show stats for ‘current frame’ По умолчанию, когда вы нажимаете кнопку Текущий кадр и входите в режим текущего кадра, в строке индикатора кадра нет примечаний со статистикой для текущего кадра. Это связано с тем, что аннотации статистики могут затруднить просмотр данных в режиме реального времени. Чтобы отображать аннотации, включите этот параметр.
Default recording state Выберите, в каком состоянии записи должен открываться Профилировщик. Выберите из Включено, Отключено или Запомнить. Если выбрано значение Enabled, кнопка Запись остается активной между сеансами, а значение Disbled отключает ее, независимо от того, включили вы ее или нет во время сеанса профилирования. Состояние Запомнить запоминает, активировали ли вы кнопку Запись во время сеанса, и сохраняет ее в последнем состоянии при следующем открытии окна Profiler..
Default editor target mode Выберите, какой режим должен использоваться по умолчанию в раскрывающемся списке Прикрепить к проигрывателю. Выберите либо Режим воспроизведения, либо Редактор.

Кэш-сервер

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

Область Cache Server в окне PreferencesОбласть Cache Server в окне Preferences

Свойство Функция
New Projects default asset pipeline Выберите конвейер ресурсов по умолчанию для новых проектов.
Active version Отображает текущую версию конвейера активов.
Asset pipeline v1 (deprecated)
Cache Server Mode Определите сервер кэширования автономное приложение, которое вы можете запустить на локальном компьютере, хранящее импортированные данные активов, чтобы сократить время, необходимое для импорта активов. Подробнее
Смотрите в режиме Словарь .
Локальный: используйте локальный сервер кэширования на этом компьютере. Появятся настройки Локальное хранилище.
Удаленный: используйте сервер кэширования, размещенный на удаленном компьютере. Появятся настройки Удаленного хостинга.
По умолчанию Cache Server отключен.
Asset pipeline v2
Cache Server Default Mode Определить, включен или выключен сервер кэширования по умолчанию. Вы можете переопределить это для каждого проекта в настройках редактора Unity.
Дополнительную информацию об использовании Asset Pipeline v2 см. в Unity Accelerator.
Default IP address Установите IP-адрес по умолчанию для использования Cache Server. Вы можете переопределить это для каждого проекта в настройках редактора Unity..
Check Connection Нажмите эту кнопку, чтобы попытаться подключиться к удаленному серверу кэширования.

Удаленный хостинг

Эти настройки доступны, только если для параметра Использовать сервер кэширования установлено значение Удаленный.

Настройки удаленного кэш-сервераНастройки удаленного кэш-сервера

Свойство Функция
IP Address Введите IP-адрес выделенного сервера кэширования, настроенного администратором.
Check Connection Нажмите эту кнопку, чтобы попытаться подключиться к удаленному серверу кэширования.

Локальное хранилище

Эти настройки доступны, только если для параметра Использовать сервер кэширования установлено значение Локальный.

Настройки локального кэш-сервераНастройки локального кэш-сервера

Свойство Функция
Maximum Cache Size (GB) Укажите максимальный размер в гигабайтах для Cache Server в хранилище этого компьютера. Минимальный размер 1 Гб. Максимальный размер составляет 200 ГБ.
Размер кэша по умолчанию составляет 10 ГБ.
Custom cache location Включите этот параметр, чтобы указать место, где вы хотите хранить кеш..
Cache Folder Location Нажмите кнопку Обзор, чтобы указать расположение кэша.
Cache size is Сообщение, отображающее текущий размер кеша. Прежде чем нажать кнопку Проверить размер кэша, появится сообщение Размер кэша неизвестен. После нажатия кнопки в сообщении появится рассчитанный размер кэша.
Check Cache Size Щелкните здесь, чтобы узнать, сколько памяти использует локальный сервер кэширования. Эта операция может занять некоторое время, если у вас большой проект.
Clean Cache Удалить содержимое кеша.
Cache Folder Location Отображает текущее расположение папки кэша.

Цвета

Настройки Цвета позволяют выбрать цвета, которые Unity использует при отображении различных элементов пользовательского интерфейса.

Диапазон цветов в окне «Настройки»Диапазон цветов в окне «Настройки»

Внешние инструменты

Используйте настройки Внешние инструменты для настройки внешних приложений для сценариев, работы с изображениями и управления версиями.

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

При наличии таких файлов редакторы кода могут использовать содержащиеся в них данные для предоставления полезных функций, таких как выделение потенциальных ошибок компиляции. Включите этот параметр, чтобы указать Unity создавать файлы .csproj везде, где это возможно в вашем проекте..

Примечание. При изменении этого параметра необходимо перезапустить Unity, чтобы изменения вступили в силу.

Дополнительную информацию см. в разделе Контроль версий Diff/Merge ниже.

Различие/объединение контроля версий

В настоящее время Unity поддерживает следующие инструменты:

  • SourceGear DiffMerge
  • TkDiff
  • P4Merge
  • TortoiseMerge
  • WinMerge
  • PlasticSCM Merge
  • Beyond Compare 4

Примечание. Это сторонние инструменты, которые Unity не включает по умолчанию. Их необходимо загрузить и установить отдельно.

Чтобы настроить пользовательский инструмент редактирования, выполните следующие действия:

  1. В раскрывающемся списке Различие/объединение контроля версий выберите Пользовательский инструмент.
  2. Введите путь к папке установки пользовательского инструмента. На Mac это должно указывать на папку Contents/MacOS в папке установки инструмента.
  3. Введите аргументы для двустороннего сравнения, трехстороннего сравнения и слияния.

Чтобы указать макет файла в инструменте редактирования, используйте следующие аргументы:

Свойство Функция
#LTITLE Левый заголовок
#RTITLE Правый заголовок
#ATITLE Название предка
#LEFT Левый файл
#RIGHT Правый файл
#ANCESTOR Файл-предок
#OUTPUT Выходной файл
#ABSLEFT Абсолютный путь к левому файлу
#ABSRIGHT Абсолютный путь к нужному файлу
#ABSANCESTOR Абсолютный путь к файлу-предку
#ABSOUTPUT Абсолютный путь к выходному файлу

SourceGear DiffОбъединитьSourceGear DiffОбъединить P4MergeP4Merge

Кэш GI

Глобальное освещение Группа методов, которые моделируют как прямое, так и непрямое освещение для получения реалистичных результатов освещения. . В Unity есть две системы глобального освещения, сочетающие прямое и непрямое освещение: запеченное глобальное освещение и глобальное освещение в реальном времени.
См. в Словарь (GI) система использует кэш на каждом компьютере для хранения промежуточных файлов, используемых для предварительного расчета глобального освещения в реальном времени. Все проекты на компьютере имеют общий кэш.

Область GI Cache в окне настроекОбласть GI Cache в окне настроек

Свойство Функция
Maximum Cache Size (GB) Используйте ползунок, чтобы установить максимальный размер папки кэша GI. Unity сохраняет размер папки кэша GI ниже этого числа, когда это возможно. Unity периодически удаляет неиспользуемые файлы, чтобы освободить место (сначала удаляются самые старые файлы). Это автоматический процесс, который не требует от вас каких-либо действий.
Примечание. Если текущая сцена использует все файлы в кэше GI, увеличьте размер кэша. В противном случае при запекании происходит ресурсоемкий пересчет. Это может произойти, когда сцена очень большая или размер кэша слишком мал.
Custom cache location Включите этот параметр, чтобы разрешить пользовательское расположение папки кэша GI. По умолчанию кэш GI хранится в папке Caches. Все проекты имеют общую папку кеша.
Совет. Хранение GI Cache на SSD-накопителе может ускорить запекание в случаях, когда процесс запекания ограничен вводом-выводом.
Cache Folder Location Нажмите кнопку Обзор, чтобы указать расположение кэша..
Cache compression Включите эту опцию, чтобы разрешить Unity сжимать файлы в кэше GI и уменьшать размер генерируемых данных. Файлы по умолчанию сжаты LZ4, а схема именования представляет собой хэш и расширение файла. Хэши вычисляются на основе входных данных системы освещения, поэтому изменение любого из следующих параметров может привести к пересчету освещения:
— Материалы (текстуры, альбедо, эмиссия)
— Освещение
— Геометрия
— Статические флаги
— Группы Light Probe
— Датчики отражения
— Параметры карты освещения
Совет. Если вам нужен доступ к необработанным данным Enlighten, отключите сжатие кеша и очистите кеш.
Clean Cache Используйте эту кнопку, чтобы очистить каталог кеша.
Небезопасно удалять каталог GI Cache вручную во время работы редактора. Это связано с тем, что редактор создает папку GiCache при запуске и поддерживает набор ссылок на эти файлы. Кнопка Очистить кэш гарантирует, что редактор освободит все ссылки на файлы на диске перед их удалением.
Cache size is Отображает текущий размер кэша.
Cache Folder Location Отображает текущее расположение папки кэша.

Вид сцены

Используйте настройки просмотра сцен, чтобы настроить размещение и видимость объектов во время редактирования.

Область просмотра сцены в окне «Настройки»Область просмотра сцены в окне «Настройки»

Свойство Функция
Create Objects at Origin Включите, чтобы создавать новые объекты в исходной точке (в отличие от точки поворота сцены). Отключено по умолчанию.
Line Thickness Установите толщину линии для ваших инструментов преобразования.
Enable filtering while searching Включите, чтобы выделить серым цветом любые несоответствующие элементы в представлении «Сцена». Включено по умолчанию.
Enable filtering while editing LOD groups Включите, чтобы другие объекты в сцене отображались серым цветом при редактировании групп LOD. Включено по умолчанию.

Масштабирование пользовательского интерфейса

UI (пользовательский интерфейс) Позволяет пользователю взаимодействовать с вашим приложением. Подробнее
См. в Словарь Настройки масштабирования позволяют определить, как масштабировать текст и значки пользовательского интерфейса в Редактор Unity.

Область масштабирования пользовательского интерфейса в окне «Настройки»Область масштабирования пользовательского интерфейса в окне «Настройки»

Свойство Функция
Use default desktop setting Включите этот параметр, чтобы использовать настройки вашего компьютера по умолчанию для масштабирования текста и значков пользовательского интерфейса.
Current scaling Отображает текущее значение масштабирования.
Use custom scaling value Переопределите значение масштабирования.

Настройки пользовательского пакета

Некоторые пакеты Asset Store или Unity добавляют собственные настройки в окно Настройки. Обычно они используют имя пакета в качестве категории предпочтений. В этом примере вы можете увидеть настройки Cinemachine:

В списке областей отображаются настройки, относящиеся к конкретному пакету.В списке областей отображаются настройки, относящиеся к конкретному пакету.

Для получения информации о настройках конкретного пакета см. документацию по этому пакету. Этот раздел содержит документацию только для стандартных настроек Unity.

How to export a game or App from Unity to Android

In this article we see how to export a game from Unity to Android and look at some of the problems we may encounter in the process and how to fix them.

In the following link you can see the basic setup to export a Unity project to Android, creating a 32 and 64 bits version that can be uploaded to Google Play, I also show how I solved an annoying error with the message “IL2CPP.exe did not run properly”.

Download Unity and the Android package

When installing Unity we must make sure we also download the Android package, so if you haven’t done this or don’t remember it, it’s a good opportunity to download the latest version of Unity along with all the necessary packages.

In particular I like to see all available versions, so in Google I usually search with the term “unity version download”, which leads me to the page with all versions (first page in figure 1).

Fig. 1: We look for the page that contains all versions of Unity.

From there we will access a page like the one shown in figure 2, in my case, because my connection is somewhat unstable, I download Unity using torrent.

Fig. 2: In the list we have several options to download Unity.
Fig. 3: In my case I download the latest version by torrent.

Clicking the highlighted option in Figure 3 automatically downloads a torrent file.

Fig. 4: Downloading the torrent file and open it.

We will need to download the Unity editor and the Android Build Support, in figure 5 are selected the necessary packages.

torrent window to download the different unity installers

Fig. 5: In the torrent window we choose the necessary files, in this case we need at least the two selected files.

Configure Android SDK y JDK

To export our Unity games to Android we need to use some external tools, the Android Software Development Kit and the Java Development Kit.

If you don’t have these two kits installed, I’ll show you some screenshots and download links later, for now let’s assume they are installed and move on to the Unity part.

Enter Edit > Preferences and go to the External Tools part, there must be fields to indicate the path of the Android SDK and JDK, as seen at the bottom of figure 6.

preferences window, external unity tools to select the location of android sdk and jdk to export from unity to android

Fig. 6: In the preferences window we go to the External Tools part.

By clicking on Browse, we indicate the path of these two development kits. The default installation path of the Android SDK is shown in figure 7, please note that the AppData folder could be hidden.

The path of the JDK is shown in Figure 8, inside program files, Java.

Fig. 7: This is the location of the Android SDK, if you do not find this on your disc read below.
Fig. 8: This is the location of the JDK, if you do not find this on your disk read below.

Configure Unity for the Android Platform

Now we must tell Unity the type of platform we want to export to, in this case Android. To do this, go to File > Build Settings and a window like the one shown in figure 9 will be displayed.

build settings window to configure the project to export from unity to android

Fig. 9: In the Build Settings tab we select the Android platform and put Switch Platform.

In this window we select the option Android and click on Switch Platform, with this Unity makes a background work and after a moment the project is already adapted to work with Android.

Before creating a compilation we need to set up a few more things.

Go to the project’s Player window, in the Edit > Project Settings > Player tab.

to export from unity to android you have to go to the player settings in unity and fill in some fields

Fig. 10: Let’s go to Edit > Project Settings > Player, to make the necessary settings to export from Unity to Android.

Here we can enter our brand, the name of the game, icons, Google Play keys, among other things.

configure company name and product name for export from unity to android

Fig. 11: Here we can put the name of our Studio and the name of the Game.

At this time we are interested in creating an APK version of the game to test on an Android device, so let’s go directly to the “Other Settings” part and in the field called “Package Name” we have to indicate an identification name that will have in Android.

This is mostly to differentiate our application from all others in existence. The structure of this name should be like this: “com.Company.ProductName”.

For example if GameDevTraum creates a game called “Maze”, the name of the package could be: com.gamedevtraum.maze. It does not need to match a web domain.

In figure 13 we see that I simply used the name: com.mycompany.proyecto1 and this already allowed me to create an Android build.

configure package name for export from unity to android

Fig. 12: A package name is required in order to compile for Android.

configure package name for export from unity to android

Fig. 13: Example of package name.

This package name will appear for example in the Android folder of our device.

package name for an android application made in unity

Fig. 14: The package name is the name of the application installation folder.

With this we can basically export our game from Unity to Android, go back to the Build Settings window and click on Build and Run.

Fig. 15: With this we are ready to compile, in the Build Settings window we click on Build and Run.

Here we must enter a location and a name for the final file. When you hit Save, the compilation process begins and when it finishes, you have an .apk file that you can install on an API-compatible Android device.

Fig. 16: You will be asked to select a location and a name for the file exported from Unity to Android.
Fig. 17: When the compilation process is finished we will have an .apk file to install in Android.

Unknown sources

By default Android devices reject applications that come from unknown sources, i.e. that are not signed and approved.

To test our game we must allow this type of application to be installed. We can do it from the Android configuration, in my case from “Screen Lock and Security”. You can also do it from the installer and indicate that it is allowed only for that particular installation, that way we will keep rejecting applications from unknown sources.

Fig. 18: At this point, to install the game in an Android device we must accept the unknown sources, this can be done directly from the installer.

We installed the application on our Android and can now test it. In my case I used directly the Android Studio emulator, as you can see in figure 19.

test of a game made in unity exported for android in the android studio emulator

Fig. 19: Testing the application from the Android Studio emulator

Development Kits Downloads

Android SDK

On the Android Studio download page you can get the Android SDK.

There are two ways to install it, one is to download and install the complete Android Studio program. The other way is to download only the Android SDK, scrolling on the same page you will find the downloads. Figures 20 and 21.

Fig. 20: A quick way to get the Android SDK is to directly install Android Studio.
Fig. 21: The Android SDK can also be downloaded individually.

Java Development Kit (JDK)

You can download this JDK from the Java Development Kit download page. In figure 22 we see the download page, we must accept the license terms and then choose the appropriate package for our operating system.

Fig. 22: Java Development Kit (JDK) download page

Environment Variables

Some years ago it was necessary to manually add some Environment variables to the operating system in order to create Android applications. I think this is no longer necessary, but anyway if all the above has not worked I leave you some information about these environment variables to guide you and you can find a solution.

In the following video you can see how to check if you already have this environment variable defined and how to define it if not.

Настройки Preferences

Unity предоставляет ряд настроек, позволяющих настроить поведение редактора Unity.

Чтобы получить доступ к окну Настройки, выберите Правка > Настройки (Windows) или Unity > Настройки (macOS) из главного меню Unity. Доступны следующие категории предпочтений:

Навигация в окне настроек

Используйте окно поиска, чтобы отфильтровать список категорий настроек, и выделите ключевые слова на панели сведений справа.

General

Общие настройки позволяют настроить общее поведение для работы в Unity.

Покрытие кода помогает определить, какая часть вашего кода была выполнена. Обычно это связано с автоматическими тестами, но вы можете собирать данные о покрытии в Unity в любое время, когда работает редактор.

Это позволяет снизить производительность редактора и снизить потребление ресурсов ЦП и мощности.

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

В регулируемых режимах редактор перестает простаивать, если вы взаимодействуете с ним (например, панорамируя в представлении «Сцена»).

Примечание. В режиме воспроизведения Unity игнорирует любое регулирование, которое вы применяете с помощью этого параметра. Редактор обновляется максимально быстро, если только вы не включите параметр VSync в виде игры или не установите значение Application.targetFrameRate кроме –1.

Этот режим потребляет много ресурсов ЦП. Если вы используете портативный компьютер, это может привести к быстрой разрядке аккумулятора.

При выборе этого параметра появляется свойство Дросселирование кадров (в миллисекундах).

Используйте Max Sprite A 2D-графические объекты. Если вы привыкли работать в 3D, спрайты — это, по сути, просто стандартные текстуры, но существуют специальные приемы комбинирования текстур спрайтов и управления ими для повышения эффективности и удобства во время разработки. Подробнее
См. в Словарь Размер кэша Atlas (ГБ)
установка максимального размера Атласа спрайтов текстуры, состоящей из нескольких меньших текстуры. Также называется атласом текстуры, спрайтом изображения, листом спрайта или упакованной текстурой. Подробнее
Смотрите в Словарь . Когда это возможно, Unity сохраняет размер этой папки ниже этого уровня.

2D-область в окне настроек2D-область в окне настроек

Analysis

Настройки Анализ позволяют определить настройки для Profiler Окно, помогающее оптимизировать игру. Он показывает, сколько времени вы тратите на различные области вашей игры. Например, он может сообщать о проценте времени, затраченном на рендеринг, анимацию или игровую логику. Подробнее
См. в Словарь .

Область анализа в окне настроекОбласть анализа в окне настроек

Свойство Функция
Frame count Установите максимальное количество кадров для захвата профилировщиком. Вы можете установить это число от 300 до 2000.
Show stats for ‘current frame’ По умолчанию, когда вы нажимаете кнопку Текущий кадр и входите в режим текущего кадра, в строке индикатора кадра нет примечаний со статистикой для текущего кадра. Это связано с тем, что аннотации статистики могут затруднить просмотр данных в режиме реального времени. Чтобы отображать аннотации, включите этот параметр.
Default recording state Выберите, в каком состоянии записи должен открываться Профилировщик. Выберите из Включено, Отключено или Запомнить. Если выбрано значение Enabled, кнопка Запись остается активной между сеансами, а значение Disbled отключает ее, независимо от того, включили вы ее или нет во время сеанса профилирования. Состояние Запомнить запоминает, активировали ли вы кнопку Запись во время сеанса, и сохраняет ее в последнем состоянии при следующем открытии окна Profiler..
Default editor target mode Выберите, какой режим должен использоваться по умолчанию в раскрывающемся списке Прикрепить к проигрывателю. Выберите либо Режим воспроизведения, либо Редактор.

Кэш-сервер

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

Область Cache Server в окне PreferencesОбласть Cache Server в окне Preferences

Свойство Функция
New Projects default asset pipeline Выберите конвейер ресурсов по умолчанию для новых проектов.
Active version Отображает текущую версию конвейера активов.
Asset pipeline v1 (deprecated)
Cache Server Mode Определите сервер кэширования автономное приложение, которое вы можете запустить на локальном компьютере, хранящее импортированные данные активов, чтобы сократить время, необходимое для импорта активов. Подробнее
Смотрите в режиме Словарь .
Локальный: используйте локальный сервер кэширования на этом компьютере. Появятся настройки Локальное хранилище.
Удаленный: используйте сервер кэширования, размещенный на удаленном компьютере. Появятся настройки Удаленного хостинга.
По умолчанию Cache Server отключен.
Asset pipeline v2
Cache Server Default Mode Определить, включен или выключен сервер кэширования по умолчанию. Вы можете переопределить это для каждого проекта в настройках редактора Unity.
Дополнительную информацию об использовании Asset Pipeline v2 см. в Unity Accelerator.
Default IP address Установите IP-адрес по умолчанию для использования Cache Server. Вы можете переопределить это для каждого проекта в настройках редактора Unity..
Check Connection Нажмите эту кнопку, чтобы попытаться подключиться к удаленному серверу кэширования.

Удаленный хостинг

Эти настройки доступны, только если для параметра Использовать сервер кэширования установлено значение Удаленный.

Настройки удаленного кэш-сервераНастройки удаленного кэш-сервера

Свойство Функция
IP Address Введите IP-адрес выделенного сервера кэширования, настроенного администратором.
Check Connection Нажмите эту кнопку, чтобы попытаться подключиться к удаленному серверу кэширования.

Локальное хранилище

Эти настройки доступны, только если для параметра Использовать сервер кэширования установлено значение Локальный.

Настройки локального кэш-сервераНастройки локального кэш-сервера

Свойство Функция
Maximum Cache Size (GB) Укажите максимальный размер в гигабайтах для Cache Server в хранилище этого компьютера. Минимальный размер 1 Гб. Максимальный размер составляет 200 ГБ.
Размер кэша по умолчанию составляет 10 ГБ.
Custom cache location Включите этот параметр, чтобы указать место, где вы хотите хранить кеш..
Cache Folder Location Нажмите кнопку Обзор, чтобы указать расположение кэша.
Cache size is Сообщение, отображающее текущий размер кеша. Прежде чем нажать кнопку Проверить размер кэша, появится сообщение Размер кэша неизвестен. После нажатия кнопки в сообщении появится рассчитанный размер кэша.
Check Cache Size Щелкните здесь, чтобы узнать, сколько памяти использует локальный сервер кэширования. Эта операция может занять некоторое время, если у вас большой проект.
Clean Cache Удалить содержимое кеша.
Cache Folder Location Отображает текущее расположение папки кэша.

Цвета

Настройки Цвета позволяют выбрать цвета, которые Unity использует при отображении различных элементов пользовательского интерфейса.

Диапазон цветов в окне «Настройки»Диапазон цветов в окне «Настройки»

Внешние инструменты

Используйте настройки Внешние инструменты для настройки внешних приложений для сценариев, работы с изображениями и управления версиями.

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

При наличии таких файлов редакторы кода могут использовать содержащиеся в них данные для предоставления полезных функций, таких как выделение потенциальных ошибок компиляции. Включите этот параметр, чтобы указать Unity создавать файлы .csproj везде, где это возможно в вашем проекте..

Примечание. При изменении этого параметра необходимо перезапустить Unity, чтобы изменения вступили в силу.

Дополнительную информацию см. в разделе Контроль версий Diff/Merge ниже.

Различие/объединение контроля версий

В настоящее время Unity поддерживает следующие инструменты:

  • SourceGear DiffMerge
  • TkDiff
  • P4Merge
  • TortoiseMerge
  • WinMerge
  • PlasticSCM Merge
  • Beyond Compare 4

Примечание. Это сторонние инструменты, которые Unity не включает по умолчанию. Их необходимо загрузить и установить отдельно.

Чтобы настроить пользовательский инструмент редактирования, выполните следующие действия:

  1. В раскрывающемся списке Различие/объединение контроля версий выберите Пользовательский инструмент.
  2. Введите путь к папке установки пользовательского инструмента. На Mac это должно указывать на папку Contents/MacOS в папке установки инструмента.
  3. Введите аргументы для двустороннего сравнения, трехстороннего сравнения и слияния.

Чтобы указать макет файла в инструменте редактирования, используйте следующие аргументы:

Свойство Функция
#LTITLE Левый заголовок
#RTITLE Правый заголовок
#ATITLE Название предка
#LEFT Левый файл
#RIGHT Правый файл
#ANCESTOR Файл-предок
#OUTPUT Выходной файл
#ABSLEFT Абсолютный путь к левому файлу
#ABSRIGHT Абсолютный путь к нужному файлу
#ABSANCESTOR Абсолютный путь к файлу-предку
#ABSOUTPUT Абсолютный путь к выходному файлу

SourceGear DiffОбъединитьSourceGear DiffОбъединить P4MergeP4Merge

Кэш GI

Глобальное освещение Группа методов, которые моделируют как прямое, так и непрямое освещение для получения реалистичных результатов освещения. . В Unity есть две системы глобального освещения, сочетающие прямое и непрямое освещение: запеченное глобальное освещение и глобальное освещение в реальном времени.
См. в Словарь (GI) система использует кэш на каждом компьютере для хранения промежуточных файлов, используемых для предварительного расчета глобального освещения в реальном времени. Все проекты на компьютере имеют общий кэш.

Область GI Cache в окне настроекОбласть GI Cache в окне настроек

Свойство Функция
Maximum Cache Size (GB) Используйте ползунок, чтобы установить максимальный размер папки кэша GI. Unity сохраняет размер папки кэша GI ниже этого числа, когда это возможно. Unity периодически удаляет неиспользуемые файлы, чтобы освободить место (сначала удаляются самые старые файлы). Это автоматический процесс, который не требует от вас каких-либо действий.
Примечание. Если текущая сцена использует все файлы в кэше GI, увеличьте размер кэша. В противном случае при запекании происходит ресурсоемкий пересчет. Это может произойти, когда сцена очень большая или размер кэша слишком мал.
Custom cache location Включите этот параметр, чтобы разрешить пользовательское расположение папки кэша GI. По умолчанию кэш GI хранится в папке Caches. Все проекты имеют общую папку кеша.
Совет. Хранение GI Cache на SSD-накопителе может ускорить запекание в случаях, когда процесс запекания ограничен вводом-выводом.
Cache Folder Location Нажмите кнопку Обзор, чтобы указать расположение кэша..
Cache compression Включите эту опцию, чтобы разрешить Unity сжимать файлы в кэше GI и уменьшать размер генерируемых данных. Файлы по умолчанию сжаты LZ4, а схема именования представляет собой хэш и расширение файла. Хэши вычисляются на основе входных данных системы освещения, поэтому изменение любого из следующих параметров может привести к пересчету освещения:
— Материалы (текстуры, альбедо, эмиссия)
— Освещение
— Геометрия
— Статические флаги
— Группы Light Probe
— Датчики отражения
— Параметры карты освещения
Совет. Если вам нужен доступ к необработанным данным Enlighten, отключите сжатие кеша и очистите кеш.
Clean Cache Используйте эту кнопку, чтобы очистить каталог кеша.
Небезопасно удалять каталог GI Cache вручную во время работы редактора. Это связано с тем, что редактор создает папку GiCache при запуске и поддерживает набор ссылок на эти файлы. Кнопка Очистить кэш гарантирует, что редактор освободит все ссылки на файлы на диске перед их удалением.
Cache size is Отображает текущий размер кэша.
Cache Folder Location Отображает текущее расположение папки кэша.

Вид сцены

Используйте настройки просмотра сцен, чтобы настроить размещение и видимость объектов во время редактирования.

Область просмотра сцены в окне «Настройки»Область просмотра сцены в окне «Настройки»

Свойство Функция
Create Objects at Origin Включите, чтобы создавать новые объекты в исходной точке (в отличие от точки поворота сцены). Отключено по умолчанию.
Line Thickness Установите толщину линии для ваших инструментов преобразования.
Enable filtering while searching Включите, чтобы выделить серым цветом любые несоответствующие элементы в представлении «Сцена». Включено по умолчанию.
Enable filtering while editing LOD groups Включите, чтобы другие объекты в сцене отображались серым цветом при редактировании групп LOD. Включено по умолчанию.

Масштабирование пользовательского интерфейса

UI (пользовательский интерфейс) Позволяет пользователю взаимодействовать с вашим приложением. Подробнее
См. в Словарь Настройки масштабирования позволяют определить, как масштабировать текст и значки пользовательского интерфейса в Редактор Unity.

Область масштабирования пользовательского интерфейса в окне «Настройки»Область масштабирования пользовательского интерфейса в окне «Настройки»

Свойство Функция
Use default desktop setting Включите этот параметр, чтобы использовать настройки вашего компьютера по умолчанию для масштабирования текста и значков пользовательского интерфейса.
Current scaling Отображает текущее значение масштабирования.
Use custom scaling value Переопределите значение масштабирования.

Настройки пользовательского пакета

Некоторые пакеты Asset Store или Unity добавляют собственные настройки в окно Настройки. Обычно они используют имя пакета в качестве категории предпочтений. В этом примере вы можете увидеть настройки Cinemachine:

В списке областей отображаются настройки, относящиеся к конкретному пакету.В списке областей отображаются настройки, относящиеся к конкретному пакету.

Для получения информации о настройках конкретного пакета см. документацию по этому пакету. Этот раздел содержит документацию только для стандартных настроек Unity.

Preferences

Use preferences to customize the behavior of the Unity Editor.

To access the Preferences window, go to Edit > Preferences (Windows) or Unity > Preferences (macOS) from the main menu in Unity.

To navigate the Preferences window, use the search box to filter the list of settings categories and highlight keywords in the details pane on the right of the Preferences window.

The following preference categories are available:

General

General preferences let you customize the overall behavior for working in Unity.

This allows you to throttle Editor performance, and reduce consumption of CPU resources and power.

For example, if you want to test the Editor’s performance, set this property to No Throttling. If you want to conserve power (for example, to prolong battery life on a laptop computer), set this property to one of the throttled modes.

In throttled modes, the Editor stops idling if you interact with it (for example, by panning in the Scene view).

The 2D preference settings allow you to define the settings of 2D-related features and packages. When you install 2D related packages (such as the Tilemap Editor package) into your Project, their preference settings will appear in this section.

Physics

Use the Physics preferences to configure the 2D physics settings, such as the colors used in the UI (User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
See in Glossary .

Property Function
Colliders An invisible shape that is used to handle physical collisions for an object. A collider doesn’t need to be exactly the same shape as the object’s mesh — a rough approximation is often more efficient and indistinguishable in gameplay. More info
See in Glossary
Set the colors for the following UI elements.
Awake Color (Outline) Set the color of the Collider 2D Gizmo A graphic overlay associated with a GameObject in a Scene, and displayed in the Scene View. Built-in scene tools such as the move tool are Gizmos, and you can create custom Gizmos using textures or scripting. Some Gizmos are only drawn when the GameObject is selected, while other Gizmos are drawn by the Editor regardless of which GameObjects are selected. More info
See in Glossary ’s outline when the Rigidbody A component that allows a GameObject to be affected by simulated gravity and other forces. More info
See in Glossary 2D it’s attached to is Awake.
Awake Color (Filled) Set the color of the Collider 2D Gizmo’s interior fill when the Rigidbody 2D it’s attached to is Awake.
Asleep Color (Outline) Set the color of the Collider 2D Gizmo’s outline when the Rigidbody 2D it’s attached to is Asleep.
Asleep Color (Filled) Set the color of the Collider 2D Gizmo’s interior fill when the Rigidbody 2D it’s attached to is Asleep.
Bounds Color Set the color of the bounds for all PhysicsShape2D that a Collider 2D creates.
Contacts Set the colors used for the following UI elements.
Contact Color Set the color of the Collider 2D Gizmo’s contacts which are displayed as a directional arrow starting at the contact point in the direction of the contact normal.
Contact Arrow Scale Set the scale of the Collider 2D contacts arrow. Larger values draw the arrow larger.

Analysis

The Analysis preferences let you define settings for the Profiler A window that helps you to optimize your game. It shows how much time is spent in the various areas of your game. For example, it can report the percentage of time spent rendering, animating, or in your game logic. More info
See in Glossary .

Property Function
Frame count Set the maximum number of frames for the Profiler to capture. You can set this number between 300 and 2,000.
Show stats for ‘current frame’ By default, when you select the Current Frame button and enter Current Frame mode, the frame indicator line doesn’t have annotations with the stats for the current frame. This is because the stats annotations might make it difficult to view data in real-time. To display the annotations, enable this setting.
Default recording state Select which recording state the Profiler should open in. Choose from Enabled, Disabled, or Remember. Enabled keeps the Record button enabled between sessions, while Disbled disables it, regardless of whether you turn it on or off during your profiling session. The Remember state remembers whether you have enabled or disabled the Record button during your session and keeps it at its last state next time you open the Profiler window.
Default editor target mode Select what mode the Attach to Player dropdown should target by default. Choose from either Playmode or Editor.
Custom connection ID Enter the connection name that you want to use for the device that’s running your application in the Attach to Player drop down in the Profiler Window or Console Window A Unity Editor window that shows errors, warnings and other messages generated by Unity, or your own scripts. More info
See in Glossary .

Asset Pipeline

Property Function
Auto Refresh Enable this setting to import Assets automatically as they change.
Import Worker Count % Enter your Desired Import Worker Count for new projects in percentage of available logical CPU cores. For example, if your system has 16 logical cores and this preference is set to 25%, the Desired Import Worker Count for new projects is set to 4. If you set this value too high, your import worker processes need to compete over other processes and system resources such as reading and writing files. The default value of 25% is suitable for most situations.
Directory Monitoring (available only on Windows) Enable this setting to monitor directories instead of scanning all project files to detect asset changes.
Compress Textures on Import Disable this setting to skip texture compression A method of storing data that reduces the amount of storage space it requires. See Texture Compression, Animation Compression, Audio Compression, Build Compression.
See in Glossary during import. Textures are typically imported into uncompressed formats.
Verify Saving Assets Enable this setting to verify which Assets to save individually. A dialog is shown any time Unity saves any assets.
Unity Accelerator (Cache Server)
Default Mode Define the default setting for the Cache Server, whether to enable or disable it by default. You can override this per Project in the Unity Editor settings. For more information, see Unity Accelerator.
Default IP address Set the default IP address for the Cache Server to use. You can override this per Project in the Unity Editor settings.
Check Connection Click this button to attempt to connect to the remote Cache Server.

Colors

The Colors preferences let you pick colors for various user interface elements in the Unity Editor.

Property Function
Animation Use this setting to customize color preferences for animated properties.
Property Animated The color to indicate a property that’s currently being animated.
Property Candidate The color to indicate the animated property that you modified recently.
Property Recorded The color to indicate that an animated property automatically records changes in the animation clip Animation data that can be used for animated characters or simple animations. It is a simple “unit” piece of motion, such as (one specific instance of) “Idle”, “Walk” or “Run”. More info
See in Glossary .
General Use this setting to customize color preferences for General settings.
Playmode Tint The color to tint the editor to for ease of identifying when you’re in Play mode. Unity tints the whole editor with the color you pick here when you enter Play mode. Some operations in the Editor aren’t available when in Play mode, and you can reset some edited values when exiting the Play mode.
Scene Use this setting to customize preferences for a Scene.
Background Set the color for the scene camera A component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary to clear to when the Scene FX skybox A special type of Material used to represent skies. Usually six-sided. More info
See in Glossary setting is turned off.
Background for Prefabs An asset type that allows you to store a GameObject complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. More info
See in Glossary
Set the color for the scene camera to clear to when the Scene FX skybox setting is turned off.
Contribute GI: Off / Receive GI: Light Probes Light probes store information about how light passes through space in your scene. A collection of light probes arranged within a given space can improve lighting on moving objects and static LOD scenery within that space. More info
See in Glossary
Set the color to display when ContributeGI is disabled in the GameObject The fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary ’s Static Editor Flags.
Contribute GI: On / Receive GI: Light Probes Set the color to display when ContributorGI is enabled in the GameObject’s Static Editor Flags, and the Renderer’s ReceiveGI property is set to Lightmaps A pre-rendered texture that contains the effects of light sources on static objects in the scene. Lightmaps are overlaid on top of scene geometry to create the effect of lighting. More info
See in Glossary
.
Contribute GI: On / Receive GI: Lightmaps Set the color to display when ContributeGI is enabled in the GameObject’s Static Editor Flags, and the Renderer’s ReceiveGI property is set to Light Probes.
Grid Set the color of the grid in the Scene view.
Guide Line Set the color of the Guide Line in the Scene view.
Material Validator Pure Metal Set the color for the Validate Albedo/Metal Specular debug render mode to indicate the material properties.
Material Validator Value Too High Set the color for the Validate Albedo/Metal Specular debug render mode to indicate when the material value is too high.
Material Validator Value Too Low Set the color for the Validate Albedo/Metal Specular debug render mode to indicate when the material value is too low.
Selected Axis Set the color for the selected handle to show highlighted in, when Move, Rotate, or the Scale tool is engaged.
Selected Children Outline Set the outline color for the children of the selected objects.
Selected Material Highlight Set the outline color that shows when clicking on a mesh The main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary in the MeshRenderer to ping the submesh in the Scene view.
Selected Outline Set the outline color for the selected GameObjects.
UI Collider Handle Set the color to use for the Unity UI’s padding visualization.
Volume Gizmo Set the color to indicate the audio source A component which plays back an Audio Clip in the scene to an audio listener or through an audio mixer. More info
See in Glossary in Gizmo.
Wireframe Set the color of the wireframe when the wireframe render mode is active.
Wireframe Overlay Set the color of the wireframe when the textured wireframe render mode is active.
Wireframe Selected If you’ve enabled Selection Wire in the Gizmo options, then the selected wireframes appear in the color that you set here.
X Axis The color that you set here is indicated for any built-in transform tool handle affecting x-axis.
Y Axis The color that you set here is indicated for any built-in transform tool handle affecting y-axis.
Z Axis The color that you set here is indicated for any built-in transform tool handle affecting z-axis.

Diagnostics

When you report a problem to Unity, the Unity Support Team might need you to enable diagnostic switches to help identify the cause. Running diagnostics on an application, whether in the Editor or a player, impacts performance and user experience. You should only run diagnostics when the Unity Support Team requires them.

If diagnostic switches are active in your application, Unity shows a warning in the console. To reset switches, in the Diagnostics tab, click Reset all.

If an active diagnostic switch prevents the Unity Editor from opening, use the —reset-diagnostic-switches parameter to reset all switches from the command line. For more information on using command line arguments at launch, see Command line arguments.

External Tools

Use the External Tools preferences to set up external applications for scripting, working with images, and source control.

How to export a game or App from Unity to Android

In this article we see how to export a game from Unity to Android and look at some of the problems we may encounter in the process and how to fix them.

In the following link you can see the basic setup to export a Unity project to Android, creating a 32 and 64 bits version that can be uploaded to Google Play, I also show how I solved an annoying error with the message “IL2CPP.exe did not run properly”.

Download Unity and the Android package

When installing Unity we must make sure we also download the Android package, so if you haven’t done this or don’t remember it, it’s a good opportunity to download the latest version of Unity along with all the necessary packages.

In particular I like to see all available versions, so in Google I usually search with the term “unity version download”, which leads me to the page with all versions (first page in figure 1).

Fig. 1: We look for the page that contains all versions of Unity.

From there we will access a page like the one shown in figure 2, in my case, because my connection is somewhat unstable, I download Unity using torrent.

Fig. 2: In the list we have several options to download Unity.
Fig. 3: In my case I download the latest version by torrent.

Clicking the highlighted option in Figure 3 automatically downloads a torrent file.

Fig. 4: Downloading the torrent file and open it.

We will need to download the Unity editor and the Android Build Support, in figure 5 are selected the necessary packages.

torrent window to download the different unity installers

Fig. 5: In the torrent window we choose the necessary files, in this case we need at least the two selected files.

Configure Android SDK y JDK

To export our Unity games to Android we need to use some external tools, the Android Software Development Kit and the Java Development Kit.

If you don’t have these two kits installed, I’ll show you some screenshots and download links later, for now let’s assume they are installed and move on to the Unity part.

Enter Edit > Preferences and go to the External Tools part, there must be fields to indicate the path of the Android SDK and JDK, as seen at the bottom of figure 6.

preferences window, external unity tools to select the location of android sdk and jdk to export from unity to android

Fig. 6: In the preferences window we go to the External Tools part.

By clicking on Browse, we indicate the path of these two development kits. The default installation path of the Android SDK is shown in figure 7, please note that the AppData folder could be hidden.

The path of the JDK is shown in Figure 8, inside program files, Java.

Fig. 7: This is the location of the Android SDK, if you do not find this on your disc read below.
Fig. 8: This is the location of the JDK, if you do not find this on your disk read below.

Configure Unity for the Android Platform

Now we must tell Unity the type of platform we want to export to, in this case Android. To do this, go to File > Build Settings and a window like the one shown in figure 9 will be displayed.

build settings window to configure the project to export from unity to android

Fig. 9: In the Build Settings tab we select the Android platform and put Switch Platform.

In this window we select the option Android and click on Switch Platform, with this Unity makes a background work and after a moment the project is already adapted to work with Android.

Before creating a compilation we need to set up a few more things.

Go to the project’s Player window, in the Edit > Project Settings > Player tab.

to export from unity to android you have to go to the player settings in unity and fill in some fields

Fig. 10: Let’s go to Edit > Project Settings > Player, to make the necessary settings to export from Unity to Android.

Here we can enter our brand, the name of the game, icons, Google Play keys, among other things.

configure company name and product name for export from unity to android

Fig. 11: Here we can put the name of our Studio and the name of the Game.

At this time we are interested in creating an APK version of the game to test on an Android device, so let’s go directly to the “Other Settings” part and in the field called “Package Name” we have to indicate an identification name that will have in Android.

This is mostly to differentiate our application from all others in existence. The structure of this name should be like this: “com.Company.ProductName”.

For example if GameDevTraum creates a game called “Maze”, the name of the package could be: com.gamedevtraum.maze. It does not need to match a web domain.

In figure 13 we see that I simply used the name: com.mycompany.proyecto1 and this already allowed me to create an Android build.

configure package name for export from unity to android

Fig. 12: A package name is required in order to compile for Android.

configure package name for export from unity to android

Fig. 13: Example of package name.

This package name will appear for example in the Android folder of our device.

package name for an android application made in unity

Fig. 14: The package name is the name of the application installation folder.

With this we can basically export our game from Unity to Android, go back to the Build Settings window and click on Build and Run.

Fig. 15: With this we are ready to compile, in the Build Settings window we click on Build and Run.

Here we must enter a location and a name for the final file. When you hit Save, the compilation process begins and when it finishes, you have an .apk file that you can install on an API-compatible Android device.

Fig. 16: You will be asked to select a location and a name for the file exported from Unity to Android.
Fig. 17: When the compilation process is finished we will have an .apk file to install in Android.

Unknown sources

By default Android devices reject applications that come from unknown sources, i.e. that are not signed and approved.

To test our game we must allow this type of application to be installed. We can do it from the Android configuration, in my case from “Screen Lock and Security”. You can also do it from the installer and indicate that it is allowed only for that particular installation, that way we will keep rejecting applications from unknown sources.

Fig. 18: At this point, to install the game in an Android device we must accept the unknown sources, this can be done directly from the installer.

We installed the application on our Android and can now test it. In my case I used directly the Android Studio emulator, as you can see in figure 19.

test of a game made in unity exported for android in the android studio emulator

Fig. 19: Testing the application from the Android Studio emulator

Development Kits Downloads

Android SDK

On the Android Studio download page you can get the Android SDK.

There are two ways to install it, one is to download and install the complete Android Studio program. The other way is to download only the Android SDK, scrolling on the same page you will find the downloads. Figures 20 and 21.

Fig. 20: A quick way to get the Android SDK is to directly install Android Studio.
Fig. 21: The Android SDK can also be downloaded individually.

Java Development Kit (JDK)

You can download this JDK from the Java Development Kit download page. In figure 22 we see the download page, we must accept the license terms and then choose the appropriate package for our operating system.

Fig. 22: Java Development Kit (JDK) download page

Environment Variables

Some years ago it was necessary to manually add some Environment variables to the operating system in order to create Android applications. I think this is no longer necessary, but anyway if all the above has not worked I leave you some information about these environment variables to guide you and you can find a solution.

In the following video you can see how to check if you already have this environment variable defined and how to define it if not.

Getting Started With Unity Android Game Development!

What you’ll need to get started for Unity Android development

    (Unity 2017 removed support for older android versions) or other data cable compatible with your device (must have data capabilities!)

Steps to setup your Unity Android Build Environment

  1. Download the Android SDK
    The easiest way to install the android SDK is to simply download Android Studio, it’s a useful Java IDE and the installer sets up the android SDK and other environment variables for you! (If you’re an advanced user and just want the command line tools then you can download it separately at the bottom of the page and use the sdkmanager to install packages separately.)
    Make sure to keep note of the android SDK location during the installation as you’ll need it later!
  2. Download the Java Development Kit (JDK)
    Download the latest version of the JDK from the Oracle website here!
  3. Download the Unity Download Assistant
    If you’re a new Unity developer you can started with the free personal edition of Unity here! Otherwise if you’re either not eligible for Unity Personal or own a Unity license you can choose which edition of Unity to download from here!
  4. Install Unity (With android build support)
    During the Unity installation you’ll be asked which features you want included with your Unity installation, make sure Android Build Support is checked!

Unity Installation Android Build Support

Unity Preferences

If you still can’t find the android SDK location just run the android studio installer again to find the path where you installed it to.

Unity Build Settings Android Platform

– Texture Compression (Force the texture compression method)
– Build System (Change the build system)
– Export Project (Export a java project to work with in android studio)
– Development Build (Development builds allow the use of the profiler & frame debugger)
– Autoconnect Profiler (Automatically connect to the profiler when the app is launched)
– Script Debugging (Logcat messages have more detailed information)

Automatically Build and Launch on Android Device

The Build and Run options in Unity will automatically build the APK to a device connected via USB and launch the app when completed.

However first you need to ensure developer mode is enabled on your android device!

How to enable Android Developer Mode

  1. On your android device open Settings
  2. Scroll down and select About Device
  3. Select Software Info
  4. Find Build Number and repeatedly tap it
    After tapping Build Number a few times you’ll see a toast message appear telling you that developer mode has been enabled.

With developer mode enabled, when you try to build and run with your android device connected you will be prompted to accept the USB connection on the android device (there’s a tickbox to remember your computer in future too) select yes and when Unity finishes building your app should automatically launch!

What Next?

Now that you’ve successfully setup your environment and can build Unity android games, you can now continue development. One important aspect of android development is optimizing your game for the wide range of android devices out there!

Reduce filesize & optimize mobile GPU performance!

The size of your app is very important with mobile games so you might want to check out our guide on Unity texture compression, it explains the different types of compressions as well as tips on reducing filesize and optimizing mobile GPU performance to increase the speed of your app!

Improve performance with static and dynamic batching & learn how to use the frame debugger!

Reducing the number of rendered batches is very important for mobile optimization! Check out our Unity mobile batching guide to learn how you can heavily increase the performance of your android games!

Related Posts

Unity GUI.Button & Mouse Events Not Working

October 12, 2018 July 3, 2021

Unity Camera.RenderWithShader Thumbnail

Unity Camera.RenderWithShader Troubleshooting

September 16, 2018 July 3, 2021

Unity Look Rotation Viewing Vector is Zero

How to Fix Look Rotation Viewing Vector is Zero Unity Error

April 15, 2018 July 3, 2021

9 Comments on “Getting Started With Unity Android Game Development!”

Hi! Do you know if they make any plugins to assist with Search Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good gains.
If you know of any please share. Appreciate it!

Well your comment is pretty unrelated to Unity but I can help I guess.

Try writing some unique posts about topics which don’t already have hard keywords to rank for, for example trying to rank for “Age of Empires Cheat Codes” is going to be next to impossible until your site is getting some traffic already due to all the other sites you’ll find on Google.

If your also using wordpress check out the Yoast SEO plugin, it’ll help you write your posts to target keywords whilst also helping you make them easy to read for your visitors.

Once you have some posts you’re happy with try get some sites to link to your site, either sharing blog posts on various subreddits or forums etc discussing the topic of your site already – just make sure not to spam you website everywhere randomly..

Paying for advertising might also be useful too, but you should carefully monitor what the traffic you’re getting from the advertising is doing. If they’re instantly leaving then the page you’re advertising either has issues (too hard to read, complicated design etc) or you’re just focusing the wrong audience with your adverts.

Unrelated to Unity but it’s nice to get a comment on one of my posts :p
Hope this helps!

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

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