Unity-based graph drawing method and system, storage medium and equipment

By using the XCharst development toolkit and UI components in Unity, combined with the setting of code components, real-time rendering of graphics drawing is achieved, which solves the problems of high development threshold and low efficiency in the existing technology, and improves development efficiency and interactivity. .

CN119336317AActive Publication Date: 2025-01-21江西格如灵科技有限公司
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411168017.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2025-01-21
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

In the prior art, drawing graphics in Unity requires developers to build images or understand computer graphics, resulting in high development thresholds and low efficiency.

Method used

Provide a graphics drawing method based on Unity. By obtaining the XCharst development toolkit, create a Unity project, create a new drawing scene, create a UI component based on the image source, add a code component, and load the code component to set the color value, coordinate value and In graphics form, real-time rendering generates target graphics.

Benefits of technology

It reduces the amount of code developers need to write, lowers the technical threshold, and improves development efficiency. The generation of target graphics is rendered in real time, improving interactivity and accuracy of graphics drawing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336317A_ABST
    Figure CN119336317A_ABST
Patent Text Reader

Abstract

The invention discloses a Unity-based graph drawing method and system, a storage medium and equipment, and relates to the technical field of graph drawing, the method comprises the steps that an XCharst development kit is acquired, and the XCharst development kit comprises an XCharst main program; on the basis of the XCharst main program, a Unity project is created through a Unity engine; a drawing scene is newly created in the Unity project; identifying the drawing scene, and creating a UI component based on an image source in the application scene; adding a code component in an attribute panel of the Unity project; loading the code component, and setting a color value, a coordinate value and a graphic form of the Unity item in a source code based on the code component; and generating a target graph in real time based on rendering of the UI component according to the color value, the coordinate value and the graph form. The problems that in the prior art, when graph drawing is carried out, images need to be constructed or computer graphics need to be known, the development threshold is high, and efficiency is low are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of graphics drawing technology, and in particular to a graphics drawing method, system, storage medium and device based on Unity. Background Art

[0002] In the prior art, to draw graphics in Unity, developers need to build images themselves and then call the bottom layer of UGUI to draw. The process is complicated and the development threshold is high.

[0003] However, developers face some challenges when using XCharts for graph drawing. First, developers need to be familiar with XCharts' API and complex interface editing, and write complex code to process and use it. Second, when drawing graphics that are not pre-made in XCharts, it is necessary to understand computer graphics, which makes the development threshold high.

[0004] Therefore, in the prior art, when drawing graphics, it is necessary to construct an image or understand computer graphics, which brings about the problem of high development threshold and low efficiency. Summary of the invention

