WO2022104883A1 - Adding method and apparatus for coexistence of multiple types of scenarios, terminal and storage medium - Google Patents

Adding method and apparatus for coexistence of multiple types of scenarios, terminal and storage medium Download PDF

Info

Publication number
WO2022104883A1
WO2022104883A1 PCT/CN2020/132379 CN2020132379W WO2022104883A1 WO 2022104883 A1 WO2022104883 A1 WO 2022104883A1 CN 2020132379 W CN2020132379 W CN 2020132379W WO 2022104883 A1 WO2022104883 A1 WO 2022104883A1
Authority
WO
WIPO (PCT)
Prior art keywords
scene
resource
data package
configuration
resources
Prior art date
Application number
PCT/CN2020/132379
Other languages
French (fr)
Chinese (zh)
Inventor
宋大伟
邹黎盛
张雷
Original Assignee
苏州亿歌网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州亿歌网络科技有限公司 filed Critical 苏州亿歌网络科技有限公司
Publication of WO2022104883A1 publication Critical patent/WO2022104883A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/006Mixed reality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts

Definitions

  • the embodiments of the present application relate to computer technologies, and in particular, to a method, apparatus, terminal, and storage medium for adding coexistence of multiple types of scenarios.
  • the related technology usually adopts two ways to process the scene, one is that only one scene exists at the same time at any time, and the other is that multiple scenes of the same type coexist.
  • the embodiments of the present application provide a method, device, terminal, and storage medium for adding multiple types of scenarios to coexist, which can realize the coexistence of multiple types of scenarios and improve the flexibility of user configuration of scenarios.
  • an embodiment of the present application provides a method for adding coexistence of multiple types of scenarios, including:
  • the partial scenes include: a first scene of a shared display type and a second scene of an exclusive display type;
  • the scene resources in the scene data package of the second scene are loaded in the second initial configuration scene matching the second scene, so as to complete the addition of the second scene in the target configuration scene .
  • an embodiment of the present application further provides a device for adding coexistence of different types of scenarios, including:
  • a data packet acquisition module configured to acquire scene data packets of at least two local scenes in the target configuration scene respectively, and the local scenes include: a first scene of a shared display type and a second scene of an exclusive display type;
  • a first adding module configured to directly load the scene resources in the scene data package of the first scene in the first initial configuration scene matching the first scene, so as to complete the addition of the first scene in the target configuration scene;
  • the second adding module is used to load the scene resources in the scene data package of the second scene in the second initial configuration scene that matches the second scene in the mode of exclusive display, so as to complete the second scene in the target configuration scene. Add to.
  • an embodiment of the present application further provides a terminal, where the terminal includes:
  • processors one or more processors
  • memory for storing one or more programs
  • the one or more processors implement the method for adding coexistence of multiple types of scenarios provided by any embodiment of the present application.
  • the embodiments of the present application further provide a storage medium containing computer-executable instructions, when the computer-executable instructions are executed by a computer processor for executing the coexistence of multiple types of scenarios as provided by any embodiment of the present application method of adding.
  • the exclusive display method is used to display the scene data package of the second scene.
  • the scene resource is loaded to realize the addition of the second scene in the target configuration scene.
  • the embodiment of the present application adopts different adding methods to realize the coexistence of multiple types of scenes, which facilitates the user to flexibly configure the target configuration scene according to planning requirements, and improves the flexibility of the user to configure the scene. .
  • FIG. 1 is a flowchart of a method for adding coexistence of multiple types of scenarios provided by Embodiment 1 of the present application;
  • Embodiment 2 is a flowchart of another method for adding multi-type scene coexistence provided by Embodiment 2 of the present application;
  • Embodiment 3 is a work flow diagram of a method for adding different types of local scenes provided in Embodiment 2 of the present application;
  • FIG. 4 is a schematic structural diagram of a multi-type scene coexistence adding apparatus provided in Embodiment 3 of the present application;
  • FIG. 5 is a schematic structural diagram of a terminal according to Embodiment 4 of the present application.
  • FIG. 1 is a flowchart of a method for adding multiple types of scenarios to coexist according to the first embodiment of the present application. This embodiment is applicable to the situation where multiple types of scenarios are added on the basis of the initial configuration scenario.
  • the device can be implemented by adding an additional device, and the device can be implemented in software and/or hardware.
  • the device may be configured in a terminal. As shown in Figure 1, the method includes:
  • Step S101 respectively acquiring scene data packets of at least two partial scenes in the target configuration scene, where the partial scenes include: a first scene of a shared display type and a second scene of an exclusive display type.
  • the target configuration scene may be a virtual reality scene constructed based on the initial configuration scene in the current terminal application, and may be presented to the user on the current terminal through a display device.
  • the terminal application may be an application running on a terminal device, for example, a game or an audio and video playback application running on a terminal device such as a mobile phone, a wearable device, a tablet computer, or a computer.
  • the display device may be a device with a display function, for example, a display screen of a mobile phone, a tablet computer or a computer, or a head-mounted stereoscopic display of a head-mounted device, and the like.
  • the initial configuration scenario may be an initial scenario corresponding to the target configuration scenario.
  • the initial configuration scene may be an initial virtual reality scene in the current terminal application before updating the current terminal application, an empty scene configured when the current terminal application is installed, or an initial display scene before the user performs a change operation on the display interface of the terminal application .
  • the target configuration scene may include at least two partial scenes.
  • the target configuration scene can be a scene for displaying on the entire display device, the entire scene is divided into different areas according to actual needs, and each area can be used as a partial scene, so that the user can design each partial scene individually .
  • All partial scenes can be divided into two types, one is the first scene of shared display type, and the other is the second scene of exclusive display type.
  • the first scene of the shared display type may be a virtual reality scene that coexists with the initial configuration scene
  • the second scene of the exclusive display type may be a virtual reality scene that cannot be mutually exclusive with the initial configuration scene, and only one of the two can exist at the same time. realistic scene.
  • an initial 3D configuration scene of the game engine (unity) type if a first scene is added to the initial 3D configuration scene, the first scene can be a prefab type scene, and the prefab type scene can be found in It is added directly on the basis of the unity type scene.
  • the second scene can be a Unity type scene.
  • the Unity type scene cannot be directly added on the basis of the same Unity type scene, but can be displayed by means of exclusive display. Add to.
  • the scene data package may be a data package containing scene configuration data in the local scene, and may be downloaded from the server or obtained from the running memory.
  • the target configuration scene A includes partial scenes A1, A2, A3, and A4, and the scene data packets of the partial scenes A1, A2, A3, and A4 are obtained respectively, wherein A1 and A2 are the first scene of the prefab type, and A3 and A4 is the second scene of unity type.
  • Step S102 In the first initial configuration scene matching the first scene, directly load the scene resources in the scene data package of the first scene to complete the addition of the first scene in the target configuration scene.
  • the first initial configuration scenario is a scenario matching the first scenario in the initial configuration scenario.
  • the scene type of the first initial configuration scene may be an empty scene type or an exclusive display type. It should be noted that, for the first initial configuration scene of the exclusive display type, the first scene of the shared display type can be directly added in the first initial configuration scene, and the scene resources in the scene data package of the first scene can be directly added in the first initial configuration scene. Loading in the initial configuration scene.
  • the first initial configuration scene is a unity type scene
  • the first scene is a prefab type scene
  • a prefab type scene can be directly added to the unity type scene.
  • the scene resources in the scene data package can be various model resources that may be involved in the local scene.
  • scene resources can be 3D model resources such as characters, animals, buildings, plants, mountains, rivers, or tools.
  • the current scene obtained after directly loading the scene resources in the scene data package of the first scene is the first scene. If the first initial configuration scene matching the first scene is an exclusive display type scene, the current scene obtained after direct loading is the combination of the first initial configuration scene and the scene resources of the first scene.
  • directly load the scene resources in the scene data package of the first scene including:
  • the category is judged according to the scene resources in the scene data package of the first scene, and the scene resources of the same category are stored in the same sub-scene data package, and the scene resources of different categories are stored in different sub-scene data packages, respectively. Load the scene resources in each sub-scene data package.
  • the scene data package of the first scene contains multiple plants, and these plants are configured with the same model, it can be determined that these plants belong to the same category of scenes resources, and by storing the model in the sub-scene data package, storage space can be saved.
  • the scene data package of the first scene can also contain insects other than plants, and the models to which plants belong and insects are stored in different sub-scenarios. In the scene data package, and load them separately, the scene resources can be allocated reasonably, and the loading speed can be improved during the loading process.
  • Step S103 in an exclusive display manner, load the scene resources in the scene data package of the second scene in the second initial configuration scene matching the second scene, so as to complete the addition of the second scene in the target configuration scene.
  • the second initial configuration scenario is a scenario matching the second scenario in the initial configuration scenario.
  • the scene type of the second initial configuration scene may be an empty scene type or an exclusive display type. It should be noted that, for the second initial configuration scene of the exclusive display type, the second scene of the exclusive display type cannot be directly added to the second initial configuration scene, and only one of the second initial configuration scene and the second scene can exist at the same time.
  • the scene is displayed exclusively.
  • the second initial configuration scene is a unity type scene, and the second scene is also a unity type scene. If you need to add a second scene to the second initial configuration scene, you can only use the exclusive display method, that is, the two can only be displayed. There is one scene that is displayed exclusively and another scene cannot be displayed.
  • the way of exclusive display may be that only the second scene is in an active state, and the second initial configuration scene is in a hidden state.
  • the manner of exclusive display may also be that only the second scene is displayed, and an occlusion layer is added on the second initial configuration scene, so that the second initial configuration scene is not displayed.
  • the manner of exclusive display may also be to uninstall the second initial configuration scene and retain only the second scene. Or other manners in which the second scene can be exclusively displayed, which is not specifically limited in this application.
  • the current scene obtained after directly loading the scene resources in the scene data package of the second scene is the second scene. If the second initial configuration scene that matches the second scene is an exclusive display type scene, the current scene obtained after loading in the exclusive display mode is also the second scene.
  • loading the scene resources in the scene data package of the second scene in the second initial configuration scene matching the second scene including:
  • the category is judged according to the scene resources in the scene data package of the second scene, and the scene resources of the same category are stored in the same sub-scene data package, and the scene resources of different categories are stored in different sub-scene data packages.
  • the scene resources in each sub-scene data package are respectively loaded in the second initial configuration scene matching the second scene.
  • the scene data package of the second scene contains multiple wheat fields, and the attributes of these wheat fields are the same, it can be determined that these wheat fields belong to the same category of scene resources.
  • the scene data package of the second scene can also contain houses other than wheat fields.
  • the wheat fields and houses are stored in different sub-scenario data packages and loaded separately, which can realize the reasonable allocation of scene resources. Improve loading speed during loading.
  • step S102 and step S103 are not limited to the above-mentioned parallel execution sequence.
  • step S102 may be executed first and then step S103 may be executed after step S101.
  • step S103 may be performed first and then step S102 may be performed. This application does not specifically limit this.
  • the exclusive display method is used to display the scene data package of the second scene.
  • the scene resource is loaded to realize the addition of the second scene in the target configuration scene.
  • the embodiment of the present application adopts different adding methods to realize the coexistence of multiple types of scenes, which facilitates the user to flexibly configure the target configuration scene according to the planning requirements, and improves the user's flexibility in scene configuration. .
  • FIG. 2 is a flowchart of another method for adding coexistence of multiple types of scenarios provided in Embodiment 2 of the present application. This embodiment is optimized on the basis of the above-mentioned embodiment. As shown in FIG. 2 , the method includes:
  • Step S201 Obtain scene configuration files of at least two local scenes in the target configuration scene respectively, download the corresponding scene data package from the server according to the download path in each scene configuration file, and the local scenes include: the first scene of the shared display type and the exclusive scene Second scene of display type.
  • the scenario configuration file may be a configuration file written by the user according to the planning requirements of the scenario. Users can write scene configuration files for each local scene according to the actual planning requirements of each local scene in the target configuration scene. Since the partial scene can include the first scene of the shared display type and the second scene of the exclusive display type, the user can write different scene configuration files for different types of scenes, so as to realize the addition of multiple types of scenes, which can better meet the user's planning needs .
  • FIG. 3 is a workflow diagram of a method for adding different types of local scenes provided in Embodiment 2 of the present application. As shown in FIG. 3 , when adding a local scene, different adding operations are determined according to the scene types of different local scenes , the scene type of the local scene can include unity type and prefab type.
  • the terminal can send a data package download request to the server according to the download path in each scenario configuration file.
  • the server sends the corresponding scene data package to the terminal according to the download path in the data package acquisition request.
  • the terminal receives the scene data packet sent by the server.
  • the corresponding scene data package is obtained from the running memory according to the download path in each scene configuration file.
  • the running memory can also be queried according to the download path in each scene configuration file. If there is a corresponding scene data package in the running memory, the corresponding scene data package is directly obtained from the running memory. If there is no corresponding scene data package, download it from the server. For example, in the scenario of updating the current terminal application without stopping, if the scene data package already exists in the running memory, it will be obtained directly. If the scene data package does not exist in the running memory, it will be downloaded from the server according to the download path in each scene configuration file. .
  • the method further includes:
  • the type identifier of the local scene is the preset shared display type identifier, it is determined that the local scene is the first scene;
  • the type identifier of the partial scene is the preset exclusive display type identifier, it is determined that the partial scene is the second scene.
  • the type identifier may be used to identify the scene type of the local scene, and may include a preset shared display type identifier and a preset exclusive display type identifier. For example, the user pre-sets the type identifier of each local scene in the scene configuration file according to the scene type of the local scene, the preset shared display type identifier may be set to 0, and the preset exclusive display type identifier may be set to 1.
  • each local scene it is determined whether the local scene is the first scene or the second scene according to the type identifier in the scene configuration file, which realizes automatic distinction of various types of scenes, and performs different adding operations according to different types of local scenes, so that each Local scenes can meet the planning needs of users.
  • Step S202 In the first initial configuration scene matching the first scene, directly load the scene resources in the scene data package of the first scene. Then step S203 is executed.
  • the scene resources of the partial scene are directly loaded for the partial scene of the prefab type.
  • Step S203 completing the addition of the first scene in the target configuration scene. Continue to execute step S211.
  • Step S204 judging whether the scene type of the second initial configuration scene matching the second scene is an empty scene type or an exclusive display type, if it is an empty scene type, go to step S205, if it is an exclusive display type, go to step S206.
  • the scenario type of the second initial configuration scenario may be determined by acquiring the type identifier in the initial configuration file of the terminal application.
  • Step S205 directly loading the scene resources in the scene data package of the second scene. Continue to perform step S210.
  • the scene resources in the scene data package of the second scene may be directly loaded in the empty scene.
  • Step S206 Determine the loading method of the scene resource in the scene data package according to the key field in the scene data package of the second scene. Continue to execute step S207.
  • key fields are pre-set in the scene data package by the user according to the development requirements and the running environment.
  • key fields may include preset toggle fields and preset hidden fields.
  • the loading method of the scene resource in the scene data package may be determined according to the key field in the scene data package of the second scene. It is convenient for users to flexibly configure the loading method of scene resources according to actual development requirements, which improves the flexibility of users in scene configuration.
  • Step S207 judging whether the key field in the scene data packet of the second scene is a preset switching field or a preset hidden field, if it is a preset switching field, go to step S208, if it is a preset hidden field, go to step S209.
  • step S208 may be performed, and if not, step S209 may be performed.
  • Step S208 Unload the second initial configuration scene to obtain an empty scene, and load the scene resources in the scene data package of the second scene in the empty scene. Continue to perform step S210.
  • the key field in the scene data packet of the second scene is the preset switching field, delete all scene resources in the second initial configuration scene to obtain an empty scene, and load the scene of the second scene in the empty scene Scene resources in the package.
  • the local scene is the second scene
  • the second initial configuration scene and the second scene are both unity type scenes
  • the user's development requirement is to switch the second initial configuration scene to the second scene in some specific links scene, unload the original unity type scene, and switch to the empty scene first, and then load the second scene in the way of loading a single unity type scene to switch to the second scene, which can reduce the memory pressure and avoid the process of switching scenes.
  • the "Loading" interface appears frequently.
  • Step S209 Load the scene resource in the scene data package of the second scene in the second initial configuration scene, activate the second scene and hide the second initial configuration scene. Continue to perform step S210.
  • the key field in the scene data package of the second scene is a preset hidden field
  • load the scene resources in the scene data package of the second scene in the second initial configuration scene and set the state of the second scene to
  • the state of the second initial configuration scene is set to a hidden state, that is, an inactive state, so that there is only one currently activated scene.
  • the local scene is the second scene
  • the second initial configuration scene and the second scene are both unity type scenes
  • the user's development requirement is to hide the second initial configuration scene in some specific links, so that the current If only the second scene is displayed in the partial scene, the second scene is loaded in a superimposed manner.
  • Step S210 completing the addition of the second scene in the target configuration scene. Continue to execute step S211.
  • steps S202 to S210 is not limited to the execution sequence provided in FIG. 2 in the embodiment of the present application. It is also possible to perform steps S202 to S203 first, then perform steps S204 to S210, and then continue to perform step S211. Alternatively, first perform steps S204 to S210, then perform steps S202 to S203, and then continue to perform step S211. This application does not specifically limit this.
  • Step S211 acquiring the resource configuration file of the target resource in the target configuration scene, and querying all resource packages in the running memory according to the download path in the resource configuration file.
  • Target assets can be scene-related assets such as skyboxes, caremaps, and probes.
  • the resource configuration file of the target resource may be a configuration file written by the user according to the planning requirements of the resource related to the scene. According to the actual planning requirements for all target resources in the target configuration scene, the user can write scene configuration files for the target resources of each partial scene, or write scene configuration files for the entire target configuration scene.
  • Adding the target resource in the current scene may be adding the target resource after completing the first scene in step S203 and the second scene in step S210, or directly adding the target resource in the initial configuration scene, or adding the target resource at other times .
  • Step S212 judging whether there is a resource data package of the target resource in the running memory, if yes, go to step S213 , otherwise go to step S214 .
  • the resource data package can be a data package containing resource configuration data in the target resource, and can be downloaded from the server or obtained from the running memory.
  • Step S213 Load the resource data package in the running memory in the current scene. Continue to execute step S215.
  • the resource data package is directly reused, and the resource data package in the running memory is loaded in the current scene to complete the addition of the target resource and make the resource utilization more flexible. , to improve the reuse of resources.
  • Step S214 Download the resource data package of the target resource from the server according to the download path in the resource configuration file, and load the downloaded resource data package in the current scene. Continue to execute step S215.
  • the resource data package of the target resource is downloaded and loaded from the server according to the download path in the resource configuration file to complete the addition of the target resource.
  • Step S215 completing the addition of the target resource.
  • the target configuration scene including the first scene, the second scene and the target resource is displayed.
  • the terminal application when the terminal application is installed or updated, the user clicks the icon of the terminal application, and the terminal application receives the instruction sent by the user to display the target configuration scene, and then displays the target configuration including the first scene, the second scene and the target resource. Scenes.
  • the terminal automatically displays the target configuration scene on the display interface after adding the first scene, the second scene and the target resource.
  • the embodiment of the present application adds different types of local scenes according to the scene configuration files of each local scene, so that each local scene in the target configuration scene can meet the planning needs of the user, and ensure that each local scene can present artistic effects to the user.
  • the embodiment of the present application also performs different loading operations based on different types of local scenes in the target configuration scene, and determines the addition of target resources according to the resource configuration file, so as to avoid the inability to meet the rich planning needs of users caused by the existence of only one scene at the same time.
  • the "Loading" interface frequently appears, resulting in poor user experience. It is convenient for users to flexibly configure scenes and resources and improve user experience.
  • the embodiment of the present application also avoids application and management problems caused by the coexistence of multiple scenarios of the same type. If you use multiple Unity-type scenes, there can only be one currently activated scene, and the inactive scene cannot be well used and managed. Another example is the use of multiple prefab types of scenes, the memory management in the switching scene is not as good as switching the unity type scene.
  • the embodiment of the present application solves the problem that the number or types of scenarios are too single and inflexible in the related art, it is convenient for users to dynamically configure related coexistence and mutual exclusion relationships, and it is convenient for users to use the current scenario in the current scenario. Dynamically switch information such as skyboxes, caremaps, and probes in .
  • FIG. 4 is a schematic structural diagram of a device for adding coexistence of multiple types of scenarios according to Embodiment 3 of the present application.
  • the device can be implemented by software and/or hardware, and can generally be integrated in a terminal, and can implement multi-type scene coexistence by executing the multi-type scene coexistence adding method, thereby improving the flexibility of the user's scene configuration.
  • the device includes:
  • the data packet obtaining module 301 is used to obtain the scene data packets of at least two partial scenes in the target configuration scene respectively, and the partial scenes include: a first scene of a shared display type and a second scene of an exclusive display type;
  • the first adding module 302 is configured to directly load the scene resources in the scene data package of the first scene in the first initial configuration scene matching the first scene, so as to complete the addition of the first scene in the target configuration scene;
  • the second adding module 303 is configured to use an exclusive display mode to load the scene resources in the scene data package of the second scene in the second initial configuration scene that matches the second scene, so as to complete the second scene in the target configuration scene 's addition.
  • An embodiment of the present application provides a device for adding multiple types of scenes to coexist.
  • a device for adding multiple types of scenes to coexist By separately acquiring scene data packets of at least two partial scenes in a target configuration scene, in a first initial configuration scene that matches the first scene of the shared display type , directly load the scene resources in the scene data package of the first scene, realize the addition of the first scene in the target configuration scene, and use the exclusive display in the second initial configuration scene that matches the second scene of the exclusive display type.
  • the scene resource in the scene data package of the second scene is loaded in the way of the second scene, so as to realize the addition of the second scene in the target configuration scene.
  • the embodiment of the present application adopts different adding methods to realize the coexistence of multiple types of scenes, which facilitates the user to flexibly configure the target configuration scene according to the planning requirements, and improves the user's flexibility in scene configuration. .
  • the data packet acquisition module 301 is specifically used for:
  • the scene configuration files of at least two partial scenes in the target configuration scene are respectively obtained, and corresponding scene data packages are downloaded from the server according to the download paths in each of the scene configuration files.
  • the data packet obtaining module 301 is further used for:
  • the type identifier of the partial scene is a preset shared display type identifier, it is determined that the partial scene is the first scene;
  • the type identifier of the partial scene is a preset exclusive display type identifier, it is determined that the partial scene is the second scene.
  • the second adding module 303 is specifically used for:
  • the loading method of the scene resource in the scene data packet is determined according to the key field in the scene data packet of the second scene; wherein , the key field is pre-set in the scenario data package by the user according to development requirements and operating environment.
  • the second adding module 303 is specifically used for:
  • the key field in the scene data package of the second scene is a preset switching field, unload the second initial configuration scene to obtain an empty scene, and load the scene data package of the second scene in the empty scene scene resources in ;
  • the key field in the scene data package of the second scene is a preset hidden field, load the scene resources in the scene data package of the second scene in the second initial configuration scene, and activate the second scene. scene and hide the second initial configuration scene.
  • the device further includes:
  • a resource acquisition module configured to acquire the resource configuration file of the target resource in the target configuration scene after completing the addition of the first scene in the target configuration scene and the addition of the second scene in the target configuration scene , query all resource packs in the running memory according to the download path in the resource configuration file;
  • a memory resource loading module configured to load the resource data package in the running memory in the current scene if the resource data package of the target resource exists in the running memory, so as to complete the addition of the target resource;
  • a resource download module configured to download the resource data package of the target resource from the server according to the download path in the resource configuration file if the resource data package of the target resource does not exist in the running memory, The downloaded resource data package is loaded in the current scene to complete the addition of the target resource.
  • the device further includes:
  • the scene display module is configured to display the target configuration scene including the first scene, the second scene and the target resource when receiving an instruction to display the target configuration scene sent by the user.
  • the first adding module 301 is specifically used for:
  • the category is judged according to the scene resources in the scene data package of the first scene, the scene resources of the same category are stored in the same sub-scene data package, and the scene resources of different categories are stored in different sub-scene data packages , respectively load the scene resources in each of the sub-scene data packages.
  • the second adding module is specifically used for:
  • the category is judged according to the scene resources in the scene data package of the second scene, the scene resources of the same category are stored in the same sub-scene data package, and the scene resources of different categories are stored in different sub-scene data packages , and respectively load the scene resources in each of the sub-scene data packages in the second initial configuration scene that matches the second scene.
  • the apparatus for adding coexistence of different types of scenarios provided by the embodiments of the present application can execute the method for adding coexistence of different types of scenarios provided by any embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution methods.
  • FIG. 5 is a schematic structural diagram of a terminal provided in Embodiment 4 of the present application.
  • the terminal includes a processor 400, a memory 401, an input device 402, and an output device 403; the number of processors 400 in the terminal may be One or more, one processor 400 is taken as an example in FIG. 5; the processor 400, memory 401, input device 402 and output device 403 in the terminal can be connected through a bus or other means, and the connection through a bus is taken as an example in FIG. 5 .
  • the memory 401 can be used to store software programs, computer-executable programs, and modules, such as program instructions and/or modules corresponding to the method for adding coexistence of multiple types of scenarios in the embodiments of the present application (for example, multiple The data packet acquisition module 301, the first adding module 302, and the second adding module 303 in the adding device of type scene coexistence).
  • the processor 400 executes various functional applications and data processing of the terminal by running the software programs, instructions and modules stored in the memory 401 , that is, implementing the above-mentioned method for adding coexistence of multiple types of scenarios.
  • the method includes:
  • the partial scenes include: a first scene of a shared display type and a second scene of an exclusive display type;
  • the scene resources in the scene data package of the second scene are loaded in the second initial configuration scene matching the second scene, so as to complete the addition of the second scene in the target configuration scene .
  • the memory 401 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like.
  • memory 401 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device.
  • the memory 401 may further include memory located remotely from the processor 400, and these remote memories may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • the input device 402 may be used to receive input numerical or character information, and generate key signal input related to user settings and function control of the terminal.
  • the output device 403 may include a display device such as a display screen.
  • Embodiment 5 of the present application further provides a storage medium containing computer-executable instructions, when the computer-executable instructions are executed by a computer processor for executing a multi-type scene coexistence addition method, the method includes:
  • the partial scenes include: a first scene of a shared display type and a second scene of an exclusive display type;
  • the scene resources in the scene data package of the second scene are loaded in the second initial configuration scene matching the second scene, so as to complete the addition of the second scene in the target configuration scene .
  • a storage medium containing computer-executable instructions provided by an embodiment of the present application the computer-executable instructions of the storage medium are not limited to the above-mentioned method operations, and can also execute the coexistence of multiple types of scenarios provided by any embodiment of the present application. Add related operations in the method.
  • the units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized. ;
  • the specific names of the functional units are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present application.

