Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Build Your Own Metaverse with Unity

You're reading from   Build Your Own Metaverse with Unity A practical guide to developing your own cross-platform Metaverse with Unity3D and Firebase

Arrow left icon
Product type Paperback
Published in Sep 2023
Publisher Packt
ISBN-13 9781837631735
Length 586 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
David Cantón Nadales David Cantón Nadales
Author Profile Icon David Cantón Nadales
David Cantón Nadales
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Part 1: Getting Started
2. Chapter 1: Getting Started with Unity and Firebase FREE CHAPTER 3. Chapter 2: Preparing Our Player 4. Chapter 3: Preparing Our Home Sweet Home: Part 1 5. Chapter 4: Preparing Our Home Sweet Home: Part 2 6. Chapter 5: Preparing a New World for Travel 7. Part 2: And Now, Make It Metaverse!
8. Chapter 6: Adding a Registration and Login Form for Our Users 9. Chapter 7: Building an NPC That Allows Us to Travel 10. Chapter 8: Acquiring a House 11. Chapter 9: Turning Our World into a Multiplayer Room 12. Chapter 10: Adding Text and a Voice Chat to the Room 13. Part 3: Adding Fun Features Before Compiling
14. Chapter 11: Creating an NPC That Allows Us to Change Our Appearance 15. Chapter 12: Streaming Video Like a Cinema 16. Chapter 13: Adding Compatibility for the Meta Quest 2 17. Chapter 14: Distributing 18. Index 19. Other Books You May Enjoy

Organizing your project assets

When we talk about organizing assets and resources in our project, we are referring to how we want the folder structure in the Project panel to look. There is not a single established way to do this – it depends on how we like and feel more comfortable working. Unity recommends a series of points you should take into account when doing this, as well as to avoid file problems.

The following are recommendations for organizing our project:

  • Establish a folder and file naming guide before starting.
  • Don’t lose track of the folder naming throughout the project. On many occasions, we will add files and resources and forget to rename them.
  • Do not use blank spaces in folders or individual files.
  • Separate the files to be used in testing from the production files by creating another folder dedicated to them.
  • Always use the Assets root folder; everything you create should hang from this folder. Avoid creating other folders at the same level as the Assets folder.
  • Keep your private files separate from downloaded assets or Unity’s resources.

As we have said before, there is no standard way to organize projects in Unity. I use a technique that helps me have good order and be more efficient when working. Figure 1.19 is the default structure that can be seen when creating a project:

Figure 1.19 – Detailed view of the Project panel

Figure 1.19 – Detailed view of the Project panel

As shown in the preceding figure, under the root Assets folder, we have MainScene, Scenes, Settings, and TutorialInfo. At first sight, this seems like a good form of organization, but in reality, it is not quite like that. Let me explain why.

As the project grows, you will be downloading assets and installing them in the project. This will cause an infinite number of new folders that hang from the Assets folder to be created. These folders are sorted alphabetically, and this can become chaotic if you try to locate your own folders, mixed in among the folders of third parties.

A widespread technique among Unity programmers is to identify your folders with the underscore symbol (_) so that they always appear at the top, as shown in Figure 1.20:

Figure 1.20 – Custom organization

Figure 1.20 – Custom organization

This way, you will no longer care that third-party plugins can create an infinite number of folders in your Assets root folder since you will always have yours at the top of your _App folder.

Within the _App folder, you can create the folder relationship that suits you best. From my experience, most assets can be perfectly organized into materials, scenes, scripts, sounds, or textures.

To finish organizing the project as a whole, we will move the scene we have created to its new location and delete what Unity has created:

  1. Move the MainScene scene file, along with its configuration folder, inside _App | Scenes:
Figure 1.21 – Reorganizing our assets

Figure 1.21 – Reorganizing our assets

  1. Delete the TutorialInfo folder from the root Assets folder.
  2. Delete the old Scenes folder located in the root Assets folder. Inside this is the SampleScene example scene, but don’t worry, we don’t need that either.

Once we have reorganized our assets and removed the sample material, our Project panel will look something like Figure 1.22:

Figure 1.22 – Screenshot of what the new organization should look like

Figure 1.22 – Screenshot of what the new organization should look like

Note

If you want to dive deeper into this matter, I recommend https://unity.com/how-to/organizing-your-project and https://docs.unity3d.com/Manual/SpecialFolders.html.

Good job! With that, you have learned everything you need to have your work well organized. Over time and when you have worked on multiple projects, you will notice the difference if you have your files well organized. As projects grow, if we don’t apply some technique to keep everything organized, we will lose a lot of time looking for the assets we need. Next, we will cover a very easy and interesting point regarding how to configure our project so that later, in Chapter 2, Preparing Our Player, we can move our character with the keyboard and mouse.

You have been reading a chapter from
Build Your Own Metaverse with Unity
Published in: Sep 2023
Publisher: Packt
ISBN-13: 9781837631735
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image