[Unity] [C#] [VS] How to modify the general C# form program written in VS into a Unity program

【background】

A C# written in Visual2019 needs to be rewritten in Unity.
One of the great advantages of writing form programs in Unity is that they are beautiful. Look at this default interface.
Insert image description here
But the disadvantage is that there is a Unity cutscene at startup.

【question】

Although Unity also uses C#, it is different from Visual2019's universal form C# in terms of interface display libraries, image processing, and basic functions that make up a script. There are many details that need to be paid attention to in order to successfully transcribe.

[UI points to note]

  1. Unity's UI needs to be added in the editor and then associated with the Public variables written in the script to work;
  2. It should be noted that the data type of the Public variable declared in the script must be consistent with the actual UI object type in UnityUI;
  3. Since Unity has a default set of UI components and another set of plug-in TMP UI components, the consistency of the objects needs to be paid attention to. If TMP is used, the TMP package must be introduced in Unity, and TMP needs to be written when declaring Public variables. type:
using TMPro;
public But

Guess you like

Origin blog.csdn.net/weixin_41697242/article/details/133129713