Proposal: inline scripts #12349
Unanswered
shrinktofit
asked this question in
Ideas
Replies: 1 comment
-
Pretty impeccable advice and manageable maintenance costs. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How much works you have to do if you want to have a button which can toggle a boolean variable?
Create a component script in asset manager panel.
Double click that script then add a method, fill the button click callback signature. Then code.
Go back to editor.
Select the button node. Scroll down to to click event array. Click to add an array item.
Select the node where the component you've just writtten attached. Usually the button node itself.
Select the component...Wait, you should have forgot to attach the component.
Now attach the component to the button node.
Select the component.
Select the method served as the button click event callback.
You can see how much works you should do before everything goes fine.
It would be nice if we could provide a capability to "fast prototyping" if the button click event is not so complex.
Idea
Each asset may have some scripts inline. In the case of UI node(in scene asset), UI event can be expressed in the form of inline scripts.
The inline scripts are treated as mini-modules like regular file modules. They have URLs same as its owner asset.
Let's re-examine what should we do in the way of inline scripts:
Select the button node. Scroll down to to click event array. Click to add an array item. Scroll down to to click event array. Click to add an array item.
Code.
That's all things.
Update:
⭐ Imaginary effect:
Beta Was this translation helpful? Give feedback.
All reactions