Abstract

An adding method and apparatus for coexistence of multiple types of scenarios, a terminal and a storage medium. The method comprises: separately acquiring scenario data packets of at least two partial scenarios in a target configuration scenario, the partial scenarios comprising: a first scenario of a shared display type and a second scenario of an exclusive display type (S101); in a first initial configuration scenario matching the first scenario, directly loading scenario resources in the scenario data packet of the first scenario to complete the addition of the first scenario in the target configuration scenario (S102); and in a second initial configuration scenario matching the second scenario, loading scenario resources in the scenario data packet of the second scenario in an exclusive display manner, to complete the addition of the second scenario in the target configuration scenario (S102). Different types of partial scenarios in a target configuration scenario are added in different ways, achieving the coexistence of multiple types of scenarios, helping a user in flexibly configuring a scenario according to planning needs, and improving the flexibility of scenario configuration.

Description

一种多类型场景共存的添加方法、装置、终端及存储介质A method, device, terminal and storage medium for adding multi-type scene coexistence
本申请要求在2020年11月19日提交中国专利局、申请号为202011303010.4的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application No. 202011303010.4 filed with the China Patent Office on November 19, 2020, the entire contents of which are incorporated herein by reference.
技术领域technical field
本申请实施例涉及计算机技术,尤其涉及一种多类型场景共存的添加方法、装置、终端及存储介质。The embodiments of the present application relate to computer technologies, and in particular, to a method, apparatus, terminal, and storage medium for adding coexistence of multiple types of scenarios.
背景技术Background technique
相关技术在场景的处理上通常采用两种方式,一种是无论何时同时只有一个场景存在,另一种是多个同类型场景共存。The related technology usually adopts two ways to process the scene, one is that only one scene exists at the same time at any time, and the other is that multiple scenes of the same type coexist.
然而,无论是第一种方式还是第二种方式,在场景的处理上数量或者类型上过于单一,用户无法灵活配置不同类型的场景,进而无法满足用户丰富的策划需求。因此,如何实现多类型的场景共存并提高用户对场景配置的灵活性成为亟待解决的技术问题。However, no matter it is the first method or the second method, the number or type of scene processing is too single, and the user cannot flexibly configure different types of scenes, and thus cannot meet the user's rich planning needs. Therefore, how to realize the coexistence of multiple types of scenarios and improve the flexibility of the user's configuration of scenarios has become an urgent technical problem to be solved.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种多类型场景共存的添加方法、装置、终端及存储介质,可以实现多类型的场景共存,提高用户对场景配置的灵活性。The embodiments of the present application provide a method, device, terminal, and storage medium for adding multiple types of scenarios to coexist, which can realize the coexistence of multiple types of scenarios and improve the flexibility of user configuration of scenarios.
第一方面,本申请实施例提供了一种多类型场景共存的添加方法,包括:In a first aspect, an embodiment of the present application provides a method for adding coexistence of multiple types of scenarios, including:
分别获取目标配置场景中至少两个局部场景的场景数据包,所述局部场景包括:共享显示类型的第一场景以及独占显示类型的第二场景;respectively acquiring scene data packets of at least two partial scenes in the target configuration scene, where the partial scenes include: a first scene of a shared display type and a second scene of an exclusive display type;
在与所述第一场景匹配的第一初始配置场景中,直接加载所述第一场景的场景数据包中的场景资源,以完成对所述目标配置场景中第一场景的添加;In the first initial configuration scene matching the first scene, directly loading the scene resources in the scene data package of the first scene to complete the addition of the first scene in the target configuration scene;
采用独占显示的方式,在与所述第二场景匹配的第二初始配置场景中加载所述第二场景的场景数据包中的场景资源,以完成对所述目标配置场景中第二场景的添加。In the mode of exclusive display, the scene resources in the scene data package of the second scene are loaded in the second initial configuration scene matching the second scene, so as to complete the addition of the second scene in the target configuration scene .
第二方面,本申请实施例还提供了一种不同类型场景共存的添加装置,包括:In a second aspect, an embodiment of the present application further provides a device for adding coexistence of different types of scenarios, including:
数据包获取模块,用于分别获取目标配置场景中至少两个局部场景的场景数据包,所述局部场景包括:共享显示类型的第一场景以及独占显示类型的第 二场景;a data packet acquisition module, configured to acquire scene data packets of at least two local scenes in the target configuration scene respectively, and the local scenes include: a first scene of a shared display type and a second scene of an exclusive display type;
第一添加模块,用于在与第一场景匹配的第一初始配置场景中,直接加载第一场景的场景数据包中的场景资源,以完成对目标配置场景中第一场景的添加;a first adding module, configured to directly load the scene resources in the scene data package of the first scene in the first initial configuration scene matching the first scene, so as to complete the addition of the first scene in the target configuration scene;
第二添加模块,用于采用独占显示的方式,在与第二场景匹配的第二初始配置场景中加载第二场景的场景数据包中的场景资源,以完成对目标配置场景中第二场景的添加。The second adding module is used to load the scene resources in the scene data package of the second scene in the second initial configuration scene that matches the second scene in the mode of exclusive display, so as to complete the second scene in the target configuration scene. Add to.
第三方面,本申请实施例还提供了一种终端,所述终端包括:In a third aspect, an embodiment of the present application further provides a terminal, where the terminal includes:
一个或多个处理器;one or more processors;
存储器,用于存储一个或多个程序,memory for storing one or more programs,
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如本申请任意实施例提供的多类型场景共存的添加方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the method for adding coexistence of multiple types of scenarios provided by any embodiment of the present application.
第四方面,本申请实施例还提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如本申请任意实施例提供的多类型场景共存的添加方法。In a fourth aspect, the embodiments of the present application further provide a storage medium containing computer-executable instructions, when the computer-executable instructions are executed by a computer processor for executing the coexistence of multiple types of scenarios as provided by any embodiment of the present application method of adding.
本申请实施例通过分别获取目标配置场景中至少两个局部场景的场景数据包,在与共享显示类型的第一场景匹配的第一初始配置场景中,直接对第一场景的场景数据包中的场景资源进行加载,实现对目标配置场景中第一场景的添加,在与独占显示类型的第二场景匹配的第二初始配置场景中,采用独占显示的方式对第二场景的场景数据包中的场景资源进行加载,实现对目标配置场景中第二场景的添加。本申请实施例基于目标配置场景中不同类型的局部场景,分别采用不同的添加方式,实现了多类型的场景共存,便于用户根据策划需求灵活配置目标配置场景,提高了用户对场景配置的灵活性。In this embodiment of the present application, by separately acquiring the scene data packets of at least two local scenes in the target configuration scene, in the first initial configuration scene that matches the first scene of the shared display type, directly compare the scene data packets of the first scene The scene resources are loaded to realize the addition of the first scene in the target configuration scene. In the second initial configuration scene that matches the second scene of the exclusive display type, the exclusive display method is used to display the scene data package of the second scene. The scene resource is loaded to realize the addition of the second scene in the target configuration scene. Based on different types of local scenes in the target configuration scene, the embodiment of the present application adopts different adding methods to realize the coexistence of multiple types of scenes, which facilitates the user to flexibly configure the target configuration scene according to planning requirements, and improves the flexibility of the user to configure the scene. .
附图说明Description of drawings
图1是本申请实施例一提供的一种多类型场景共存的添加方法的流程图;FIG. 1 is a flowchart of a method for adding coexistence of multiple types of scenarios provided by Embodiment 1 of the present application;
图2是本申请实施例二提供的另一种多类型场景共存的添加方法的流程图;2 is a flowchart of another method for adding multi-type scene coexistence provided by Embodiment 2 of the present application;
图3是本申请实施例二提供的一种添加不同类型局部场景的方法的工作流程图;3 is a work flow diagram of a method for adding different types of local scenes provided in Embodiment 2 of the present application;
图4是本申请实施例三提供的一种多类型场景共存的添加装置的结构示意图;FIG. 4 is a schematic structural diagram of a multi-type scene coexistence adding apparatus provided in Embodiment 3 of the present application;
图5是本申请实施例四提供的一种终端的结构示意图。FIG. 5 is a schematic structural diagram of a terminal according to Embodiment 4 of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all the structures related to the present application.
另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部内容。在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。In addition, it should be noted that, for the convenience of description, the drawings only show some but not all of the contents related to the present application. Before discussing the exemplary embodiments in greater detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts various operations (or steps) as a sequential process, many of the operations may be performed in parallel, concurrently, or concurrently. Additionally, the order of operations can be rearranged. The process may be terminated when its operation is complete, but may also have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, subroutines, and the like.
实施例一Example 1
图1是本申请实施例一提供的一种多类型场景共存的添加方法的流程图,本实施例可适用于在初始配置场景基础上添加多类型场景的情况,该方法可以由多类型场景共存的添加装置来执行,该装置可以采用软件和/或硬件的方式实现。该装置可配置于终端中。如图1所示,该方法包括:FIG. 1 is a flowchart of a method for adding multiple types of scenarios to coexist according to the first embodiment of the present application. This embodiment is applicable to the situation where multiple types of scenarios are added on the basis of the initial configuration scenario. The device can be implemented by adding an additional device, and the device can be implemented in software and/or hardware. The device may be configured in a terminal. As shown in Figure 1, the method includes:
步骤S101、分别获取目标配置场景中至少两个局部场景的场景数据包,局部场景包括:共享显示类型的第一场景以及独占显示类型的第二场景。Step S101 , respectively acquiring scene data packets of at least two partial scenes in the target configuration scene, where the partial scenes include: a first scene of a shared display type and a second scene of an exclusive display type.
目标配置场景可以是在当前终端应用中基于初始配置场景构建的虚拟现实场景,可以在当前终端通过显示设备向用户呈现。其中,终端应用可以是在终端设备上运行的应用,例如,手机、可穿戴设备、平板电脑或计算机等终端设备上运行的游戏或影音播放应用等。显示设备可以是具有显示功能的设备,例如,手机、平板电脑或计算机的显示屏幕或可头戴设备的头戴式立体显示器等。初始配置场景可以是与目标配置场景对应的初始场景。例如,初始配置场景可以是在更新当前终端应用之前当前终端应用中的初始虚拟现实场景、在安装当前终端应用时配置的空场景,或者用户在终端应用的显示界面执行变更操作之前的初始显示场景。The target configuration scene may be a virtual reality scene constructed based on the initial configuration scene in the current terminal application, and may be presented to the user on the current terminal through a display device. The terminal application may be an application running on a terminal device, for example, a game or an audio and video playback application running on a terminal device such as a mobile phone, a wearable device, a tablet computer, or a computer. The display device may be a device with a display function, for example, a display screen of a mobile phone, a tablet computer or a computer, or a head-mounted stereoscopic display of a head-mounted device, and the like. The initial configuration scenario may be an initial scenario corresponding to the target configuration scenario. For example, the initial configuration scene may be an initial virtual reality scene in the current terminal application before updating the current terminal application, an empty scene configured when the current terminal application is installed, or an initial display scene before the user performs a change operation on the display interface of the terminal application .
目标配置场景中可以包括至少两个局部场景。例如,目标配置场景可以是用于在整个显示设备上显示的场景,根据实际需求将整个场景划分为不同的区域,每个区域可以作为一个局部场景,以供用户可以对各个局部场景进行单独设计。The target configuration scene may include at least two partial scenes. For example, the target configuration scene can be a scene for displaying on the entire display device, the entire scene is divided into different areas according to actual needs, and each area can be used as a partial scene, so that the user can design each partial scene individually .
所有局部场景可以分为两种类型,一种是共享显示类型的第一场景,另一 种是独占显示类型的第二场景。其中,共享显示类型的第一场景可以是与初始配置场景共同存在的虚拟现实场景,独占显示类型的第二场景可以是无法与初始配置场景互斥,且两者中只能同时存在一个的虚拟现实场景。例如,对于游戏引擎(unity)类型的初始3D配置场景,若在该初始3D配置场景中添加第一场景,则该第一场景可以是预制件(prefab)类型的场景,prefab类型的场景可以在unity类型的场景基础上直接添加。若在该初始3D配置场景中添加第二场景,则该第二场景可以是unity类型的场景,unity类型的场景无法直接在相同的unity类型的场景基础上进行添加,可以通过独占显示的方式进行添加。All partial scenes can be divided into two types, one is the first scene of shared display type, and the other is the second scene of exclusive display type. The first scene of the shared display type may be a virtual reality scene that coexists with the initial configuration scene, and the second scene of the exclusive display type may be a virtual reality scene that cannot be mutually exclusive with the initial configuration scene, and only one of the two can exist at the same time. realistic scene. For example, for an initial 3D configuration scene of the game engine (unity) type, if a first scene is added to the initial 3D configuration scene, the first scene can be a prefab type scene, and the prefab type scene can be found in It is added directly on the basis of the unity type scene. If a second scene is added to the initial 3D configuration scene, the second scene can be a Unity type scene. The Unity type scene cannot be directly added on the basis of the same Unity type scene, but can be displayed by means of exclusive display. Add to.
场景数据包可以是包含局部场景中场景配置数据的数据包,可以从服务器中下载得到或从运行内存中获取得到。The scene data package may be a data package containing scene configuration data in the local scene, and may be downloaded from the server or obtained from the running memory.
示例性地,目标配置场景A中包含局部场景A1、A2、A3和A4,分别获取局部场景A1、A2、A3和A4的场景数据包,其中,A1和A2是prefab类型的第一场景,A3和A4是unity类型的第二场景。Exemplarily, the target configuration scene A includes partial scenes A1, A2, A3, and A4, and the scene data packets of the partial scenes A1, A2, A3, and A4 are obtained respectively, wherein A1 and A2 are the first scene of the prefab type, and A3 and A4 is the second scene of unity type.
步骤S102、在与第一场景匹配的第一初始配置场景中,直接加载第一场景的场景数据包中的场景资源,以完成对目标配置场景中第一场景的添加。Step S102: In the first initial configuration scene matching the first scene, directly load the scene resources in the scene data package of the first scene to complete the addition of the first scene in the target configuration scene.
第一初始配置场景是初始配置场景中与第一场景匹配的场景。第一初始配置场景的场景类型可以是空场景类型或独占显示类型。需要说明的是,对于独占显示类型的第一初始配置场景,可以在第一初始配置场景中直接添加共享显示类型的第一场景,第一场景的场景数据包中的场景资源可以直接在第一初始配置场景中进行加载。例如,第一初始配置场景是unity类型的场景,第一场景是prefab类型的场景,在unity类型的场景中可以直接添加prefab类型的场景。The first initial configuration scenario is a scenario matching the first scenario in the initial configuration scenario. The scene type of the first initial configuration scene may be an empty scene type or an exclusive display type. It should be noted that, for the first initial configuration scene of the exclusive display type, the first scene of the shared display type can be directly added in the first initial configuration scene, and the scene resources in the scene data package of the first scene can be directly added in the first initial configuration scene. Loading in the initial configuration scene. For example, the first initial configuration scene is a unity type scene, the first scene is a prefab type scene, and a prefab type scene can be directly added to the unity type scene.
场景数据包中的场景资源可以是局部场景可能涉及的各种模型资源。例如,场景资源可以是人物、动物、建筑、植物、山川、河流或工具等3D模型资源。通过在第一初始配置场景中,直接加载第一场景的场景数据包中的场景资源,实现对第一场景中所有场景资源的添加,进而完成对目标配置场景中第一场景的添加。The scene resources in the scene data package can be various model resources that may be involved in the local scene. For example, scene resources can be 3D model resources such as characters, animals, buildings, plants, mountains, rivers, or tools. By directly loading the scene resources in the scene data package of the first scene in the first initial configuration scene, all scene resources in the first scene are added, and the addition of the first scene in the target configuration scene is completed.
若与第一场景匹配的第一初始配置场景是空场景,则直接加载第一场景的场景数据包中的场景资源之后得到的当前场景就是第一场景。若与第一场景匹配的第一初始配置场景是独占显示类型的场景,则直接加载之后得到的当前场景,就是第一初始配置场景与第一场景的场景资源的结合。If the first initial configuration scene matching the first scene is an empty scene, the current scene obtained after directly loading the scene resources in the scene data package of the first scene is the first scene. If the first initial configuration scene matching the first scene is an exclusive display type scene, the current scene obtained after direct loading is the combination of the first initial configuration scene and the scene resources of the first scene.
可选地,直接加载第一场景的场景数据包中的场景资源,包括:Optionally, directly load the scene resources in the scene data package of the first scene, including:
根据第一场景的场景数据包中的场景资源进行类别判断,将相同类别的场景资源存入到同一个子场景数据包中,将不同类别的场景资源存入到不同的子 场景数据包中,分别加载各个子场景数据包中的场景资源。The category is judged according to the scene resources in the scene data package of the first scene, and the scene resources of the same category are stored in the same sub-scene data package, and the scene resources of different categories are stored in different sub-scene data packages, respectively. Load the scene resources in each sub-scene data package.
将相同类别的场景资源存入到同一个子场景数据包中,例如,第一场景的场景数据包中含有多个植物,这些植物均采用同一模型进行配置,则可以确定这些植物属于相同类别的场景资源,通过将该模型存入子场景数据包中,可以实现节约存储空间。将不同类别的场景资源存入到不同的子场景数据包中,例如,第一场景的场景数据包中还可以含有除植物之外的昆虫,分别将植物所属模型和昆虫存入到不同的子场景数据包中,并分别进行加载,可以实现将场景资源进行合理的分配,在加载过程中提高加载速度。Save scene resources of the same category into the same sub-scene data package. For example, if the scene data package of the first scene contains multiple plants, and these plants are configured with the same model, it can be determined that these plants belong to the same category of scenes resources, and by storing the model in the sub-scene data package, storage space can be saved. Store different types of scene resources into different sub-scene data packages. For example, the scene data package of the first scene can also contain insects other than plants, and the models to which plants belong and insects are stored in different sub-scenarios. In the scene data package, and load them separately, the scene resources can be allocated reasonably, and the loading speed can be improved during the loading process.
步骤S103、采用独占显示的方式,在与第二场景匹配的第二初始配置场景中加载第二场景的场景数据包中的场景资源,以完成对目标配置场景中第二场景的添加。Step S103 , in an exclusive display manner, load the scene resources in the scene data package of the second scene in the second initial configuration scene matching the second scene, so as to complete the addition of the second scene in the target configuration scene.
第二初始配置场景是初始配置场景中与第二场景匹配的场景。第二初始配置场景的场景类型可以是空场景类型或独占显示类型。需要说明的是,对于独占显示类型的第二初始配置场景,无法直接在第二初始配置场景中直接添加独占显示类型的第二场景,第二初始配置场景和第二场景中只能同时存在一个场景独占显示。例如,第二初始配置场景是unity类型的场景,第二场景也是unity类型的场景,若需要在第二初始配置场景中添加第二场景,则只能采用独占显示的方式,即两者只能存在一个场景独占显示,另一个场景无法显示。The second initial configuration scenario is a scenario matching the second scenario in the initial configuration scenario. The scene type of the second initial configuration scene may be an empty scene type or an exclusive display type. It should be noted that, for the second initial configuration scene of the exclusive display type, the second scene of the exclusive display type cannot be directly added to the second initial configuration scene, and only one of the second initial configuration scene and the second scene can exist at the same time. The scene is displayed exclusively. For example, the second initial configuration scene is a unity type scene, and the second scene is also a unity type scene. If you need to add a second scene to the second initial configuration scene, you can only use the exclusive display method, that is, the two can only be displayed. There is one scene that is displayed exclusively and another scene cannot be displayed.
独占显示的方式可以是只有第二场景处于激活状态,第二初始配置场景处于隐藏状态。或者,独占显示的方式还可以是只有第二场景显示,在第二初始配置场景上添加遮挡层,以使第二初始配置场景不显示。或者,独占显示的方式还可以是卸载第二初始配置场景,只保留第二场景。或者其他可以使第二场景独占显示的方式,本申请对此不作具体限定。The way of exclusive display may be that only the second scene is in an active state, and the second initial configuration scene is in a hidden state. Alternatively, the manner of exclusive display may also be that only the second scene is displayed, and an occlusion layer is added on the second initial configuration scene, so that the second initial configuration scene is not displayed. Alternatively, the manner of exclusive display may also be to uninstall the second initial configuration scene and retain only the second scene. Or other manners in which the second scene can be exclusively displayed, which is not specifically limited in this application.
若与第二场景匹配的第二初始配置场景是空场景,则直接加载第二场景的场景数据包中的场景资源之后得到的当前场景就是第二场景。若与第二场景匹配的第二初始配置场景是独占显示类型的场景,则采用独占显示的方式加载之后得到的当前场景也是第二场景。If the second initial configuration scene matching the second scene is an empty scene, the current scene obtained after directly loading the scene resources in the scene data package of the second scene is the second scene. If the second initial configuration scene that matches the second scene is an exclusive display type scene, the current scene obtained after loading in the exclusive display mode is also the second scene.
可选地,在与第二场景匹配的第二初始配置场景中加载第二场景的场景数据包中的场景资源,包括:Optionally, loading the scene resources in the scene data package of the second scene in the second initial configuration scene matching the second scene, including:
根据第二场景的场景数据包中的场景资源进行类别判断,将相同类别的场景资源存入到同一个子场景数据包中,将不同类别的场景资源存入到不同的子场景数据包中,在与第二场景匹配的第二初始配置场景中分别加载各个子场景数据包中的场景资源。The category is judged according to the scene resources in the scene data package of the second scene, and the scene resources of the same category are stored in the same sub-scene data package, and the scene resources of different categories are stored in different sub-scene data packages. The scene resources in each sub-scene data package are respectively loaded in the second initial configuration scene matching the second scene.
例如,第二场景的场景数据包中含有多个麦田,这些麦田的属性均相同,则可以确定这些麦田属于相同类别的场景资源,通过将一个麦田存入子场景数据包中,可以实现节约存储空间。第二场景的场景数据包中还可以含有除麦田之外的房屋,分别将麦田和房屋存入到不同的子场景数据包中,并分别进行加载,可以实现将场景资源进行合理的分配,在加载过程中提高加载速度。For example, if the scene data package of the second scene contains multiple wheat fields, and the attributes of these wheat fields are the same, it can be determined that these wheat fields belong to the same category of scene resources. By storing a wheat field in the sub-scenario data package, it is possible to save storage. space. The scene data package of the second scene can also contain houses other than wheat fields. The wheat fields and houses are stored in different sub-scenario data packages and loaded separately, which can realize the reasonable allocation of scene resources. Improve loading speed during loading.
需要说明的是,步骤S102和步骤S103不限于上述并行执行顺序,本申请实施例还可以在步骤S101之后,先执行步骤S102后执行步骤S103。或者,还可以在步骤S101之后,先执行步骤S103后执行步骤S102。本申请对此不作具体限定。It should be noted that, step S102 and step S103 are not limited to the above-mentioned parallel execution sequence. In this embodiment of the present application, step S102 may be executed first and then step S103 may be executed after step S101. Alternatively, after step S101, step S103 may be performed first and then step S102 may be performed. This application does not specifically limit this.
本申请实施例通过分别获取目标配置场景中至少两个局部场景的场景数据包,在与共享显示类型的第一场景匹配的第一初始配置场景中,直接对第一场景的场景数据包中的场景资源进行加载,实现对目标配置场景中第一场景的添加,在与独占显示类型的第二场景匹配的第二初始配置场景中,采用独占显示的方式对第二场景的场景数据包中的场景资源进行加载,实现对目标配置场景中第二场景的添加。本申请实施例基于目标配置场景中不同类型的局部场景,分别采用不同的添加方式,实现了多类型的场景共存,便于用户根据策划需求灵活配置目标配置场景,提高了用户对场景配置的灵活性。In this embodiment of the present application, by separately acquiring the scene data packets of at least two local scenes in the target configuration scene, in the first initial configuration scene that matches the first scene of the shared display type, directly compare the scene data packets of the first scene The scene resources are loaded to realize the addition of the first scene in the target configuration scene. In the second initial configuration scene that matches the second scene of the exclusive display type, the exclusive display method is used to display the scene data package of the second scene. The scene resource is loaded to realize the addition of the second scene in the target configuration scene. Based on different types of local scenes in the target configuration scene, the embodiment of the present application adopts different adding methods to realize the coexistence of multiple types of scenes, which facilitates the user to flexibly configure the target configuration scene according to the planning requirements, and improves the user's flexibility in scene configuration. .
实施例二Embodiment 2
图2是本申请实施例二提供的另一种多类型场景共存的添加方法的流程图,本实施例在上述实施例的基础上进行优化,如图2所示,该方法包括:FIG. 2 is a flowchart of another method for adding coexistence of multiple types of scenarios provided in Embodiment 2 of the present application. This embodiment is optimized on the basis of the above-mentioned embodiment. As shown in FIG. 2 , the method includes:
步骤S201、分别获取目标配置场景中至少两个局部场景的场景配置文件,根据各个场景配置文件中的下载路径从服务器下载对应的场景数据包,局部场景包括:共享显示类型的第一场景以及独占显示类型的第二场景。Step S201: Obtain scene configuration files of at least two local scenes in the target configuration scene respectively, download the corresponding scene data package from the server according to the download path in each scene configuration file, and the local scenes include: the first scene of the shared display type and the exclusive scene Second scene of display type.
场景配置文件可以是由用户根据场景的策划需求编写的配置文件。用户能够根据实际对目标配置场景中各个局部场景的策划需求,分别为各个局部场景编写场景配置文件。由于局部场景可以包括共享显示类型的第一场景以及独占显示类型的第二场景,用户能够针对不同类型的场景编写不同的场景配置文件,以实现多类型的场景添加,能够更加满足用户的策划需求。例如,图3是本申请实施例二提供的一种添加不同类型局部场景的方法的工作流程图,如图3所示,在添加局部场景时,根据不同局部场景的场景类型确定不同的添加操作,局部场景的场景类型可以包括unity类型和prefab类型。The scenario configuration file may be a configuration file written by the user according to the planning requirements of the scenario. Users can write scene configuration files for each local scene according to the actual planning requirements of each local scene in the target configuration scene. Since the partial scene can include the first scene of the shared display type and the second scene of the exclusive display type, the user can write different scene configuration files for different types of scenes, so as to realize the addition of multiple types of scenes, which can better meet the user's planning needs . For example, FIG. 3 is a workflow diagram of a method for adding different types of local scenes provided in Embodiment 2 of the present application. As shown in FIG. 3 , when adding a local scene, different adding operations are determined according to the scene types of different local scenes , the scene type of the local scene can include unity type and prefab type.
终端可以根据各个场景配置文件中的下载路径向服务器发送数据包下载请求。服务器在接收到数据包下载请求时,根据数据包获取请求中的下载路径将 对应的场景数据包发送给终端。终端接收服务器发送的场景数据包。The terminal can send a data package download request to the server according to the download path in each scenario configuration file. When receiving the data package download request, the server sends the corresponding scene data package to the terminal according to the download path in the data package acquisition request. The terminal receives the scene data packet sent by the server.
可替换地,根据各个场景配置文件中的下载路径从运行内存中获取对应的场景数据包。Alternatively, the corresponding scene data package is obtained from the running memory according to the download path in each scene configuration file.
具体地,本申请实施例还可以根据各个场景配置文件中的下载路径查询运行内存,若运行内存中具有对应的场景数据包,则直接从运行内存中获取对应的场景数据包,若运行内存中没有对应的场景数据包,则从服务器下载获得。例如,在不停机更新当前终端应用的情景下,运行内存中已存在场景数据包,则直接获取,若运行内存中不存在场景数据包,则根据各个场景配置文件中的下载路径从服务器下载获得。或者,用户在终端应用的显示界面上点击对局部场景A的添加场景按钮,客户端接收到A的添加场景按钮触发的场景添加请求时,根据A的场景配置文件中的下载路径从运行内存中查询对应的场景数据包,若运行内存中存在,则直接复用对应的场景数据包,若不存在则根据A的场景配置文件中的下载路径从服务器下载。Specifically, in this embodiment of the present application, the running memory can also be queried according to the download path in each scene configuration file. If there is a corresponding scene data package in the running memory, the corresponding scene data package is directly obtained from the running memory. If there is no corresponding scene data package, download it from the server. For example, in the scenario of updating the current terminal application without stopping, if the scene data package already exists in the running memory, it will be obtained directly. If the scene data package does not exist in the running memory, it will be downloaded from the server according to the download path in each scene configuration file. . Or, the user clicks the add scene button for the local scene A on the display interface of the terminal application, and when the client receives the scene add request triggered by the add scene button of A, it will download the scene from the running memory according to the download path in the scene configuration file of A. Query the corresponding scene data package. If it exists in the running memory, the corresponding scene data package is directly reused. If it does not exist, it is downloaded from the server according to the download path in the scene configuration file of A.
可选地,在分别获取目标配置场景中至少两个局部场景的场景配置文件之后,还包括:Optionally, after acquiring the scene configuration files of at least two local scenes in the target configuration scene respectively, the method further includes:
从各个场景配置文件中获取各个局部场景的类型标识;Obtain the type identifier of each local scene from each scene configuration file;
对于每一个局部场景,若局部场景的类型标识是预设共享显示类型标识,则确定局部场景是第一场景;For each local scene, if the type identifier of the local scene is the preset shared display type identifier, it is determined that the local scene is the first scene;
若局部场景的类型标识是预设独占显示类型标识,则确定局部场景是第二场景。If the type identifier of the partial scene is the preset exclusive display type identifier, it is determined that the partial scene is the second scene.
类型标识可以用于标识局部场景的场景类型,可以包括预设共享显示类型标识和预设独占显示类型标识。例如,由用户根据局部场景的场景类型,预先在场景配置文件中设置各个局部场景的类型标识,预设共享显示类型标识可以设置为0,预设独占显示类型标识可以设置为1。The type identifier may be used to identify the scene type of the local scene, and may include a preset shared display type identifier and a preset exclusive display type identifier. For example, the user pre-sets the type identifier of each local scene in the scene configuration file according to the scene type of the local scene, the preset shared display type identifier may be set to 0, and the preset exclusive display type identifier may be set to 1.
对于每一个局部场景,根据场景配置文件中的类型标识确定局部场景是第一场景还是第二场景,实现了自动区分各类型场景,并根据不同类型的局部场景执行不同的添加操作,使每个局部场景都能够达到用户的策划需求。For each local scene, it is determined whether the local scene is the first scene or the second scene according to the type identifier in the scene configuration file, which realizes automatic distinction of various types of scenes, and performs different adding operations according to different types of local scenes, so that each Local scenes can meet the planning needs of users.
步骤S202、在与第一场景匹配的第一初始配置场景中,直接加载第一场景的场景数据包中的场景资源。然后执行步骤S203。Step S202: In the first initial configuration scene matching the first scene, directly load the scene resources in the scene data package of the first scene. Then step S203 is executed.
例如,图3中对于prefab类型的局部场景直接加载局部场景的场景资源。For example, in FIG. 3, the scene resources of the partial scene are directly loaded for the partial scene of the prefab type.
步骤S203、完成对目标配置场景中第一场景的添加。继续执行步骤S211。Step S203, completing the addition of the first scene in the target configuration scene. Continue to execute step S211.
步骤S204、判断与第二场景匹配的第二初始配置场景的场景类型是空场景 类型还是独占显示类型,若是空场景类型,执行步骤S205,若是独占显示类型,执行步骤S206。Step S204, judging whether the scene type of the second initial configuration scene matching the second scene is an empty scene type or an exclusive display type, if it is an empty scene type, go to step S205, if it is an exclusive display type, go to step S206.
第二初始配置场景的场景类型可以通过获取终端应用的初始配置文件中的类型标识确定。The scenario type of the second initial configuration scenario may be determined by acquiring the type identifier in the initial configuration file of the terminal application.
步骤S205、直接加载第二场景的场景数据包中的场景资源。继续执行步骤S210。Step S205, directly loading the scene resources in the scene data package of the second scene. Continue to perform step S210.
对于第二初始配置场景是空场景的情况,可以直接在该空场景中加载第二场景的场景数据包中的场景资源。In the case where the second initial configuration scene is an empty scene, the scene resources in the scene data package of the second scene may be directly loaded in the empty scene.
步骤S206、根据第二场景的场景数据包中的关键字段确定场景数据包中的场景资源的加载方式。继续执行步骤S207。Step S206: Determine the loading method of the scene resource in the scene data package according to the key field in the scene data package of the second scene. Continue to execute step S207.
其中,关键字段由用户根据开发需求和运行环境预先在场景数据包中设置。例如,关键字段可以包括预设切换字段和预设隐藏字段。Among them, the key fields are pre-set in the scene data package by the user according to the development requirements and the running environment. For example, key fields may include preset toggle fields and preset hidden fields.
对于第二初始配置场景是独占显示类型场景的情况,可以根据第二场景的场景数据包中的关键字段,确定场景数据包中的场景资源的加载方式。便于用户根据实际的开发需求灵活配置场景资源的加载方式,提高了用户对场景配置的灵活性。In the case where the second initial configuration scene is an exclusive display type scene, the loading method of the scene resource in the scene data package may be determined according to the key field in the scene data package of the second scene. It is convenient for users to flexibly configure the loading method of scene resources according to actual development requirements, which improves the flexibility of users in scene configuration.
步骤S207、判断第二场景的场景数据包中的关键字段是预设切换字段还是预设隐藏字段,若是预设切换字段,执行步骤S208,若是预设隐藏字段,执行步骤S209。Step S207, judging whether the key field in the scene data packet of the second scene is a preset switching field or a preset hidden field, if it is a preset switching field, go to step S208, if it is a preset hidden field, go to step S209.
例如,在图3中可以根据关键字段判断是否需要卸载原所有场景,若需要,则可以执行步骤S208,若不需要,则可以执行步骤S209。For example, in FIG. 3 , it can be determined whether all the original scenes need to be uninstalled according to the key field. If necessary, step S208 may be performed, and if not, step S209 may be performed.
步骤S208、卸载第二初始配置场景,得到空场景,在空场景中加载第二场景的场景数据包中的场景资源。继续执行步骤S210。Step S208: Unload the second initial configuration scene to obtain an empty scene, and load the scene resources in the scene data package of the second scene in the empty scene. Continue to perform step S210.
具体地,当第二场景的场景数据包中的关键字段是预设切换字段时,删除第二初始配置场景中的所有场景资源,得到空场景,在该空场景中加载第二场景的场景数据包中的场景资源。Specifically, when the key field in the scene data packet of the second scene is the preset switching field, delete all scene resources in the second initial configuration scene to obtain an empty scene, and load the scene of the second scene in the empty scene Scene resources in the package.
例如,如图3所示,局部场景是第二场景,第二初始配置场景和第二场景均为unity类型场景,用户的开发需求是在一些特定的环节将第二初始配置场景切换为第二场景,则卸载原有unity类型场景,并优先切换到空场景,再以加载单个unity类型场景的方式加载第二场景,以切换到第二场景,能够减轻内存压力,且避免在切换场景过程中频繁出现“加载中”的界面。For example, as shown in Figure 3, the local scene is the second scene, the second initial configuration scene and the second scene are both unity type scenes, and the user's development requirement is to switch the second initial configuration scene to the second scene in some specific links scene, unload the original unity type scene, and switch to the empty scene first, and then load the second scene in the way of loading a single unity type scene to switch to the second scene, which can reduce the memory pressure and avoid the process of switching scenes. The "Loading" interface appears frequently.
步骤S209、在第二初始配置场景中加载第二场景的场景数据包中的场景资 源,激活第二场景并隐藏第二初始配置场景。继续执行步骤S210。Step S209: Load the scene resource in the scene data package of the second scene in the second initial configuration scene, activate the second scene and hide the second initial configuration scene. Continue to perform step S210.
具体地,当第二场景的场景数据包中的关键字段是预设隐藏字段时,在第二初始配置场景中加载第二场景的场景数据包中的场景资源,将第二场景的状态设置为激活状态,将第二初始配置场景的状态设置为隐藏状态,即未激活状态,以使当前激活的场景只有一个。Specifically, when the key field in the scene data package of the second scene is a preset hidden field, load the scene resources in the scene data package of the second scene in the second initial configuration scene, and set the state of the second scene to For the activation state, the state of the second initial configuration scene is set to a hidden state, that is, an inactive state, so that there is only one currently activated scene.
例如,如图3所示,局部场景是第二场景,第二初始配置场景和第二场景均为unity类型场景,用户的开发需求是在一些特定的环节将第二初始配置场景隐藏,使得当前局部场景仅显示第二场景,则以叠加的方式加载第二场景。For example, as shown in Figure 3, the local scene is the second scene, the second initial configuration scene and the second scene are both unity type scenes, and the user's development requirement is to hide the second initial configuration scene in some specific links, so that the current If only the second scene is displayed in the partial scene, the second scene is loaded in a superimposed manner.
步骤S210、完成对目标配置场景中第二场景的添加。继续执行步骤S211。Step S210, completing the addition of the second scene in the target configuration scene. Continue to execute step S211.
需要说明的是,步骤S202至步骤S210的执行顺序并不限于本申请实施例中图2提供的执行顺序。还可以是先执行步骤S202至步骤S203,然后执行步骤S204至步骤S210,然后继续执行步骤S211。或者,先执行步骤S204至步骤S210,然后执行步骤S202至步骤S203,然后继续执行步骤S211。本申请对此不作具体限定。It should be noted that, the execution sequence of steps S202 to S210 is not limited to the execution sequence provided in FIG. 2 in the embodiment of the present application. It is also possible to perform steps S202 to S203 first, then perform steps S204 to S210, and then continue to perform step S211. Alternatively, first perform steps S204 to S210, then perform steps S202 to S203, and then continue to perform step S211. This application does not specifically limit this.
步骤S211、获取目标配置场景中目标资源的资源配置文件,根据资源配置文件中的下载路径查询运行内存中所有资源包。Step S211 , acquiring the resource configuration file of the target resource in the target configuration scene, and querying all resource packages in the running memory according to the download path in the resource configuration file.
目标资源可以是与场景相关的资源,例如,天空盒、关照贴图和探针等。目标资源的资源配置文件可以是由用户根据与场景相关的资源的策划需求编写的配置文件。用户能够根据实际对目标配置场景中所有目标资源的策划需求,分别为各个局部场景的目标资源编写场景配置文件,或者为整个目标配置场景编写场景配置文件。Target assets can be scene-related assets such as skyboxes, caremaps, and probes. The resource configuration file of the target resource may be a configuration file written by the user according to the planning requirements of the resource related to the scene. According to the actual planning requirements for all target resources in the target configuration scene, the user can write scene configuration files for the target resources of each partial scene, or write scene configuration files for the entire target configuration scene.
在当前场景中添加目标资源可以是在步骤S203中完成第一场景和步骤S210中完成第二场景添加之后添加目标资源,或者直接在初始配置场景中直接添加目标资源,或者在其他时刻添加目标资源。Adding the target resource in the current scene may be adding the target resource after completing the first scene in step S203 and the second scene in step S210, or directly adding the target resource in the initial configuration scene, or adding the target resource at other times .
步骤S212、判断运行内存中是否存在目标资源的资源数据包,若是,执行步骤S213,否则执行步骤S214。Step S212 , judging whether there is a resource data package of the target resource in the running memory, if yes, go to step S213 , otherwise go to step S214 .
资源数据包可以是包含目标资源中资源配置数据的数据包,可以从服务器中下载得到或从运行内存中获取得到。The resource data package can be a data package containing resource configuration data in the target resource, and can be downloaded from the server or obtained from the running memory.
步骤S213、在当前场景中加载运行内存中的资源数据包。继续执行步骤S215。Step S213: Load the resource data package in the running memory in the current scene. Continue to execute step S215.
具体地,若运行内存中存在目标资源的资源数据包,则直接复用该资源数据包,在当前场景中加载运行内存中的资源数据包,以完成对目标资源的添加, 使得资源运用更加灵活,提高资源的复用性。Specifically, if there is a resource data package of the target resource in the running memory, the resource data package is directly reused, and the resource data package in the running memory is loaded in the current scene to complete the addition of the target resource and make the resource utilization more flexible. , to improve the reuse of resources.
步骤S214、根据资源配置文件中的下载路径从服务器下载目标资源的资源数据包,在当前场景中加载下载的资源数据包。继续执行步骤S215。Step S214: Download the resource data package of the target resource from the server according to the download path in the resource configuration file, and load the downloaded resource data package in the current scene. Continue to execute step S215.
具体地,若运行内存中不存在目标资源的资源数据包,则根据资源配置文件中的下载路径从服务器下载并加载目标资源的资源数据包,以完成对目标资源的添加。Specifically, if the resource data package of the target resource does not exist in the running memory, the resource data package of the target resource is downloaded and loaded from the server according to the download path in the resource configuration file to complete the addition of the target resource.
步骤S215、完成对目标资源的添加。Step S215, completing the addition of the target resource.
可选地,当接收到用户发送的显示目标配置场景的指令时,显示包含第一场景、第二场景和目标资源的目标配置场景。Optionally, when an instruction to display the target configuration scene sent by the user is received, the target configuration scene including the first scene, the second scene and the target resource is displayed.
示例性地,当安装或更新完成终端应用时,用户点击终端应用的图标,终端应用接收到用户发送的显示目标配置场景的指令,则显示包含第一场景、第二场景和目标资源的目标配置场景。或者,当用户点击终端应用的显示界面中的添加场景按钮和/或添加资源按钮时,终端在完成第一场景、第二场景和目标资源的添加后,自动在显示界面显示目标配置场景。Exemplarily, when the terminal application is installed or updated, the user clicks the icon of the terminal application, and the terminal application receives the instruction sent by the user to display the target configuration scene, and then displays the target configuration including the first scene, the second scene and the target resource. Scenes. Alternatively, when the user clicks the add scene button and/or the add resource button in the display interface of the terminal application, the terminal automatically displays the target configuration scene on the display interface after adding the first scene, the second scene and the target resource.
本申请实施例根据各个局部场景的场景配置文件添加不同类型的局部场景,使得目标配置场景中的每个局部场景均能满足用户的策划需求,保证每个局部场景均能向用户呈现美术效果。本申请实施例还基于目标配置场景中不同类型的局部场景执行不同的加载操作,根据资源配置文件确定目标资源的添加,避免了同时只有一个场景存在导致的无法满足用户丰富的策划需求,且在切换场景时频繁出现“加载中”的界面而使用户体验差的问题,便于用户灵活配置场景和资源,提升用户的体验感。同时,本申请实施例还避免了同类型场景多个共存导致的运用和管理问题。如使用多个unity类型的场景,使得当前激活的场景只能有一个且未激活的场景不能很好的运用和管理。又如用多个prefab类型的场景,在切换场景中内存的管理不如切换unity类型的场景。本申请实施例通过支持多类型场景共存,解决了相关技术中在场景的处理上数量或者类型上过于单一、不够灵活的问题,便于用户动态配置相关共存和互斥关系,且便于用户在当前场景中动态切换天空盒、关照贴图和探针等信息。The embodiment of the present application adds different types of local scenes according to the scene configuration files of each local scene, so that each local scene in the target configuration scene can meet the planning needs of the user, and ensure that each local scene can present artistic effects to the user. The embodiment of the present application also performs different loading operations based on different types of local scenes in the target configuration scene, and determines the addition of target resources according to the resource configuration file, so as to avoid the inability to meet the rich planning needs of users caused by the existence of only one scene at the same time. When switching scenes, the "Loading" interface frequently appears, resulting in poor user experience. It is convenient for users to flexibly configure scenes and resources and improve user experience. Meanwhile, the embodiment of the present application also avoids application and management problems caused by the coexistence of multiple scenarios of the same type. If you use multiple Unity-type scenes, there can only be one currently activated scene, and the inactive scene cannot be well used and managed. Another example is the use of multiple prefab types of scenes, the memory management in the switching scene is not as good as switching the unity type scene. By supporting the coexistence of multiple types of scenarios, the embodiment of the present application solves the problem that the number or types of scenarios are too single and inflexible in the related art, it is convenient for users to dynamically configure related coexistence and mutual exclusion relationships, and it is convenient for users to use the current scenario in the current scenario. Dynamically switch information such as skyboxes, caremaps, and probes in .
实施例三Embodiment 3
图4是本申请实施例三提供的一种多类型场景共存的添加装置的结构示意图。该装置可由软件和/或硬件实现,一般可集成在终端中,可以通过执行多类型场景共存的添加方法实现多类型的场景共存,提高用户对场景配置的灵活性。如图4所示,该装置包括:FIG. 4 is a schematic structural diagram of a device for adding coexistence of multiple types of scenarios according to Embodiment 3 of the present application. The device can be implemented by software and/or hardware, and can generally be integrated in a terminal, and can implement multi-type scene coexistence by executing the multi-type scene coexistence adding method, thereby improving the flexibility of the user's scene configuration. As shown in Figure 4, the device includes:
数据包获取模块301,用于分别获取目标配置场景中至少两个局部场景的场 景数据包,所述局部场景包括:共享显示类型的第一场景以及独占显示类型的第二场景;The data packet obtaining module 301 is used to obtain the scene data packets of at least two partial scenes in the target configuration scene respectively, and the partial scenes include: a first scene of a shared display type and a second scene of an exclusive display type;
第一添加模块302,用于在与第一场景匹配的第一初始配置场景中,直接加载第一场景的场景数据包中的场景资源,以完成对目标配置场景中第一场景的添加;The first adding module 302 is configured to directly load the scene resources in the scene data package of the first scene in the first initial configuration scene matching the first scene, so as to complete the addition of the first scene in the target configuration scene;
第二添加模块303,用于采用独占显示的方式,在与第二场景匹配的第二初始配置场景中加载第二场景的场景数据包中的场景资源,以完成对目标配置场景中第二场景的添加。The second adding module 303 is configured to use an exclusive display mode to load the scene resources in the scene data package of the second scene in the second initial configuration scene that matches the second scene, so as to complete the second scene in the target configuration scene 's addition.
本申请实施例提供了一种多类型场景共存的添加装置,通过分别获取目标配置场景中至少两个局部场景的场景数据包,在与共享显示类型的第一场景匹配的第一初始配置场景中,直接对第一场景的场景数据包中的场景资源进行加载,实现对目标配置场景中第一场景的添加,在与独占显示类型的第二场景匹配的第二初始配置场景中,采用独占显示的方式对第二场景的场景数据包中的场景资源进行加载,实现对目标配置场景中第二场景的添加。本申请实施例基于目标配置场景中不同类型的局部场景,分别采用不同的添加方式,实现了多类型的场景共存,便于用户根据策划需求灵活配置目标配置场景,提高了用户对场景配置的灵活性。An embodiment of the present application provides a device for adding multiple types of scenes to coexist. By separately acquiring scene data packets of at least two partial scenes in a target configuration scene, in a first initial configuration scene that matches the first scene of the shared display type , directly load the scene resources in the scene data package of the first scene, realize the addition of the first scene in the target configuration scene, and use the exclusive display in the second initial configuration scene that matches the second scene of the exclusive display type. The scene resource in the scene data package of the second scene is loaded in the way of the second scene, so as to realize the addition of the second scene in the target configuration scene. Based on different types of local scenes in the target configuration scene, the embodiment of the present application adopts different adding methods to realize the coexistence of multiple types of scenes, which facilitates the user to flexibly configure the target configuration scene according to the planning requirements, and improves the user's flexibility in scene configuration. .
可选地,所述数据包获取模块301,具体用于:Optionally, the data packet acquisition module 301 is specifically used for:
分别获取目标配置场景中至少两个局部场景的场景配置文件,根据各个所述场景配置文件中的下载路径从服务器下载对应的场景数据包。The scene configuration files of at least two partial scenes in the target configuration scene are respectively obtained, and corresponding scene data packages are downloaded from the server according to the download paths in each of the scene configuration files.
可选地,所述数据包获取模块301,具体还用于:Optionally, the data packet obtaining module 301 is further used for:
在分别获取目标配置场景中至少两个局部场景的场景配置文件之后,从各个所述场景配置文件中获取各个所述局部场景的类型标识;After acquiring the scene configuration files of at least two local scenes in the target configuration scene respectively, acquiring the type identifiers of each of the local scenes from each of the scene configuration files;
对于每一个局部场景,若所述局部场景的类型标识是预设共享显示类型标识,则确定所述局部场景是第一场景;For each partial scene, if the type identifier of the partial scene is a preset shared display type identifier, it is determined that the partial scene is the first scene;
若所述局部场景的类型标识是预设独占显示类型标识,则确定所述局部场景是第二场景。If the type identifier of the partial scene is a preset exclusive display type identifier, it is determined that the partial scene is the second scene.
可选地,所述第二添加模块303,具体用于:Optionally, the second adding module 303 is specifically used for:
若与第二场景匹配的第二初始配置场景的场景类型是空场景类型,直接加载所述第二场景的场景数据包中的场景资源;If the scene type of the second initial configuration scene matching the second scene is an empty scene type, directly load the scene resource in the scene data package of the second scene;
若与第二场景匹配的第二初始配置场景的场景类型是独占显示类型,根据所述第二场景的场景数据包中的关键字段确定所述场景数据包中的场景资源的 加载方式;其中,所述关键字段由用户根据开发需求和运行环境预先在所述场景数据包中设置。If the scene type of the second initial configuration scene that matches the second scene is the exclusive display type, the loading method of the scene resource in the scene data packet is determined according to the key field in the scene data packet of the second scene; wherein , the key field is pre-set in the scenario data package by the user according to development requirements and operating environment.
可选地,所述第二添加模块303,具体用于:Optionally, the second adding module 303 is specifically used for:
若所述第二场景的场景数据包中的关键字段是预设切换字段,卸载所述第二初始配置场景,得到空场景,在所述空场景中加载所述第二场景的场景数据包中的场景资源;If the key field in the scene data package of the second scene is a preset switching field, unload the second initial configuration scene to obtain an empty scene, and load the scene data package of the second scene in the empty scene scene resources in ;
若所述第二场景的场景数据包中的关键字段是预设隐藏字段,在所述第二初始配置场景中加载所述第二场景的场景数据包中的场景资源,激活所述第二场景并隐藏所述第二初始配置场景。If the key field in the scene data package of the second scene is a preset hidden field, load the scene resources in the scene data package of the second scene in the second initial configuration scene, and activate the second scene. scene and hide the second initial configuration scene.
可选地,所述装置,还包括:Optionally, the device further includes:
资源获取模块,用于在完成对所述目标配置场景中第一场景的添加,以及完成对所述目标配置场景中第二场景的添加之后,获取所述目标配置场景中目标资源的资源配置文件,根据所述资源配置文件中的下载路径查询运行内存中所有资源包;A resource acquisition module, configured to acquire the resource configuration file of the target resource in the target configuration scene after completing the addition of the first scene in the target configuration scene and the addition of the second scene in the target configuration scene , query all resource packs in the running memory according to the download path in the resource configuration file;
内存资源加载模块,用于若所述运行内存中存在所述目标资源的资源数据包,在当前场景中加载所述运行内存中的资源数据包,以完成对所述目标资源的添加;a memory resource loading module, configured to load the resource data package in the running memory in the current scene if the resource data package of the target resource exists in the running memory, so as to complete the addition of the target resource;
资源下载模块,用于若所述运行内存中不存在所述目标资源的资源数据包,根据所述资源配置文件中的下载路径从所述服务器下载所述目标资源的资源数据包,在所述当前场景中加载所述下载的资源数据包,以完成对所述目标资源的添加。A resource download module, configured to download the resource data package of the target resource from the server according to the download path in the resource configuration file if the resource data package of the target resource does not exist in the running memory, The downloaded resource data package is loaded in the current scene to complete the addition of the target resource.
可选地,所述装置,还包括:Optionally, the device further includes:
场景显示模块,用于当接收到用户发送的显示目标配置场景的指令时,显示包含第一场景、第二场景和目标资源的所述目标配置场景。The scene display module is configured to display the target configuration scene including the first scene, the second scene and the target resource when receiving an instruction to display the target configuration scene sent by the user.
可选地,所述第一添加模块301,具体用于:Optionally, the first adding module 301 is specifically used for:
根据所述第一场景的场景数据包中的场景资源进行类别判断,将相同类别的场景资源存入到同一个子场景数据包中,将不同类别的场景资源存入到不同的子场景数据包中,分别加载各个所述子场景数据包中的场景资源。The category is judged according to the scene resources in the scene data package of the first scene, the scene resources of the same category are stored in the same sub-scene data package, and the scene resources of different categories are stored in different sub-scene data packages , respectively load the scene resources in each of the sub-scene data packages.
可选地,所述第二添加模块,具体用于:Optionally, the second adding module is specifically used for:
根据所述第二场景的场景数据包中的场景资源进行类别判断,将相同类别的场景资源存入到同一个子场景数据包中,将不同类别的场景资源存入到不同的子场景数据包中,在与第二场景匹配的第二初始配置场景中分别加载各个所 述子场景数据包中的场景资源。The category is judged according to the scene resources in the scene data package of the second scene, the scene resources of the same category are stored in the same sub-scene data package, and the scene resources of different categories are stored in different sub-scene data packages , and respectively load the scene resources in each of the sub-scene data packages in the second initial configuration scene that matches the second scene.
本申请实施例所提供的不同类型场景共存的添加装置可执行本申请任意实施例所提供的不同类型场景共存的添加方法,具备执行方法相应的功能模块和有益效果。The apparatus for adding coexistence of different types of scenarios provided by the embodiments of the present application can execute the method for adding coexistence of different types of scenarios provided by any embodiment of the present application, and has functional modules and beneficial effects corresponding to the execution methods.
实施例四Embodiment 4
图5是本申请实施例四提供的一种终端的结构示意图,如图5所示,该终端包括处理器400、存储器401、输入装置402和输出装置403;终端中处理器400的数量可以是一个或多个,图5中以一个处理器400为例;终端中的处理器400、存储器401、输入装置402和输出装置403可以通过总线或其他方式连接,图5中以通过总线连接为例。FIG. 5 is a schematic structural diagram of a terminal provided in Embodiment 4 of the present application. As shown in FIG. 5 , the terminal includes a processor 400, a memory 401, an input device 402, and an output device 403; the number of processors 400 in the terminal may be One or more, one processor 400 is taken as an example in FIG. 5; the processor 400, memory 401, input device 402 and output device 403 in the terminal can be connected through a bus or other means, and the connection through a bus is taken as an example in FIG. 5 .
存储器401作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序以及模块,如本申请实施例中的多类型场景共存的添加方法对应的程序指令和/或模块(例如,多类型场景共存的添加装置中的数据包获取模块301、第一添加模块302和第二添加模块303)。处理器400通过运行存储在存储器401中的软件程序、指令以及模块,从而执行终端的各种功能应用以及数据处理,即实现上述的多类型场景共存的添加方法。该方法包括:As a computer-readable storage medium, the memory 401 can be used to store software programs, computer-executable programs, and modules, such as program instructions and/or modules corresponding to the method for adding coexistence of multiple types of scenarios in the embodiments of the present application (for example, multiple The data packet acquisition module 301, the first adding module 302, and the second adding module 303 in the adding device of type scene coexistence). The processor 400 executes various functional applications and data processing of the terminal by running the software programs, instructions and modules stored in the memory 401 , that is, implementing the above-mentioned method for adding coexistence of multiple types of scenarios. The method includes:
分别获取目标配置场景中至少两个局部场景的场景数据包,所述局部场景包括:共享显示类型的第一场景以及独占显示类型的第二场景;respectively acquiring scene data packets of at least two partial scenes in the target configuration scene, where the partial scenes include: a first scene of a shared display type and a second scene of an exclusive display type;
在与所述第一场景匹配的第一初始配置场景中,直接加载所述第一场景的场景数据包中的场景资源,以完成对所述目标配置场景中第一场景的添加;In the first initial configuration scene matching the first scene, directly loading the scene resources in the scene data package of the first scene to complete the addition of the first scene in the target configuration scene;
采用独占显示的方式,在与所述第二场景匹配的第二初始配置场景中加载所述第二场景的场景数据包中的场景资源,以完成对所述目标配置场景中第二场景的添加。In the mode of exclusive display, the scene resources in the scene data package of the second scene are loaded in the second initial configuration scene matching the second scene, so as to complete the addition of the second scene in the target configuration scene .
存储器401可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端的使用所创建的数据等。此外,存储器401可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器401可进一步包括相对于处理器400远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 401 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. In addition, memory 401 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 401 may further include memory located remotely from the processor 400, and these remote memories may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
输入装置402可用于接收输入的数字或字符信息,以及产生与终端的用户设置以及功能控制有关的键信号输入。输出装置403可包括显示屏等显示设备。The input device 402 may be used to receive input numerical or character information, and generate key signal input related to user settings and function control of the terminal. The output device 403 may include a display device such as a display screen.
实施例五Embodiment 5
本申请实施例五还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行一种多类型场景共存的添加方法,该方法包括:Embodiment 5 of the present application further provides a storage medium containing computer-executable instructions, when the computer-executable instructions are executed by a computer processor for executing a multi-type scene coexistence addition method, the method includes:
分别获取目标配置场景中至少两个局部场景的场景数据包,所述局部场景包括:共享显示类型的第一场景以及独占显示类型的第二场景;respectively acquiring scene data packets of at least two partial scenes in the target configuration scene, where the partial scenes include: a first scene of a shared display type and a second scene of an exclusive display type;
在与所述第一场景匹配的第一初始配置场景中,直接加载所述第一场景的场景数据包中的场景资源,以完成对所述目标配置场景中第一场景的添加;In the first initial configuration scene matching the first scene, directly loading the scene resources in the scene data package of the first scene to complete the addition of the first scene in the target configuration scene;
采用独占显示的方式,在与所述第二场景匹配的第二初始配置场景中加载所述第二场景的场景数据包中的场景资源,以完成对所述目标配置场景中第二场景的添加。In the mode of exclusive display, the scene resources in the scene data package of the second scene are loaded in the second initial configuration scene matching the second scene, so as to complete the addition of the second scene in the target configuration scene .
当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的方法操作,还可以执行本申请任意实施例所提供的多类型场景共存的添加方法中的相关操作。Of course, a storage medium containing computer-executable instructions provided by an embodiment of the present application, the computer-executable instructions of the storage medium are not limited to the above-mentioned method operations, and can also execute the coexistence of multiple types of scenarios provided by any embodiment of the present application. Add related operations in the method.
通过以上关于实施方式的描述,所属领域的技术人员可以清楚地了解到,本申请可借助软件及必需的通用硬件来实现,当然也可以通过硬件实现,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。From the above description of the embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software and necessary general-purpose hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation manner . Based on such understanding, the technical solutions of the present application can be embodied in the form of software products in essence or the parts that make contributions to related technologies, and the computer software products can be stored in a computer-readable storage medium, such as a computer floppy disk, Read-Only Memory (ROM), Random Access Memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including several instructions to make a computer device (which can be a personal computer, A server, or a network device, etc.) executes the methods described in the various embodiments of the present application.
值得注意的是,上述多类型场景共存的添加装置的实施例中,所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。It is worth noting that, in the above-mentioned embodiment of the adding device for coexistence of multiple types of scenarios, the units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized. ; In addition, the specific names of the functional units are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present application.