[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a three-dimensional model surface skin rendering method, system, storage medium and device, aiming to solve the problems of high development threshold and low efficiency caused by the need to construct images or understand computer graphics when drawing graphics in the prior art.

[0006] A first aspect of the present invention is to provide a graphics drawing method based on Unity, the method comprising: Obtain an XCharst development toolkit, wherein the XCharst development toolkit includes an XCharst main program; Based on the XCharst main program, create a Unity project through the Unity engine; Create a new drawing scene in the Unity project; Identify the drawing scene, and create a UI component based on the image source in the application scene; Add a code component in the properties panel of the Unity project; Loading the code component, and setting the color value, coordinate value and graphic form of the Unity project in the source code based on the code component; According to the color value, coordinate value and graphic form, a target graphic is generated in real time based on the rendering of the UI component.

[0007] According to one aspect of the above technical solution, the step of identifying the drawing scene and creating a UI component based on the image source in the application scene specifically includes: Loading the drawing scene in the Unity project, and identifying a scene identifier of the drawing scene; Based on the scene identifier, a UI component based on the image source is created in the application scene.

[0008] According to one aspect of the above technical solution, the steps of loading the code component and setting the color value, coordinate value and graphic form of the Unity project in the source code based on the code component specifically include: Loading the code component, and retrieving source code data provided by the code component; The feature code in the source code data is identified, and the feature code is edited in the source code based on the code component to set the color value, coordinate value and graphic form of the Unity project.

[0009] According to one aspect of the above technical solution, the steps of identifying the feature code in the source code data and editing the feature code in the source code based on the code component to set the color value, coordinate value and graphic form of the Unity project specifically include: Simulating source code in the source code data to identify a number of characteristic variables in the source code; Screening a plurality of the characteristic variables to screen out target characteristic variables in the source code; Determining the corresponding source code as a feature code according to the target feature variable; In the code component, the feature code is edited to set the color value, coordinate value and graphic form of the Unity project.

[0010] According to one aspect of the above technical solution, in the code component, the step of editing the feature code to set the color value, coordinate value and graphic form of the Unity project specifically includes: In the code component, editing a first feature code in the feature codes includes setting an RGB value in the first feature code to set a color value of a Unity project; Editing a second feature code in the feature code, including setting a code corresponding to a graphic form determined based on a predetermined rule in the second feature code; And editing the third feature code in the feature code includes setting a plurality of coordinate values ​​of the graphic corresponding to the graphic form in the third feature code.

[0011] According to one aspect of the above technical solution, editing the second feature code in the feature code includes setting a code corresponding to a graphic form determined based on a predetermined rule in the second feature code, including: In the second feature code, codes corresponding to a plurality of image patterns determined based on a predetermined rule are set.

[0012] According to one aspect of the above technical solution, the method further includes: When the target graphics are generated in real time based on the rendering of the UI component, if the real-time rendering is stuck, the second feature code and the third feature code are detected, and fault description data of the second feature code and / or the third feature code are output, and then the second feature code and / or the third feature code are repaired based on the fault description data.

[0013] A second aspect of the present invention is to provide a graphics rendering system based on Unity, which is applied to the method described in the above technical solution, and the system comprises: A program acquisition module, used to acquire an XCharst development toolkit, wherein the XCharst development toolkit includes an XCharst main program; A project creation module, used to create a Unity project through the Unity engine based on the XCharst main program; A scene creation module, used to create a new drawing scene in the Unity project; A UI creation module, used for identifying the drawing scene and creating a UI component based on the image source in the application scene; A code creation module, used for adding code components in the properties panel of the Unity project; A code editing module, used for loading the code component, and setting the color value, coordinate value and graphic form of the Unity project in the source code based on the code component; The graphics generation module is used to generate the target graphics in real time based on the rendering of the UI component according to the color value, coordinate value and graphic form.

[0014] A third aspect of the present invention is to provide a readable storage medium having a computer program stored thereon, which implements the method described in the above technical solution when executed by a processor.

[0015] The fourth aspect of the present invention is to provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the method described in the above technical solution when executing the computer program.

[0016] Compared with the prior art, the Unity-based graphics drawing method, system, storage medium and device shown in the present invention have the following beneficial effects: When the method shown in the present invention is used to draw graphics, an XCharst development toolkit is obtained and a Unity project is created based on the Unity engine. Then, a drawing scene is created in the Unity project based on Unity's graphics drawing method. Then, a UI component based on an image source is created in the drawing scene, and a code component is added. Finally, the color value, coordinate value, and graphic form of the Unity project can be set in the source code based on the code component by loading the code component. During the code running process, the target graphics are rendered and generated in real time based on the UI component. The method shown in this embodiment reduces the amount of code that developers need to write, lowers the technical threshold, can effectively improve development efficiency, and the generation of the target graphics is generated by real-time rendering, which can effectively improve interaction and is conducive to improving the accuracy of graphics drawing. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which: Figure 1 It is a flowchart of a graphics drawing method based on Unity shown in one embodiment of the present invention; Figure 2 It is a structural block diagram of a Unity-based graphics rendering system shown in one embodiment of the present invention. DETAILED DESCRIPTION

[0018] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. Several embodiments of the present invention are shown in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0020] Embodiment 1 See also Figure 1 The first embodiment of the present invention provides a graphics drawing method based on Unity, the method comprising steps S10 to S70: Step S10, obtaining an XCharst development toolkit, wherein the XCharst development toolkit includes an XCharst main program.

