D
D
Daniel2021-02-12 03:16:30
OOP
Daniel, 2021-02-12 03:16:30

How to properly delimit data from representation in UNITY?

For example, there is a Button on the menu with text. The question is how to localize the text on it.
My solution is to create a component and hang it on a Text with a resource connection (where there will be logic depending on the language what to return) from Resources.GetSttring("BtnName",);

And now such a situation, when creating a project, let's say a menu, works with a ton of text, and in the editor itself, as a rule, we write the text, otherwise you will get confused. That is it turns out at me the text 2 times will be appropriated? First, the value from the editor, and then also overwriting it in the localization.

And is there a way to execute scripts in the editor itself before pressing the run button, that is, I connected the component to the object, and it immediately executed, added text. Maybe through attributes?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question