Claims (15)

  1. 一种多类型场景共存的添加方法,包括:An addition method for coexistence of multiple types of scenarios, including:
    分别获取目标配置场景中至少两个局部场景的场景数据包,所述局部场景包括:共享显示类型的第一场景以及独占显示类型的第二场景;respectively acquiring scene data packets of at least two partial scenes in the target configuration scene, where the partial scenes include: a first scene of a shared display type and a second scene of an exclusive display type;
    在与所述第一场景匹配的第一初始配置场景中,直接加载所述第一场景的场景数据包中的场景资源,以完成对所述目标配置场景中第一场景的添加;In the first initial configuration scene matching the first scene, directly loading the scene resources in the scene data package of the first scene to complete the addition of the first scene in the target configuration scene;
    采用独占显示的方式,在与所述第二场景匹配的第二初始配置场景中加载所述第二场景的场景数据包中的场景资源,以完成对所述目标配置场景中第二场景的添加。In the mode of exclusive display, the scene resources in the scene data package of the second scene are loaded in the second initial configuration scene matching the second scene, so as to complete the addition of the second scene in the target configuration scene .
  2. 根据权利要求1所述的方法,其中,所述分别获取目标配置场景中至少两个局部场景的场景数据包,包括:The method according to claim 1, wherein said acquiring scene data packets of at least two partial scenes in the target configuration scene respectively comprises:
    分别获取目标配置场景中至少两个局部场景的场景配置文件,根据各个所述场景配置文件中的下载路径从服务器下载对应的场景数据包。The scene configuration files of at least two partial scenes in the target configuration scene are obtained respectively, and the corresponding scene data package is downloaded from the server according to the download paths in each of the scene configuration files.
  3. 根据权利要求2所述的方法,其中,在分别获取目标配置场景中至少两个局部场景的场景配置文件之后,还包括:The method according to claim 2, wherein after acquiring the scene configuration files of at least two partial scenes in the target configuration scene respectively, the method further comprises:
    从各个所述场景配置文件中获取各个所述局部场景的类型标识;Obtain the type identifier of each of the local scenes from each of the scene configuration files;
    对于每一个局部场景,若所述局部场景的类型标识是预设共享显示类型标识,则确定所述局部场景是第一场景;For each partial scene, if the type identifier of the partial scene is a preset shared display type identifier, it is determined that the partial scene is the first scene;
    若所述局部场景的类型标识是预设独占显示类型标识,则确定所述局部场景是第二场景。If the type identifier of the partial scene is a preset exclusive display type identifier, it is determined that the partial scene is the second scene.
  4. 根据权利要求1所述的方法,其中,所述采用独占显示的方式,在与所述第二场景匹配的第二初始配置场景中加载所述第二场景的场景数据包中的场景资源,包括:The method according to claim 1, wherein the loading of the scene resources in the scene data package of the second scene in the second initial configuration scene matching the second scene in the manner of exclusive display comprises: :
    若与第二场景匹配的第二初始配置场景的场景类型是空场景类型,直接加载所述第二场景的场景数据包中的场景资源;If the scene type of the second initial configuration scene matching the second scene is an empty scene type, directly load the scene resource in the scene data package of the second scene;
    若与第二场景匹配的第二初始配置场景的场景类型是独占显示类型,根据所述第二场景的场景数据包中的关键字段确定所述场景数据包中的场景资源的加载方式;其中,所述关键字段由用户根据开发需求和运行环境预先在所述场景数据包中设置。If the scene type of the second initial configuration scene that matches the second scene is the exclusive display type, the loading method of the scene resource in the scene data packet is determined according to the key field in the scene data packet of the second scene; wherein , the key field is pre-set in the scenario data package by the user according to development requirements and operating environment.
  5. 根据权利要求4所述的方法,其中,所述根据所述第二场景的场景数据包中的关键字段确定所述场景数据包中的场景资源的加载方式,包括:The method according to claim 4, wherein the determining the loading mode of the scene resources in the scene data package according to the key fields in the scene data package of the second scene comprises:
    若所述第二场景的场景数据包中的关键字段是预设切换字段,卸载所述第 二初始配置场景,得到空场景,在所述空场景中加载所述第二场景的场景数据包中的场景资源;If the key field in the scene data package of the second scene is a preset switching field, unload the second initial configuration scene to obtain an empty scene, and load the scene data package of the second scene in the empty scene scene resources in ;
    若所述第二场景的场景数据包中的关键字段是预设隐藏字段,在所述第二初始配置场景中加载所述第二场景的场景数据包中的场景资源,激活所述第二场景并隐藏所述第二初始配置场景。If the key field in the scene data package of the second scene is a preset hidden field, load the scene resources in the scene data package of the second scene in the second initial configuration scene, and activate the second scene. scene and hide the second initial configuration scene.
  6. 根据权利要求1所述的方法,其中,在完成对所述目标配置场景中第一场景的添加,以及完成对所述目标配置场景中第二场景的添加之后,还包括:The method according to claim 1, wherein after completing the addition of the first scene in the target configuration scene and the addition of the second scene in the target configuration scene, the method further comprises:
    获取所述目标配置场景中目标资源的资源配置文件,根据所述资源配置文件中的下载路径查询运行内存中所有资源包;Obtaining the resource configuration file of the target resource in the target configuration scene, and querying all resource packs in the running memory according to the download path in the resource configuration file;
    若所述运行内存中存在所述目标资源的资源数据包,在当前场景中加载所述运行内存中的资源数据包,以完成对所述目标资源的添加;If there is a resource data package of the target resource in the running memory, load the resource data package in the running memory in the current scene to complete the addition of the target resource;
    若所述运行内存中不存在所述目标资源的资源数据包,根据所述资源配置文件中的下载路径从所述服务器下载所述目标资源的资源数据包,在所述当前场景中加载所述下载的资源数据包,以完成对所述目标资源的添加。If the resource data package of the target resource does not exist in the running memory, download the resource data package of the target resource from the server according to the download path in the resource configuration file, and load the resource data package in the current scene The downloaded resource data package to complete the addition of the target resource.
  7. 根据权利要求6所述的方法,还包括:The method of claim 6, further comprising:
    当接收到用户发送的显示目标配置场景的指令时,显示包含第一场景、第二场景和目标资源的所述目标配置场景。When an instruction to display the target configuration scene sent by the user is received, the target configuration scene including the first scene, the second scene and the target resource is displayed.
  8. 根据权利要求1所述的方法,其中,所述直接加载所述第一场景的场景数据包中的场景资源,包括:The method according to claim 1, wherein the directly loading the scene resources in the scene data package of the first scene comprises:
    根据所述第一场景的场景数据包中的场景资源进行类别判断,将相同类别的场景资源存入到同一个子场景数据包中,将不同类别的场景资源存入到不同的子场景数据包中,分别加载各个所述子场景数据包中的场景资源。The category is judged according to the scene resources in the scene data package of the first scene, the scene resources of the same category are stored in the same sub-scene data package, and the scene resources of different categories are stored in different sub-scene data packages , respectively load the scene resources in each of the sub-scene data packages.
  9. 根据权利要求1所述的方法,其中,所述在与所述第二场景匹配的第二初始配置场景中加载所述第二场景的场景数据包中的场景资源,包括:The method according to claim 1, wherein the loading the scene resources in the scene data package of the second scene in the second initial configuration scene matching the second scene comprises:
    根据所述第二场景的场景数据包中的场景资源进行类别判断,将相同类别的场景资源存入到同一个子场景数据包中,将不同类别的场景资源存入到不同的子场景数据包中,在与第二场景匹配的第二初始配置场景中分别加载各个所述子场景数据包中的场景资源。The category is judged according to the scene resources in the scene data package of the second scene, the scene resources of the same category are stored in the same sub-scene data package, and the scene resources of different categories are stored in different sub-scene data packages , and respectively load the scene resources in each of the sub-scene data packages in the second initial configuration scene that matches the second scene.
  10. 一种不同类型场景共存的添加装置,包括:An add-on device for coexistence of different types of scenes, including:
    数据包获取模块,用于分别获取目标配置场景中至少两个局部场景的场景数据包,所述局部场景包括:共享显示类型的第一场景以及独占显示类型的第二场景;a data packet acquisition module, configured to separately acquire scene data packets of at least two partial scenes in the target configuration scene, where the partial scenes include: a first scene of a shared display type and a second scene of an exclusive display type;
    第一添加模块,用于在与第一场景匹配的第一初始配置场景中,直接加载第一场景的场景数据包中的场景资源,以完成对目标配置场景中第一场景的添加;a first adding module, configured to directly load the scene resources in the scene data package of the first scene in the first initial configuration scene matching the first scene, so as to complete the addition of the first scene in the target configuration scene;
    第二添加模块,用于采用独占显示的方式,在与第二场景匹配的第二初始配置场景中加载第二场景的场景数据包中的场景资源,以完成对目标配置场景中第二场景的添加。The second adding module is used to load the scene resources in the scene data package of the second scene in the second initial configuration scene that matches the second scene in the mode of exclusive display, so as to complete the second scene in the target configuration scene. Add to.
  11. 根据权利要求10所述的装置,其中,所述第二添加模块,具体用于:The device according to claim 10, wherein the second adding module is specifically used for:
    若与第二场景匹配的第二初始配置场景的场景类型是空场景类型,直接加载所述第二场景的场景数据包中的场景资源;If the scene type of the second initial configuration scene matching the second scene is an empty scene type, directly load the scene resource in the scene data package of the second scene;
    若与第二场景匹配的第二初始配置场景的场景类型是独占显示类型,根据所述第二场景的场景数据包中的关键字段确定所述场景数据包中的场景资源的加载方式;其中,所述关键字段由用户根据开发需求和运行环境预先在所述场景数据包中设置。If the scene type of the second initial configuration scene that matches the second scene is the exclusive display type, the loading method of the scene resource in the scene data packet is determined according to the key field in the scene data packet of the second scene; wherein , the key field is pre-set in the scenario data package by the user according to development requirements and operating environment.
  12. 根据权利要求11所述的装置,其中,所述第二添加模块,具体用于:The device according to claim 11, wherein the second adding module is specifically used for:
    若所述第二场景的场景数据包中的关键字段是预设切换字段,卸载所述第二初始配置场景,得到空场景,在所述空场景中加载所述第二场景的场景数据包中的场景资源;If the key field in the scene data package of the second scene is a preset switching field, unload the second initial configuration scene to obtain an empty scene, and load the scene data package of the second scene in the empty scene scene resources in ;
    若所述第二场景的场景数据包中的关键字段是预设隐藏字段,在所述第二初始配置场景中加载所述第二场景的场景数据包中的场景资源,激活所述第二场景并隐藏所述第二初始配置场景。If the key field in the scene data package of the second scene is a preset hidden field, load the scene resources in the scene data package of the second scene in the second initial configuration scene, and activate the second scene. scene and hide the second initial configuration scene.
  13. 根据权利要求10所述的装置,还包括:The apparatus of claim 10, further comprising:
    资源获取模块,用于在完成对所述目标配置场景中第一场景的添加,以及完成对所述目标配置场景中第二场景的添加之后,获取所述目标配置场景中目标资源的资源配置文件,根据所述资源配置文件中的下载路径查询运行内存中所有资源包;A resource acquisition module, configured to acquire the resource configuration file of the target resource in the target configuration scene after completing the addition of the first scene in the target configuration scene and the addition of the second scene in the target configuration scene , query all resource packs in the running memory according to the download path in the resource configuration file;
    内存资源加载模块,用于若所述运行内存中存在所述目标资源的资源数据包,在当前场景中加载所述运行内存中的资源数据包,以完成对所述目标资源的添加;A memory resource loading module, configured to load the resource data package in the operating memory in the current scene if the resource data package of the target resource exists in the operating memory, so as to complete the addition of the target resource;
    资源下载模块,用于若所述运行内存中不存在所述目标资源的资源数据包,根据所述资源配置文件中的下载路径从所述服务器下载所述目标资源的资源数据包,在所述当前场景中加载所述下载的资源数据包,以完成对所述目标资源的添加。A resource download module, configured to download the resource data package of the target resource from the server according to the download path in the resource configuration file if the resource data package of the target resource does not exist in the running memory, The downloaded resource data package is loaded in the current scene to complete the addition of the target resource.
  14. 一种终端,包括:A terminal that includes:
    一个或多个处理器;one or more processors;
    存储器,用于存储一个或多个程序,memory for storing one or more programs,
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-9中任一所述的多类型场景共存的添加方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the method for adding multi-type scene coexistence according to any one of claims 1-9.
  15. 一种包含计算机可执行指令的存储介质,其中,所述计算机可执行指令在由计算机处理器执行时用于执行如权利要求1-9中任一所述的多类型场景共存的添加方法。A storage medium containing computer-executable instructions, wherein the computer-executable instructions, when executed by a computer processor, are used to perform the method for adding multi-type scene coexistence according to any one of claims 1-9.
PCT/CN2020/132379 2020-11-19 2020-11-27 Adding method and apparatus for coexistence of multiple types of scenarios, terminal and storage medium WO2022104883A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011303010.4A CN112435346B (en) 2020-11-19 2020-11-19 Multi-type scene coexistence adding method, device, terminal and storage medium
CN202011303010.4 2020-11-19

Publications (1)

Publication Number Publication Date
WO2022104883A1 true WO2022104883A1 (en) 2022-05-27

Family

ID=74694500

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/132379 WO2022104883A1 (en) 2020-11-19 2020-11-27 Adding method and apparatus for coexistence of multiple types of scenarios, terminal and storage medium

Country Status (2)

Country Link
CN (1) CN112435346B (en)
WO (1) WO2022104883A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502654A (en) * 2016-09-30 2017-03-15 歌尔科技有限公司 Virtual reality scenario loading method and equipment
CN110032837A (en) * 2019-04-17 2019-07-19 腾讯科技(深圳)有限公司 A kind of method, apparatus of data processing, equipment and storage medium
CN111105491A (en) * 2019-11-25 2020-05-05 腾讯科技(深圳)有限公司 Scene rendering method and device, computer readable storage medium and computer equipment
US20200175760A1 (en) * 2017-08-23 2020-06-04 Tencent Technology(Shenzhen) Company Limited Information interaction method based on virtual space scene, computer equipment and computer-readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502654A (en) * 2016-09-30 2017-03-15 歌尔科技有限公司 Virtual reality scenario loading method and equipment
US20200175760A1 (en) * 2017-08-23 2020-06-04 Tencent Technology(Shenzhen) Company Limited Information interaction method based on virtual space scene, computer equipment and computer-readable storage medium
CN110032837A (en) * 2019-04-17 2019-07-19 腾讯科技(深圳)有限公司 A kind of method, apparatus of data processing, equipment and storage medium
CN111105491A (en) * 2019-11-25 2020-05-05 腾讯科技(深圳)有限公司 Scene rendering method and device, computer readable storage medium and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LOUISLIU: "Unity Universal Scene Manager Sharing", INDIENOVA, XP009537197, Retrieved from the Internet <URL:https://indienova.com/indie-game-development/unity-scene-management/> *