[0021] In this embodiment, the XCharst development toolkit includes the Xcharst main program, API, sample code, etc.

[0022] Specifically, the method shown in this embodiment is applied to a computer device. Before drawing a graph, the XCharts development toolkit should be downloaded and installed based on the XCharts official website, and then the graph drawing method is executed based on the XCharts development toolkit.

[0023] Step S20: Based on the XCharst main program, a Unity project is created through the Unity engine.

[0024] In this embodiment, after downloading and installing the XCharts development kit, the Unity game engine will be called to create a new Unity project.

[0025] Step S30, creating a new drawing scene in the Unity project; Step S40: identifying the drawing scene, and creating a UI component based on the image source in the application scene.

[0026] In this embodiment, after creating a Unity project and creating a drawing scene based on the Unity project, the drawing scene will be automatically identified, and then a UI component based on the image source driving method will be created in the application scene.

[0027] The step of identifying the drawing scene and creating a UI component based on the image source in the application scene specifically includes: Loading the drawing scene in the Unity project, and identifying a scene identifier of the drawing scene; Based on the scene identifier, a UI component based on the image source is created in the application scene.

[0028] Specifically, the method shown in this embodiment, when creating a UI component based on an image source driving mode, will first load a pre-created drawing scene in the Unity project, identify the scene identifier of the drawing scene, and based on the scene identifier, create a UI component based on an image source driving mode in the application scene. The image source driving mode is driven based on the Image source, which is equivalent to calibrating the UI display interface used for drawing graphics subsequently based on the reference source.

[0029] Step S50, adding a code component in the property panel of the Unity project.

[0030] In this embodiment, the code component shown is a code editing port for drawing graphics. The source code can be modified based on the code component to draw the target graphics, which is any graphics constructed by geometric elements such as points, lines, and surfaces, such as a circle, rectangle, triangle, etc.

[0031] Step S60, loading the code component, and setting the color value, coordinate value and graphic form of the Unity project in the source code based on the code component.

[0032] In this embodiment, the steps of loading the code component and setting the color value, coordinate value and graphic form of the Unity project in the source code based on the code component specifically include: Loading the code component, and retrieving source code data provided by the code component; The feature code in the source code data is identified, and the feature code is edited in the source code based on the code component to set the color value, coordinate value and graphic form of the Unity project.

[0033] The steps of identifying the feature code in the source code data and editing the feature code in the source code based on the code component to set the color value, coordinate value and graphic form of the Unity project specifically include: Simulating source code in the source code data to identify a number of characteristic variables in the source code; Screening a plurality of the characteristic variables to screen out target characteristic variables in the source code; Determining the corresponding source code as a feature code according to the target feature variable; In the code component, the feature code is edited to set the color value, coordinate value and graphic form of the Unity project.

[0034] Among them, in the code component, the step of editing the feature code to set the color value, coordinate value and graphic form of the Unity project specifically includes: wherein, in the code component, editing a first feature code in the feature code includes setting an RGB value in the first feature code to set a color value of a Unity project; Editing a second feature code in the feature code, including setting a code corresponding to a graphic form determined based on a predetermined rule in the second feature code; And editing the third feature code in the feature code includes setting a plurality of coordinate values ​​of the graphic corresponding to the graphic form in the third feature code.

[0035] In this embodiment, when setting the color value, coordinate value and graphic form of the Unity project based on the code component, the code component should be loaded first, and the source code data provided by the code component should be called. The source code data is a general code for drawing graphics, which includes general code and sample code. The sample code is the feature code that needs to be identified in this embodiment. For the source code data, it is a sample code, and for specific graphics drawing, it is the data of the sample code that needs to be modified to draw the graphics. Therefore, in this embodiment, it is necessary to edit the feature code to draw the graphics. Edit the feature code to set the color value, coordinate value and graphic form of the Unity project by editing the feature code, so as to determine the graphic elements of the drawing graphics by editing the feature code.

