-
Notifications
You must be signed in to change notification settings - Fork 0
Edit Item
This SDK can export two types of items: Scene or Model. You can switch between these types using the Type
field in the Item Manager
window. Each type of item can contain Asset Files
, which will be detailed later. While an application can load only one scene item at a time, it can load multiple model items simultaneously.
Item Type | Content |
---|---|
Scene | Scene, Assets |
Model | Assets |
Scene items consist of a main scene and associated Asset Files
. They allow you to create unique environments for users. For example, consider the Ocean item. The main scene represents a vast ocean, while the Asset Files
include objects (such as boats and treasure chests) that replace desktop icons, decorative items (like ducks), and dynamic background elements (such as seagulls and schools of fish based on flocking algorithms):
Notes:
- In this type of item, the
Asset Files
are typically closely related to the main scene (e.g., objects floating in the ocean) or use custom code components. If theAsset Files
are generic materials, it's recommended to package them separately in a model item so that more scenes can utilize them.
Model items contain only Asset Files
. They usually consist of a collection of resources from the same series (such as building modules, environmental effects, or vehicles). These resources can be used by users in different scenes. For instance, the Low Poly Building Modules item is based on the free Unity Asset Store package Low Poly Buildings - Full Pack, it provides building structures, roads, and vehicles needed for constructing a city:
If an item's type is a scene, you need to add a main scene to package it correctly. Click the Create Scene
button in the Item Manager
window to open the scene template selection window titled Select Template...
. Here, you'll find commonly used item template scenes. Select an appropriate template on the left and click the Create
button. A new Entry.unity
scene file and related assets will be cloned and stored in the [Item Root Directory]/Scenes
folder.
Once the main scene is created, you can reopen it by clicking the Edit Scene
button in the Item Manager
window. In the Hierarchy window, you'll see the following two scenes:
This scene serves as the main scene for the item and includes environmental setup and various logic code.
This scene may contain the following game objects. Objects marked with [Required]
must be included in the scene (or components must be attached to the game objects), while those marked with [Optional]
are provided by default and can be customized if needed:
AliveDesktop [Required]
: The main controller for this scene. It includes the following components:
- AD_AliveDesktop
[Required]
: Marks this object as the AliveDesktop singleton.
ShellController [Required]
: The controller for Shell Items. It has the following components:
- AD_DefaultShellController (or a subclass of IAD_ShellController)
[Required]
: Customizes the rules for generatingShell Items
(e.g., generation area, interval).
DecorationController [Required]
: The controller for Decoration Items. It has the following components:
- AD_DefaultDecorationController (or a subclass of IAD_DecorationController)
[Required]
: Customizes the rules for generatingDecoration Items
(e.g., generation area, interval).
EnvironmentController [Optional]
: Manages environment settings. It has the following components:
- AD_DefaultEnvironmentController (or a subclass of IAD_EnvironmentController)
[Required]
: Customizes environment settings (such as lighting, skyboxes, or reflections).
PostProcessingController [Optional]
: Manages post-processing effects (PostProcessing). It has the following components:
- AD_DefaultPostProcessingController (or a subclass of IAD_PostProcessingController)
[Required]
: Customizes post-processing settings.
XRController [Optional]
: Manages XR settings. It has the following components:
- AD_DefaultXRController (or a subclass of IAD_XRController)
[Required]
: Customizes initial teleport points, XR movement modes, and caching of the last position when leaving.
PD Group [Optional]
: If you want to provide configurable/stored data to users (such as the aforementioned PostProcessing configuration file), you need to add child objects with specified PersistentData components under this object. Each component should have a unique key:
This scene simulates the runtime environment, allowing you to test certain features without packaging an item:
Notes:
- If you can't find this scene, you can open it by clicking the
Alive Desktop/Add Simulator Scene
button in the top menu. - The scene resources are stored by default in a read-only Package folder. You need to first import or update the relevant
Simulator
resources in thePackageManager
window to open it successfully. - The simulator supports PC/VR mode, which can be toggled using the
Alive Desktop/Set Platform Mode
option in the top menu. - In PC mode, the XR Device Simulator module from XRI provides keyboard and mouse simulation for VR input. You can expand the
XR Device Simulator
UI in the lower-left corner to view operation hints:
Next, let's explore the important game objects in this scene. Feel free to skip this section if you find it boring:
-
SystemAudioManager: Samples system audio, mainly for audio visualization. This object has an
AudioSource
component that allows you to set different audio sources for debugging. To play/pause audio during runtime, click the ToggleUI on the right side of this object in the Hierarchy window.
-
CommonSettingManager: Manages common settings for the program. When the program is running, if you modify relevant fields in the
AD_CommonSettingManagerSimulator
component, the program will send corresponding events. - ModManager Group (Handling Program Data and Events)
- EnvironmentManager: Manages environment settings.
- PostProcessingManager: Manages PostProcessing settings.
- SceneManager: Manages scene transitions.
- XRManager: Manages XR settings and status.
- InputManager: Manages various input sources.
- ShellManager: Manages Shell controllers.
- DecorationManager: Manages Decoration controllers.
This group of objects primarily provides debugging functionality, and related configuration information is stored in the Assets/Resources/Threeyes/SteamworksEditorSetting.asset
file:
Asset files consist of various files, such as Prefabs, models, textures, audio, etc.
The following two types of Prefab objects are quite special, as they are mainly used for user editing:
-
Shell Items: These objects replace desktop icons (such as files, folders, shortcuts) and can display corresponding icon information using text, textures, etc. For example, in the image below, the sailboat model replaces the
This PC
icon on the desktop. The boat name corresponds to the icon's name, and the sail pattern corresponds to the icon's preview image. Users can enter edit mode to modify its content:
- Decoration Items: These objects are not bound to desktop icons. Users can add, delete, or edit them at runtime to enrich the scene content. In the scene below, chairs, televisions, clocks, etc., are all decoration items placed by users during runtime:
Follow the following process to create Shell/Decoration Objects
.
Firstly, objects need to be modeled and placed according to rules:
- The root object's scale should be 1, matching the real-world size (where 1 Unity unit corresponds to 1 meter in the real world).
- The root object's pivot point should be at the bottom of the object, with its local X/Y/Z axes corresponding to the object's right/up/front directions (based on the Unity coordinate system):
After the object is made, it needs to be turned into Prefab, and then select the Prefab in the Project
window and click an appropriate option in the top menu Alive Desktop/[Shell/Decoration]/Init/...
. The SDK will add the necessary components:
The following components are mandatory to include; otherwise, issues related to serialization may occur:
-
AD_DefaultShellItem/AD_DefaultDecorationItem
: Marks this object as aShell/Decoration item
. -
RuntimeSerializable_GameObject
: Manages overall serialization data for the object. -
RuntimeSerializable_Transform
: Manages serialization data for the Transform component.
Based on interactivity, they can also be categorized as:
- Static Objects: These provide basic decorative functionality and are not interactive. Examples include wall modules, trees, etc.
- Interactable Objects: These can receive player input (such as grabbing, switching, driving) or interact with environmental objects (such as being sucked by a socket). In the GIF below, the toy car is an interactable object. Users can drive it or attach it to a specified position:
The AD_SOXXXPrefabInfo
type of ScriptableObject file is used to store metadata for Shell/Decoration Items
, including the Prefab reference, title, and preview image:
To create an AD_SOXXXPrefabInfo
file, select the corresponding Shell/Decoration object
Prefab in the Project
window. Then, click an appropriate option in the top menu Alive Desktop/[Shell/Decoration]/PrefabInfo/Create
. The SDK will automatically generate a file based on the names, preview images, and other data from all selected Prefabs in the [Parent Folder]/PrefabInfo
directory:
The AD_SOXXXPrefabInfoGroup
type of ScriptableObject file can store multiple AD_SOXXXPrefabInfo
instances. It allows you to group similar Shell/Decoration Items
together as a collection. For example, in the image below, it represents an audio visualization object collection:
To create an AD_SOXXXPrefabInfoGroup
file, right-click in the Project
window's blank area and choose Create/Alive Desktop/PrefabInfo
. Select either the ShellItemGroup
or DecorationItemGroup
option. The SDK will generate the corresponding file. In the Inspector
window, you can set the Title and the AD_SOXXXPrefabInfo
ListData for the created group. You can also right-click on the component in the Inspector
window and choose InitUsingCurFolder
. The SDK will automatically search for all AD_SOXXXPrefabInfo
files in the folder where this file is located and add them to the ListData field.
Here's several methods to create or update an AD_SOXXXPrefabInfoGroup
file:
- Select the corresponding
AD_SOXXXPrefabInfo
files in theProject
window, and click on the top menuAlive Desktop/[Shell/Decoration]/PrefabInfo/Group Selected
. The SDK will then generate the corresponding file. After selecting the generated file, you can set its title and the list ofAD_SOXXXPrefabInfo
items (ListData) in theInspector
window. - Right-click in an empty area within the
Project
window, chooseCreate/Alive Desktop/PrefabInfo/[ShellItemGroup/DecorationItemGroup]
. The SDK will generate the corresponding file. - If you have already created an
AD_SOXXXPrefabInfoGroup
file, select it in theProject
window, and right-click on the component in theInspector
window, then choose theInitUsingCurFolder
option. The SDK will automatically search for allAD_SOXXXPrefabInfo
instances within the folder where the file is located and update theListData
field accordingly.
The relationship between these file types is as follows:
flowchart LR;
AD_SOXXXPrefabInfoGroup-->AD_SOXXXPrefabInfo1-->Prefab1;
AD_SOXXXPrefabInfoGroup-->AD_SOXXXPrefabInfo2-->Prefab2;
Notes:
- At runtime, the program scans all
AD_SOXXXPrefabInfoGroup
resources in the Item package to list the correspondingShell/Decoration Items
. - Each Item package can contain multiple
AD_SOXXXPrefabInfoGroup
files.