Skip to content

GuardianOfGods/unity-mobile-developer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 

Repository files navigation

unity-mobile-developer

test

👋 Hi there, I'm HoangVanThu. I am currently a mobile Unity developer at a Vietnamese company. I have many years of experience in the field and I want to share what I know with everyone.

This repository is mostly for reference, it contains the tips and tricks I have applied throughout my programming career. I hope you find it useful.

Table of optimization contents:

Unity Hub

Trouble With Liscenses

  • Occasionally, adding a license in Unity Hub gets interrupted even though you have clicked to add it. My advice in this situation is to be patient and wait for a while, or you can repeatedly perform the add license action until it succeeds.

Choose Unity Version

  • First, always choose Unity versions with LTS (Long Term Support) to minimize errors and receive bug fixes from Unity in subsequent LTS versions.

Warning

I frequently have build errors in Xcode (iOS environment) due to thread conflicts and library conflicts between third-party services such as Firebase, Admob, AppLovin, etc. In some cases, I have had to upgrade or downgrade Unity versions for the issue to be resolved (Unity also provides release notes to fix these errors).

IDE

Choose IDE

  • There are many different IDEs that support programming in Unity. Additionally, there are many AI tools that can be integrated into IDEs, such as Tabnine, Copilot, IntelliSense, etc. AI can significantly boost your programming efficiency.
  • Here are the three most popular and powerful IDEs that I recommend you use:

1. JetBrains Rider

  • High Performance: Rider is known for its high performance and fast processing speed.
  • Powerful Refactoring: Provides strong refactoring tools to improve code quality.
  • Code Analysis: Code analysis features help detect errors and improve code.
  • Good Unity Integration: Rider offers good integration with Unity, including debugging and code navigation.

2. Visual Studio Code (VS Code)

  • Lightweight and Flexible: VS Code is a lightweight IDE that can be easily customized and extended with extensions.
  • Unity Extensions: Extensions like Unity Tools and Unity Debugger enhance Unity development capabilities.
  • Supports Multiple Languages: Supports various programming languages and frameworks, not just C#.

3. Microsoft Visual Studio

  • Good Integration with Unity: Visual Studio provides deep integration with Unity, including debugging, code navigation, and project management.
  • IntelliSense: Intelligent code completion helps speed up coding and reduce syntax errors.
  • Powerful Debugging Tools: Visual Studio offers robust debugging tools that make it easy to test and fix errors.
  • Extensions and Plugins: There are numerous extensions and plugins available to enhance the development experience.

Attach IDE

  • To attach IDE to Unity, in Unity open Edit -> Preference -> External Tools. Choose IDE you want to use in External Script Editor

Unity Editor

Unity Layout

  • Here my favorite layout with 2 screens.

image

  • It is not simply my preference, the logic for this layout is the convenience it provides for my workflow. I will analyze the layout to give you a clearer perspective:

1. Placing tabs within the same tab group can be time-consuming as you have to switch between tabs to display them on the screen. So I split impotant tabs to many groups.

image

2. Viewing the information in my Hierarchy is quite easy since the two tabs are placed close to each other.

image

3. When I need to use a prefab in the game, I can simply drag the prefab from the Project into the Hierarchy or Scene. Also, it's good for game design.

image

4. While playing the game through the Game tab, I can view the information on the left side of the screen.

image

Assets

Organize Folders

  • I usually place project-related assets in a subfolder within the Assets directory to easily find resources and separate them from third-party assets.
  • To display a folder at the top, I add an "_" to the folder name, and to display it at the bottom, I add a "~".
  • This image below show how I order folder assets:

image

Replace Assets

  • Suppose you want to replace an old image in your project, but since the old image is used in many different UIs, when you add the new image, you will have to attach the new image in many places to replace the old one. My solution here is to replace the old image with the new image of the same name and keep the original meta file so that the links and format of the replacement image remain unchanged.
  • It may sound a bit lengthy and confusing, but in reality, you just need to open the folder containing the two image files and replace them with each other, as shown in this example:

image

image

Debug

Debug With Monitor

  • The method I use for debugging on an actual mobile device is to use the monitor. Here is step to debug on mobile device:

1. Navigate to the SDK directory linked in the Edit -> Preferences -> External Tools -> Copy SDK Path.

image

2. Then open directory that you copy, open tools folder.

image

3. Open monitor.

Warning

Sometime it can't be open because of missing java 8. You can download in Java website or Oracle

image

4. Connect your mobile to pc.

Warning

Make sure that your mobile is enable Developer and USB Debugging. You can search that on internet.

image

5. Add Unity filter.

image

=> The Result:

image

Debug With Android Studio

Others

  • You can see more tips in Brackeys' video below, which is also quite helpful.

IMAGE ALT TEXT

Others

Support

  • If you like this topic, you can give this repository a star ⭐
  • I would greatly appreciate it if you could support me with a cup of coffee