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

Allow new prefabs to be easily registered #2

Closed
vocksel opened this issue Jun 27, 2018 · 2 comments
Closed

Allow new prefabs to be easily registered #2

vocksel opened this issue Jun 27, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@vocksel
Copy link
Owner

vocksel commented Jun 27, 2018

Currently when you create a new model you have to manually tag it and add it to the folder where all your prefabs are.

This should be streamlined to allow the user to press a key or use a plugin button to quickly register the prefab. Registering would be a simple TextBox prompt to give it a name for the tag, and off it goes.

@vocksel vocksel added the enhancement New feature or request label Jun 27, 2018
@vocksel
Copy link
Owner Author

vocksel commented Jul 2, 2018

With #9 being integrated, this comes with a change to how the folders are laid out. Everything is retroactively created in ServerStorage, and prefabs are required to be put in a subfolder. This makes adding prefabs a bit trickier, so having a way to automatically add them there and get them tagged is really important.

@vocksel
Copy link
Owner Author

vocksel commented Jul 19, 2018

We now have public API under _G for doing this. _G.prefabs.register(model, name) and _G.prefabs.registerSelection(name). The latter is the same thing as the former, but implicitly passes in the first selection as the model.

This allows us to easily register a prefab, which will be tagged and cloned to ServerStorage. The original model gets to stick around as well, so you don't have to clone anything back into the workspace to use your newly setup prefab.

@vocksel vocksel closed this as completed Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant