Element collision and sequence detection method and device, computer equipment and readable storage medium

By using cross-platform development toolkits and custom scripts in the Unity editor, efficient collision detection and sorting judgment of UI elements between multiple terminal devices is achieved, and poor interaction compatibility in the existing technology is solved, and development efficiency and user experience are improved.

CN119847517APending Publication Date: 2025-04-18SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411775915.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The prior art is difficult to realize efficient collision detection and sorting judgment of UI elements among multiple terminal devices, especially in virtual reality and augmented reality applications.

Method used

By using cross-platform development kits and custom scripts in the Unity editor, create a main canvas and top-level UI parent object, add ImgPieDragManager scripts and collision detection scripts, implement drag, collision recognition, random disruption and sorting verification of UI elements.

Benefits of technology

It realizes efficient collision detection and sorting judgment of UI elements on different terminals, simplifies the development process, improves development efficiency, reduces the cost of cross-platform application development, and promotes the development of virtual reality and augmented reality technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847517A_ABST
    Figure CN119847517A_ABST
Patent Text Reader

Abstract

The invention provides an element collision and sequence detection method and device, computer equipment and a readable storage medium, and belongs to the technical field of computers.The method comprises the steps that firstly, an interactive application infrastructure is constructed, a main canvas is established to serve as a container of UI elements, and a top-level UI parent object is arranged below the main canvas; a user-defined script with the name of ImgPieDragManager is added to the top-level UI parent object, and a user-defined script with the name of ImgPieDragManager is added to the user-defined script; for each UI element needing to be sorted, a father node containing preset correct position information is specified for the UI element, then the UI element is mounted to a top-level UI father object, and a script special for achieving a collision detection function is added to each child element. According to the technical scheme, the user experience is guaranteed, meanwhile, the requirements of multiple target platforms can be met through one-time code writing, the development efficiency is improved, the software development and maintenance cost is reduced, the complexity of UI design is simplified, and developers can concentrate on core functions more.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, computer equipment and readable storage medium for element collision and sequence detection. Background Art

[0002] In highly interactive applications such as virtual reality (VR) and augmented reality (AR), it is very important to ensure that user interface (UI) elements are both highly interactive and easy to operate. However, in the actual development process, the design and implementation of UI elements often encounter the limitations of the technical platform, especially when it is necessary to support multiple terminal devices (such as personal computers (PCs), mobile devices, and VR headsets) at the same time. How to efficiently implement collision detection and correct sorting judgment between UI elements has become a significant challenge.

[0003] Existing solutions, such as Unity's UGUI (Unity Graphical User Interface), provide powerful UI design tools, but when faced with cross-platform requirements, their native functions may not fully meet the requirements of collision detection and sorting judgment in all scenarios. Different terminal devices have their own input methods and technical characteristics, which leads to different methods for implementing these functions, making it difficult to form a universal and efficient solution. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a method for element collision and sequence detection in a cross-platform user UI interface, thereby solving the interaction problems caused by device differences and improving the versatility of the application and user satisfaction.

[0005] The present invention aims to solve the problem in the prior art that it is difficult to achieve good compatibility of user interface (UI) element interactions among multiple terminals. By optimizing UI design and interaction logic, the present invention ensures that UI elements can provide a consistent and efficient user experience on different types of devices (such as PCs, mobile devices, and VR / AR head displays), and achieves efficient and unified UI collision detection and sorting judgment, which is particularly suitable for interactive applications such as virtual reality (VR) and augmented reality (AR).

[0006] The technical solution of the present invention is:

[0007] A method for element collision and order detection,

[0008] The steps include:

[0009] Toolkit acquisition: Use the cross-platform development toolkit provided by the Unity editor to create a basic environment for interactive applications.

[0010] Root canvas and top-level UI creation: Establish a main canvas (Canvas) in the environment as a container for UI elements, and set a top-level UI parent object under it to manage all UI components that need to participate in sorting or collision detection.

[0011] Script management: used to add ImgPieDragManager script and collision detection script; ImgPieDragManager script not only implements random arrangement of UI elements to increase interactivity, but also has the logic to determine whether the sorting is correct based on the match between each element and the preset order of its parent node.

[0012] Interaction and detection: The dragging and collision identification of elements are realized through the collision detection script, and then the ImgPieDragManager script performs the random shuffling and sorting verification process to ensure that the elements are arranged in the predetermined order.

[0013] Furthermore,

[0014] Script management includes

[0015] Script integration: Add the ImgPieDragManager script to the top-level UI parent object, which is responsible for handling the position randomization of UI elements, relationship mapping with parent nodes, and final sorting detection.