Also Published As

Publication number Publication date
CN112435346B (en) 2022-11-15
CN112435346A (en) 2021-03-02

Similar Documents

Publication Publication Date Title
JP7018463B2 (en) Managing the delivery of code and dependent data using the application container
US20210216700A1 (en) Information Processing Method and System
CN111814089B (en) Page rendering method and device, rendering server and storage medium
US20180060055A1 (en) Application containers with dynamic sub-package loading
CN107832100B (en) APK plug-in loading method and terminal thereof
CN109408136B (en) Information processing method, information processing apparatus, storage medium, and electronic device
JP7100154B6 (en) Processor core scheduling method, device, terminal and storage medium
CN110955499B (en) Processor core configuration method, device, terminal and storage medium
CN110750315B (en) Class loading method, device, equipment and storage medium in Android system
CN110968331A (en) Method and device for running application program
CN113190282A (en) Android operating environment construction method and device
CN114222003A (en) Service calling method, system, device, equipment and storage medium
US20210042196A1 (en) Data Migration For A Shared Database
WO2024002217A1 (en) Application management method and related device
WO2021097683A1 (en) Android system starting method and apparatus, device, and storage medium
WO2022104883A1 (en) Adding method and apparatus for coexistence of multiple types of scenarios, terminal and storage medium
CN110032406B (en) Message-based view loading method, device, equipment and storage medium
CN116700694B (en) Applet engine
JP5840892B2 (en) Software distribution system and software distribution program
CN113110941B (en) Managing delivery of code and dependency data using application containers
CN116566795A (en) Method for acquiring dependency relationship between micro-service examples and related equipment
CN117724852A (en) Cloud computer computing resource allocation method and device
CN114253650A (en) Display component transition method, device, equipment and storage medium
CN114491374A (en) Method and system for loading and using Python script from database
CN116737404A (en) Method and terminal device for application connection

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20962174

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20962174

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20962174

Country of ref document: EP

Kind code of ref document: A1