Scene Management - Capi-Metaverse/Template GitHub Wiki
There are two ways to make a scene in our metaverse. You can use our scene prefab with all the tools and components you need or you can create your own scene right from the start.
It’s recommended to start with our prefab and just remove all the components that your project doesn’t need because is easier that way.
A scene must have this elements:
-
A Environment: This is the visual part of your metaverse like an Office or a Hall. This is part can be fully customized with your own elements like chairs, computers…
-
A Network Runner Handler: This is the element that connects the user to the Photon Network and start all the process for the rendering of the players.
-
Event System: It’s needed to get the visual and key input for the player.
-
Pause Menu: It’s required to leave the application and to enter the user settings if they are active.
A scene can have this elements:
-
A Settings Menu: This element let the user modify certain options like their volume, sensitivity… It offers other optional elements like their friends, the posibility to change the keys and the list of the players of the room.
-
A Presentation System: This element let the user upload their powerpoints to the room. The slides can be advanced by all the users of the room.
-
A Recorder: This element allows to record the presentation and the sounds around it. (WIP)
-
A Painting Board: This element allows user to draw in a board of the room. The users can change the line width and their color.
-
A Room Changer: Element that let users to create or move to other rooms of the same Photon Lobby.
-
A Minimap: This element renders all the scene from an aerial view. Users that are friends of the player are highlited. (WIP)
-
A User Profile: This has two elements, a element to change your user profile and one that lets you render other user profiles. The user can see other profiles just interacting with other player.
-
A AI Assistant: This element is an assistant that can help the players to move around the metaverse and ask their questions. (WIP)
The Network Runner Handler is the principal element of the application. It has two properties in the inspector: The Network Runner Prefab and The name of the map/scene.
The script posess two important functions, Start and InitializeNetworkRunner:
-
Start: The handler instantiate the Network Runner from the Network Runner Prefab and calls the InitializeNetworkRunner.
-
InitializeNetworkRunner: This function defines the room settings like the RoomName, The Scene Map or the Player Limit. When it has ended, calls the method StartGame of the Runner to enter the online room.
The Pause Menu is a prefab with two GameObjects, the UI Panel and the RoomName and a Script called Pause Menu Settings.
The Panel has two buttons to return to the Lobby or Disconnect. It has two more buttons, one to close the pause menu and other to enter the Settings Menu if it’s active.

The RoomName contains the actual name of the room like "TestRoom" or "Test".
Finally, the Pause Menu Settings Script has all the UI methods assigned to the buttons like the Disconnect, Return to the Lobby…
The presentation system consist in three GameObjects:
-
Loading Canvas: This canvas is set when the Presentation is loading.
-
Presentation Objects: This GameObject contains the Presentation Prefab and the Interactive buttons.
-
Presentation Zone: This GameObject contains the Presentation Zone and the Presentation Camera.
The Presentation Prefab consist in a Canvas that will be rendering the sprites when the user uploads their presentation. When the presentation is upload, the users can advance or back the slides. Users can upload a new presentation when they want.
The Presentation Zone is a collider with a square form. When the users collide with the Presentation Zone, they can change their camera to the Presentation Camera with their respective key.
The Recorder has four GameObjects, three to buttons and one for the Recorder Camera.
-
Record Button: When the user interact with this button, it activates the camera and start recording.
-
Pause Button: When the user interact with this button, it pauses the recording.
-
Folder Button: When the user interact with this button, it allows user to change the record save route.
This prefab uses the RockVR plugin to let users record for now.
Consist in a prefab with three UI panels and two scripts:
-
Choose Panel: This panel let the user choose if they want to join a room or create one.
-
Join Panel: This panel has an input where the user can write the name.
-
Create Panel: This panel let the user create a room, it must specify the name, the number of users and the chosen map.
Finally, the prefab has two scripts, Create Room Panel, that contains all the logic of the prefab meanwhile Create Room Panel UI controls all the UI Logic.
The Minimap consist in two Prefabs, one that controls the Camera and other that controls the Canvas. This two prefabs must be together to work
(TO DO) Combine in both prefabs (TO DO) Explains how they work
The user profiles consist in two prefabs, one for the player user and the other to render the other users profile.
The UserProfile for the player consist in two main panels that let the user see or edit their data respectively:
-
Username: Contains the name of the user, it changes with the Playfab Data.
-
TeamsText: This text contains the email of the user.
-
AboutText: Contains a brief description about the user.
-
HobbiesText: Contains info about the user hobbies.
-
CVText: Contains info about the career of the user.
-
Image: Avatar of the current user.

All this fields are fully customizable in the edit panel of the same prefab. This prefab has two scripts one for the view panel and other for the edit panel. Both of them work with the logic and the UI of the panel.
This element consist in two prefabs one for the model (In our case is Adam) and other for the ChatUI.
When is placed on the scene, the user can interact with the model to open the ChatUI. The user can ask any question but will only answer the way it’s specified in the instructions of their script. Each prefab has their script. The model script just check if the user interacted with the model and open the ChatUI. The ChatUI script just send the question to ChatGPT and writes the answer in the panel.