[0016] Element preparation: Each UI element to be sorted will be assigned a preset correct order identifier, i.e., a parent node, and loaded into the top-level UI parent object. At the same time, a collision detection script will be provided for each element.

[0017] Going further,

[0018] Toolkit installation: Install the XR Interaction Toolkit through the Unity Editor's PackageManager.

[0019] Root Canvas Setup: Set the root canvas mode to World mode and add the TrackedDeviceGraphicRaycaster script.

[0020] In addition, the present invention also provides a device for element collision and sequence detection, comprising:

[0021] Toolkit acquisition module: responsible for selecting the appropriate cross-platform toolkit from the Unity editor.

[0022] Root canvas and UI building blocks: Build the basic framework of the UI, including the main canvas and top-level UI parent objects.

[0023] Script management module: includes two sub-modules, which are used to add ImgPieDragManager script and collision detection script respectively.

[0024] Interaction processing module: covers dragging, collision detection, random shuffling and sorting verification functions.

[0025] Furthermore,

[0026] The script management module includes:

[0027] First script adds the module: Add the ImgPieDragManager script to the top-level parent UI.

[0028] The second script adding module: add parent nodes and collision detection scripts with preset correct order for each element to be sorted.

[0029] In addition, the present invention also provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in any of the above steps.

[0030] In addition, the present invention also provides a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement the method described in any of the above steps.

[0031] The beneficial effects of the present invention are

[0032] The present invention makes full use of the powerful functions of the Unity editor and combines custom scripts to achieve efficient collision detection and sorting judgment of UI elements on different terminals. This solution not only simplifies the development process and improves development efficiency, but also reduces duplication of work in cross-platform application development, helping to reduce overall development costs. More importantly, it provides developers with a simple and easy-to-use method that allows even beginners to quickly master and apply it to actual projects, greatly promoting the development of virtual reality and augmented reality technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 It is a schematic diagram of the computer program operation of the present invention. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0035] In order to overcome the current difficulties, developers are exploring more flexible and compatible technical approaches, aiming to run seamlessly on multiple platforms through one-time development while maintaining good performance and user experience. This not only involves innovation in UI design patterns, but also requires in-depth research on the differences between different platforms and how to effectively use the existing technology stack to make up for these differences. For example, through customized scripts and plug-ins, the adaptability and functionality of UGUI in multi-terminal environments can be improved to a certain extent, thereby better serving complex interactive application scenarios.

[0036] Specific measures include adopting a cross-platform development framework, customized UI components, and intelligent adaptation algorithms to effectively solve the interaction problems caused by device differences and improve the versatility of the application and user satisfaction.

[0037] The present invention aims to solve the problem of poor interactive compatibility of UI elements between different terminals in the prior art, and is particularly suitable for interactive applications such as virtual reality (VR) and augmented reality (AR).

[0038] Method steps:

[0039] 1. Toolkit acquisition: Get toolkits for cross-platform interactive applications based on the Unity editor, such as the XRInteraction Toolkit.

[0040] 2. Root canvas creation: Use the toolkit to create a root canvas for displaying UGUI, and create a top-level parent UI on the root canvas to store the elements to be sorted and their parent nodes.

[0041] 3. Script integration: Add the ImgPieDragManager script to the top-level parent UI. This script is responsible for handling the random shuffling of the positions of the elements to be sorted, the relationship mapping with the parent node, and the sorting detection.

[0042] 4. Element preparation: Add a parent node with the correct order preset for each element to be sorted, then add it to the top-level parent UI, and add a script for collision detection for each element.

[0043] 5. Collision detection: Use collision detection script to implement dragging and collision detection of elements to be sorted.

[0044] 6. Element shuffling: Based on the ImgPieDragManager script, the elements to be sorted after collision detection are randomly shuffled.

[0045] 7. Sorting test: Use the ImgPieDragManager script again to compare the IDs of the shuffled elements to be sorted with the preset correct order of the parent nodes for sorting test.

[0046] Key Components

[0047] Toolkit acquisition module: responsible for obtaining the XR Interaction Toolkit from the Unity editor.

[0048] Root canvas creation module: Creates a root canvas for displaying UGUI, sets it to world mode, and adds XR's tracking device graphics raycaster script.

[0049] First script adds the module: Add the ImgPieDragManager script to the top-level parent UI.

[0050] The second script adding module: add parent nodes and collision detection scripts with preset correct order for each element to be sorted.

[0051] Collision detection module: realizes drag and collision detection functions.