[0036] During the implementation process, after obtaining the source code data, the source code in the source code data will first be simulated and run to determine several feature variables in the source code, that is, to determine the variable code in the source code, and then the feature variables that affect the graphics generation will be screened, and the target feature variables in the source code will be screened out, and the source code with the target feature variables will be determined as the feature code. Finally, the feature variables will be edited in the code component, including editing the color value, coordinate value and graphic form of the Untiy project, so as to set the color value, coordinate value and graphic form of the Unity project accordingly, so as to generate the corresponding target graphics based on the running of the code.

[0037] Specifically, based on the drive of the code component, the first feature code is edited, including setting RGB values ​​in the first feature code, setting R value, G value and B value respectively, and determining the color value to present the corresponding color by setting the R value, G value and B value. Then the second feature code is edited, including setting the code corresponding to the graphic form determined based on a predetermined rule in the second feature code, for example, the code variable corresponding to a straight line is 1, the code variable corresponding to a rectangle is 2, and the code variable corresponding to a triangle is 3. By determining the code corresponding to the graphic form, the graphic form can be set accordingly to present the corresponding graphic. Finally, the third feature code is edited, including setting the coordinate value corresponding to the graphic form in the third feature code, for example, setting two endpoint coordinates for a straight line, setting three endpoint coordinates for a triangle, and so on. Finally, the graphic parameters required for drawing the corresponding graphic are obtained by re-editing the first feature code, the second feature code and the third feature code.

[0038] Step S70, generating a target graphic in real time based on the rendering of the UI component according to the color value, coordinate value and graphic form.

[0039] In this embodiment, the UI component is a pre-set rendering interface. This embodiment sets a feature code and then runs the re-edited code to render the required target graphics based on the real-time synchronization of the UI component.

[0040] For example, after setting the RGB value to black, the graphic form to a triangle and the coordinate values ​​of the three endpoints in the feature code, the required target graphic can be presented in real time through the UI.

[0041] Of course, the target graphics that need to be rendered in the method shown in this embodiment are slightly complex, but the target graphics are also obtained by piecing together several sub-graphics, so the target graphics can be generated in real time by setting the operation of multiple sets of codes.

[0042] Compared with the prior art, the graphics drawing method based on Unity shown in this embodiment has the following beneficial effects: When the method shown in this embodiment is used for graphics drawing, the XCharst development toolkit is obtained and a Unity project is created based on the Unity engine. Then, a drawing scene is created in the Unity project based on Unity's graphics drawing method. Then, a UI component based on an image source is created in the drawing scene, and a code component is added. Finally, the color value, coordinate value, and graphic form of the Unity project can be set in the source code based on the code component by loading the code component. During the code running process, the target graphics are rendered and generated in real time based on the UI component. The method shown in this embodiment reduces the amount of code that developers need to write, lowers the technical threshold, and can effectively improve development efficiency. In addition, the generation of the target graphics is generated by real-time rendering, which can effectively improve interaction and help improve the accuracy of graphics drawing.

[0043] Embodiment 2 The second embodiment of the present invention also provides a graphics drawing method based on Unity, which is basically similar to the drawing method shown in the first embodiment, except that: In this embodiment, when the target graphics are generated in real time based on the rendering of the UI component, if the real-time rendering is stuck, the second feature code and the third feature code are detected, and fault description data of the second feature code and / or the third feature code are output, and then the second feature code and / or the third feature code are repaired based on the fault description data.

