Why develop plugins?

0. Preface

The plug-in has been open-sourced, and the open-source address is: https://github.com/cloudhu/SimpleShop
Before the author made a low-level mistake, that is, there was no public warehouse. Later, when a friend told the author that it could not be cloned, he found out that it was private.
That My friend has just come into contact with Unreal Engine, so there are many problems. Even if I get the source code, I can't understand the principle, and it is difficult to expand and maintain. Therefore, even if it is open source, it is still difficult for everyone to use. So the author is still determined to
make This column is filled in, written in a short, flat and fast question-and-answer mode, dedicated to solving small problems that will be encountered in development one by one. Master the skills of plug-in development.

1. Why develop plugins?

This question is actually answering another question: how to develop projects efficiently? It
has already been mentioned in the introduction of plug-ins. Here, the necessity of plug-in development is more systematically clarified, and it is also rewritten in a problem-solving mode.

1.0. Multiplexing

Do not repeat yourself.
To be efficient, programmers cannot write the same code repeatedly. If the same code exists in multiple projects, instead of repeating it over and over again, or copying and pasting the same code, why not refine it What about a plug-and-play plug-in?
For example, many projects in a company need to use databases, so you will see many repeated database operation codes in multiple projects. At this time, you can completely encapsulate a database operation code and open an API interface Call the project. Then whenever you need to use the database, you can import the plug-in, which greatly increases the development efficiency. Not only that, but
if the plug-in is relatively mature and has needs in various development scenarios, it can be put on the shelf Go to the plug-in store of Epic Games, provide it to those who need it, and receive user feedback to further iteratively optimize the plug-in.

1.1. Decoupling.

Of course, the plug-in not only solves the problem of code reuse, but also solves the problem of expansion and maintenance.
Plug-in means the modularization of functions, and there is no coupling between modules. Of course, the default reader already knows what coupling is here. When a function needs to be modified, we can modify the corresponding plug-in separately. It will not affect the whole body, reducing coupling and making the project easier to maintain.

1.2. Plug and play.

The plug-in opens up a convenient method for project development. The plug-in store is like the magical pocket of Doraemon Tinker Bell, where you can always find handy tools. As a qualified plug-in, it must meet the plug-and-play feature, thereby increasing development. The efficiency of users.
For example, a portal plug-in implements the portal function. After importing the plug-in, developers only need to call some simple interfaces to use it. For example, the following API interfaces may be what users need out of the box:

  1. generate a portal;
  2. teleport to specified coordinates;
  3. Destroy the portal.

epilogue

The following chapters are all written in this form, which solves problems in a very short, flat and fast way. If you have any questions about plug-in development, you can leave a message in the comment area, and answer them in the following chapters.

Guess you like

Origin blog.csdn.net/qq_30137245/article/details/130764820