[0052] Element shuffling module: realizes random shuffling of elements to be sorted.

[0053] Sorting detection module: implements the sorting detection function.

[0054] Implementation details

[0055] Toolkit installation: Install the XR Interaction Toolkit through the Unity Editor's PackageManager.

[0056] Root Canvas Setup: Set the root canvas mode to World mode and add the TrackedDeviceGraphicRaycaster script.

[0057] Script configuration:

[0058] ImgParent script: defines the real ordinal ID of the parent node.

[0059] ImageCollision script: handles dragging, collisions, and position swapping.

[0060] BoxCollider script: defines collision volume and position.

[0061] Rigidbody script: Trigger collision events.

[0062] CanvasGroup script: Control element transparency.

[0063] Button component:

[0064] btn attribute: used to randomly shuffle the elements to be sorted.

[0065] btnCheck attribute: used for sorting detection.

[0066] Technical advantages

[0067] Cross-platform compatibility: Based on Unity UGUI and XR Interaction Toolkit, multi-terminal compatibility is achieved.

[0068] Reduce workload: Provide a highly reusable framework to reduce repetitive coding.

[0069] Improve development efficiency: speed up development and shorten product launch time.

[0070] Reduce maintenance costs: Standardized development methods reduce maintenance difficulty.

[0071] Consistent user experience: Use standardized interface elements and interaction patterns to improve user satisfaction.

[0072] Application prospects

[0073] This method provides new ideas and solutions for the development of multi-terminal interactive applications, which is particularly suitable for VR and AR applications and has broad application prospects.

[0074] Computer equipment

[0075] Memory: stores computer programs.

[0076] Processor: executes the computer program to implement the above method.

[0077] Computer readable storage medium

[0078] The computer program for executing the above method is stored, and multiple storage technologies are supported, such as PRAM, SRAM, DRAM, ROM, EEPROM, etc.

[0079] The present invention makes full use of the powerful functions of the Unity editor and combines custom scripts to achieve efficient collision detection and sorting judgment of UI elements on different terminals. This solution not only simplifies the development process and improves development efficiency, but also reduces duplication of work in cross-platform application development, helping to reduce overall development costs. More importantly, it provides developers with a simple and easy-to-use method that allows even beginners to quickly master and apply it to actual projects, greatly promoting the development of virtual reality and augmented reality technologies.

[0080] The above description is only a preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, and is not used to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for element collision and sequence detection, characterized in that: The steps include: 1) Toolkit acquisition: Use the cross-platform development toolkit provided by the Unity editor to create a basic environment for interactive applications; 2) Creation of root canvas and top-level UI: Build a main canvas in the environment as a container for all UI elements, and on this basis, establish a top-level UI parent object to manage all UI components that need to be sorted or detected for collision; 3) Script management: used to add ImgPieDragManager script and collision detection script; 4) Interaction and detection: The dragging and collision identification of elements are realized through the collision detection script, and then the ImgPieDragManager script performs the random shuffling and sorting verification process to ensure that the elements are arranged in the predetermined order.

2. The method according to claim 1, characterized in that Script management includes Script integration: Add the ImgPieDragManager script to the top-level UI parent object, which is responsible for handling the randomization of the position of UI elements, the relationship mapping with the parent node, and the final sorting detection; element Preparation: Each UI element to be sorted is assigned a preset correct order identifier, i.e., a parent node, and loaded into the top-level UI parent object. At the same time, a collision detection script is provided for each element.

3. The method according to claim 1, characterized in that Toolkit installation: Install the XR Interaction Toolkit through the Unity Editor's PackageManager.

4. The method according to claim 1, characterized in that Root Canvas Setup: Set the root canvas mode to World mode and add the TrackedDeviceGraphicRaycaster script.

5. A device for element collision and sequence detection, characterized in that: include: Toolkit acquisition module: responsible for selecting the appropriate cross-platform toolkit from the Unity editor; Root canvas and UI building blocks: build the basic framework of the UI, including the main canvas and top-level UI parent objects; Script management module: includes two sub-modules, which are used to add ImgPieDragManager script and collision detection script respectively; Interaction processing module: covers dragging, collision detection, random shuffling and sorting verification functions.

6. The device according to claim 5, characterized in that The script management module includes: The first script adds the module: add the ImgPieDragManager script to the top-level parent UI; The second script adding module: add parent nodes and collision detection scripts with preset correct order for each element to be sorted.

7. A computer device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method according to any one of claims 1 to 4.

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

Citation Information

Patent Citations

  • Multi-terminal-compatible UI collision and sorting detection method and device, equipment and medium

    CN118466958A