[0044] Specifically, after the feature code in the source code data is edited by the code component, the UI component will execute the edited code according to the processor to control the UI component to render and generate the target graphics in real time, and will detect the picture in real time, including the recognition of the picture frame. When the rendering is detected to be stuck through the picture frame, the second feature code and the third feature code will be detected, and the fault description data of the second feature code and / or the third feature code will be output. The fault description data will be semantically recognized, and finally the second feature code and / or the third feature code will be repaired. The repaired code will be re-executed based on the code component to ensure the real-time generation of graphics drawing.

[0045] Embodiment 3 See also Figure 2 A second embodiment of the present invention provides a graphics rendering system based on Unity, the system comprising: The program acquisition module 10 is used to acquire an XCharst development toolkit, wherein the XCharst development toolkit includes an XCharst main program.

[0046] In this embodiment, the XCharst development toolkit includes the Xcharst main program, API, sample code, etc.

[0047] Specifically, the method shown in this embodiment is applied to a computer device. Before drawing a graph, the XCharts development toolkit should be downloaded and installed based on the XCharts official website, and then the graph drawing method is executed based on the XCharts development toolkit.

[0048] The project creation module 20 is used to create a Unity project through the Unity engine based on the XCharst main program.

[0049] In this embodiment, after downloading and installing the XCharts development kit, the Unity game engine will be called to create a new Unity project.

[0050] A scene creation module 30, used to create a new drawing scene in the Unity project; The UI creation module 40 is used to identify the drawing scene and create a UI component based on the image source in the application scene.

[0051] In this embodiment, after creating a Unity project and creating a drawing scene based on the Unity project, the drawing scene will be automatically identified, and then a UI component based on the image source driving method will be created in the application scene.

[0052] The UI creation module 40 is used for: Loading the drawing scene in the Unity project, and identifying a scene identifier of the drawing scene; Based on the scene identifier, a UI component based on the image source is created in the application scene.

[0053] Specifically, when creating a UI component based on an image source driving method, the system shown in this embodiment will first load a pre-created drawing scene in the Unity project, identify the scene identifier of the drawing scene, and create a UI component based on an image source driving method in the application scene based on the scene identifier. The image source driving method is driven based on the Image source, which is equivalent to calibrating the UI display interface used for drawing graphics subsequently based on the reference source.

[0054] The code creation module 50 is used to add code components in the property panel of the Unity project.

[0055] In this embodiment, the code component shown is a code editing port for drawing graphics. The source code can be modified based on the code component to draw the target graphics, which is any graphics constructed by geometric elements such as points, lines, and surfaces, such as a circle, rectangle, triangle, etc.

[0056] The code editing module 60 is used to load the code component and set the color value, coordinate value and graphic form of the Unity project in the source code based on the code component.

[0057] In this embodiment, the UI creation module 40 specifically includes: Loading the code component, and retrieving source code data provided by the code component; The feature code in the source code data is identified, and the feature code is edited in the source code based on the code component to set the color value, coordinate value and graphic form of the Unity project.

[0058] The UI creation module 40 specifically includes: Simulating source code in the source code data to identify a number of characteristic variables in the source code; Screening a plurality of the characteristic variables to screen out target characteristic variables in the source code; Determining the corresponding source code as a feature code according to the target feature variable; In the code component, the feature code is edited to set the color value, coordinate value and graphic form of the Unity project.

[0059] The UI creation module 40 specifically includes: wherein, in the code component, editing a first feature code in the feature code includes setting an RGB value in the first feature code to set a color value of a Unity project; Editing a second feature code in the feature code, including setting a code corresponding to a graphic form determined based on a predetermined rule in the second feature code; And editing the third feature code in the feature code includes setting a plurality of coordinate values ​​of the graphic corresponding to the graphic form in the third feature code.

[0060] In this embodiment, when setting the color value, coordinate value and graphic form of the Unity project based on the code component, the code component should be loaded first, and the source code data provided by the code component should be called. The source code data is a general code for drawing graphics, which includes general code and sample code. The sample code is the feature code that needs to be identified in this embodiment. For the source code data, it is a sample code, and for specific graphics drawing, it is the data of the sample code that needs to be modified to draw the graphics. Therefore, in this embodiment, it is necessary to edit the feature code to draw the graphics. Edit the feature code to set the color value, coordinate value and graphic form of the Unity project by editing the feature code, so as to determine the graphic elements of the drawing graphics by editing the feature code.

