Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Prefab System #10047

Draft
wants to merge 10 commits into
base: dev
Choose a base branch
from
Draft

Introduce Prefab System #10047

wants to merge 10 commits into from

Conversation

JT00y
Copy link
Contributor

@JT00y JT00y commented Apr 8, 2024

Summary

issue 10034, make the Add Entity button show a popup modal list prefabs

Subtasks Checklist

Breaking Changes

References

closes #10033
closes #10034

QA Steps

Copy link
Member

@HexaField HexaField left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good first step, but it is not functional as a prefab abstraction over our components. We need to remove the Add Component & remove component functionality while in simple mode, as well as new properties editors for the prefabs that are abstractions on top of components. We also need to populate the prefab list with all the other prefabs we want (video, volumetric, geometry, ground plane etc)

name: 'ee.editor.PrefabShelfCategories',
initial: () => {
return {
'Light Prefab': [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beyond this state, we need to also have the infrastructure to swap the component used inside the light editor, this alone doesn't make sense. We only want one of these components on an entity, and we want to have a dropdown in the properties editor for this. Same goes for the others.

if (getMutableState(EditorHelperState).studioMode.value == 'Advanced') {
EditorControlFunctions.createObjectFromSceneElement()
}
}}
>
{t('editor:hierarchy.lbl-addEntity')}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should change the language here for Add Entity in simple mode to Add Object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lines mean if user select Advanced mode the studio will be same.
When select simple mode the fuctions of add object are in PrefabList.tsx which was called in HierarchyPanelContainer.tsx line 523.

@HexaField HexaField marked this pull request as draft April 17, 2024 23:24
{t('editor:properties.lbl-addComponent')}
</PropertiesPanelButton>
</div>
<Popover
id={open ? 'add-component-popover' : undefined}
open={open}
open={open && studioMode.value == 'Advanced'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use === instead of ==

@@ -490,7 +491,7 @@ function HierarchyPanelContents({ rootEntityUUID }: { rootEntityUUID: EntityUUID
}}
onClick={(event) => {
anchorElement.set(event.currentTarget)
if (getMutableState(EditorHelperState).studioMode.value == 'Advanced') {
if (studioMode.value == 'Advanced') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use === instead of ==

@@ -507,7 +508,7 @@ function HierarchyPanelContents({ rootEntityUUID }: { rootEntityUUID: EntityUUID
>
<Popover
id={open ? 'add-component-popover' : undefined}
open={open && getMutableState(EditorHelperState).studioMode.value == 'Simple'}
open={open && studioMode.value == 'Simple'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use === instead of ==

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce Prefab System Simple/Advanced mode toggle state
2 participants