P
P
Pavel2018-03-07 16:43:41
User interface
Pavel, 2018-03-07 16:43:41

How to properly design the architecture and UI of a game on Unity?

I want to make the application as simple as possible, but as beautiful as possible: using ECM and SOLID. If you have tips that you can share, or links to articles that you think should be read - please share. I have already searched for information, but I think that I can find something else here.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Basmanov, 2018-03-07
@youkerni

This is all a matter of taste, I have seen a million options and they all fulfilled their task. Just take an empty scene and experiment, make sure that the ui can be launched just like that without anything and pulled from the test class from the outside. Well, with the business logic in the same way, make it work in "console mode" without unnecessary body kit.
From general advice, I can recommend avoiding cyclic connections, when, for example, you send something to ui and in the script you expect that you will be pulled back from there, and if you don’t pull, then everything will break. In order to prevent this from happening, it is very convenient to use the following construction:
This way you can always call OnSomething and not worry about whether this event has any subscribers, it will never be null and no one can call it outside. When you start thinking in this format, it becomes easier to design architecture.
Other than that, you can basically do whatever you want. I would not recommend subscribing to unit interface events through the inspector, because this way the code becomes more difficult to debug, but different organizations have their own habits, sometimes a separate person works on prefabs, and he does not climb into the code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question