[0061] During the implementation process, after obtaining the source code data, the source code in the source code data will first be simulated and run to determine several feature variables in the source code, that is, to determine the variable code in the source code, and then the feature variables that affect the graphics generation will be screened, and the target feature variables in the source code will be screened out, and the source code with the target feature variables will be determined as the feature code. Finally, the feature variables will be edited in the code component, including editing the color value, coordinate value and graphic form of the Untiy project, so as to set the color value, coordinate value and graphic form of the Unity project accordingly, so as to generate the corresponding target graphics based on the running of the code.

[0062] Specifically, based on the drive of the code component, the first feature code is edited, including setting RGB values ​​in the first feature code, setting R value, G value and B value respectively, and determining the color value to present the corresponding color by setting the R value, G value and B value. Then the second feature code is edited, including setting the code corresponding to the graphic form determined based on a predetermined rule in the second feature code, for example, the code variable corresponding to a straight line is 1, the code variable corresponding to a rectangle is 2, and the code variable corresponding to a triangle is 3. By determining the code corresponding to the graphic form, the graphic form can be set accordingly to present the corresponding graphic. Finally, the third feature code is edited, including setting the coordinate value corresponding to the graphic form in the third feature code, for example, setting two endpoint coordinates for a straight line, setting three endpoint coordinates for a triangle, and so on. Finally, the graphic parameters required for drawing the corresponding graphic are obtained by re-editing the first feature code, the second feature code and the third feature code.

[0063] The graphics generation module 70 is used to generate a target graphic in real time based on the rendering of the UI component according to the color value, coordinate value and graphic form.

[0064] In this embodiment, the UI component is a pre-set rendering interface. This embodiment sets a feature code and then runs the re-edited code to render the required target graphics based on the real-time synchronization of the UI component.

[0065] For example, after setting the RGB value to black, the graphic form to a triangle and the coordinate values ​​of the three endpoints in the feature code, the required target graphic can be presented in real time through the UI.

[0066] Of course, the target graphics that the system shown in this embodiment needs to render in the end will be slightly complex, but the target graphics are also obtained by piecing together a number of sub-graphics, so that the operation of multiple sets of codes can be set accordingly to generate the target graphics in real time.

[0067] Compared with the prior art, the graphics rendering system based on Unity shown in this embodiment has the following beneficial effects: When the system shown in this embodiment is used for graphics drawing, the XCharst development toolkit is obtained and a Unity project is created based on the Unity engine. Then, a drawing scene is created in the Unity project based on Unity's graphics drawing method. Then, a UI component based on the image source is created in the drawing scene, and a code component is added. Finally, the color value, coordinate value and graphic form of the Unity project can be set in the source code based on the code component by loading the code component. During the code running process, the target graphics are rendered and generated in real time based on the UI component. The system shown in this embodiment reduces the amount of code that developers need to write, lowers the technical threshold, can effectively improve development efficiency, and the generation of the target graphics is generated by real-time rendering, which can effectively improve interaction and help improve the accuracy of graphics drawing.

[0068] Embodiment 4 A fourth embodiment of the present invention provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method described in the above embodiment is implemented.

[0069] Embodiment 5 A fifth embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the method described in the above embodiments when executing the computer program.

[0070] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0071] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for those of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A graphics drawing method based on Unity, characterized in that: The method comprises: Obtain an XCharst development toolkit, wherein the XCharst development toolkit includes an XCharst main program; Based on the XCharst main program, create a Unity project through the Unity engine; Create a new drawing scene in the Unity project; Identify the drawing scene, and create a UI component based on the image source in the application scene; Add a code component in the properties panel of the Unity project; Loading the code component, and setting the color value, coordinate value and graphic form of the Unity project in the source code based on the code component; Generating a target graphic in real time based on the rendering of the UI component according to the color value, the coordinate value and the graphic form; After the feature code in the source code data is edited by the code component, the UI component will control the UI component to render and generate the target graphics in real time according to the processor executing the edited code, and will detect the picture in real time, including the recognition of the picture frame; When rendering freezes are detected through the picture frame, the second feature code and the third feature code are detected, and fault description data of the second feature code and / or the third feature code are output. Semantic recognition is performed on the fault description data, and the second feature code and / or the third feature code are repaired based on the semantic recognition result. The repaired code is then re-executed based on the code component to ensure real-time generation of graphics drawing.

2. The graphics drawing method based on Unity according to claim 1, characterized in that: The step of identifying the drawing scene and creating a UI component based on the image source in the application scene specifically includes: Loading the drawing scene in the Unity project, and identifying a scene identifier of the drawing scene; Based on the scene identifier, a UI component based on the image source is created in the application scene.

3. The graphics drawing method based on Unity according to claim 1, characterized in that: The steps of loading the code component and setting the color value, coordinate value and graphic form of the Unity project in the source code based on the code component specifically include: Loading the code component, and retrieving source code data provided by the code component; The feature code in the source code data is identified, and the feature code is edited in the source code based on the code component to set the color value, coordinate value and graphic form of the Unity project.

4. The graphics drawing method based on Unity according to claim 3, characterized in that: The steps of identifying a feature code in the source code data and editing the feature code in the source code based on the code component to set the color value, coordinate value and graphic form of the Unity project specifically include: Simulating source code in the source code data to identify a number of characteristic variables in the source code; Screening a plurality of the characteristic variables to screen out target characteristic variables in the source code; Determining the corresponding source code as a feature code according to the target feature variable; In the code component, the feature code is edited to set the color value, coordinate value and graphic form of the Unity project.

5. The graphics drawing method based on Unity according to claim 4, characterized in that: In the code component, the step of editing the feature code to set the color value, coordinate value and graphic form of the Unity project specifically includes: In the code component, editing a first feature code in the feature codes includes setting an RGB value in the first feature code to set a color value of a Unity project; Editing a second feature code in the feature code, including setting a code corresponding to a graphic form determined based on a predetermined rule in the second feature code; And editing the third feature code in the feature code includes setting a plurality of coordinate values ​​of the graphic corresponding to the graphic form in the third feature code.

6. The graphics drawing method based on Unity according to claim 5, characterized in that: Editing a second feature code in the feature code includes setting a code corresponding to a graphic form determined based on a predetermined rule in the second feature code, including: In the second feature code, codes corresponding to a plurality of image patterns determined based on a predetermined rule are set.

7. A graphics rendering system based on Unity, characterized in that: The method applied to any one of claims 1 to 6, wherein the system comprises: A program acquisition module, used to acquire an XCharst development toolkit, wherein the XCharst development toolkit includes an XCharst main program; A project creation module, used to create a Unity project through the Unity engine based on the XCharst main program; A scene creation module, used to create a new drawing scene in the Unity project; A UI creation module, used for identifying the drawing scene and creating a UI component based on the image source in the application scene; A code creation module, used to add code components in the properties panel of the Unity project; A code editing module, used for loading the code component, and setting the color value, coordinate value and graphic form of the Unity project in the source code based on the code component; The graphics generation module is used to generate a target graphic in real time based on the rendering of the UI component according to the color value, coordinate value and graphic form.

8. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of being executed on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • 3D rendering device of android

    CN106886404A

  • Unity-based three-dimensional software development method and device, equipment and medium

    CN115640044A

  • Large-space AR (Augmented Reality) identification method and system developed by combining WeChat applet with Unity

    CN117667048A

  • XR engine low-code development platform

    CN117742677A

  • Json data analysis method and device in Unity environment, equipment and medium

    CN118261143A