Disclosure of Invention
The invention aims to provide a resource packaging management method and a resource packaging management device, which are used for overcoming the reduction of project development efficiency caused by changing a resource packaging strategy.
According to a first aspect of the embodiments of the present disclosure, there is provided a resource packing management method, including: reading the configuration file to obtain a path of the resource file to be packaged and a preset name of the resource package; and acquiring the resource file to be packaged according to the path, packaging the resource file to generate a resource package by using a preset name of the resource package, and generating a data package to be issued together with the configuration file.
In an exemplary embodiment of the present disclosure, the resource file to be packaged is determined based on the resource file to be updated and includes the resource file to be updated and a dependent resource file of the resource file to be updated.
In an exemplary embodiment of the present disclosure, the configuration file includes a relative path and/or an absolute path depending on the resource file.
In an exemplary embodiment of the present disclosure, the resource package is the AssetBundle package in Unity.
According to a second aspect of the present disclosure, there is provided a resource packing management method, the method including: analyzing the received program release data packet to obtain a configuration file and a resource packet; reading the configuration file to obtain the name of the resource package and the path of the corresponding packaged resource; and analyzing the resource packet according to the name of the resource packet and the path of the packaged resource.
In an exemplary embodiment of the present disclosure, the packaged resource includes a resource file to be updated and a dependent resource file of the resource file to be updated.
In an exemplary embodiment of the present disclosure, the configuration file includes a relative path and/or an absolute path depending on the resource file.
In an exemplary embodiment of the present disclosure, the resource package is the AssetBundle package in Unity.
According to a third aspect of the present disclosure, there is provided a resource management apparatus comprising: the resource acquisition module is used for reading the configuration file to acquire a path of the resource file to be packaged and a preset name of the resource package; and the packaging module is used for acquiring the resource file to be packaged according to the path, packaging the resource file by using the preset name of the resource package to generate the resource package, and generating the data package to be issued together with the configuration file.
According to a fourth aspect of the present disclosure, there is provided a resource management apparatus comprising: the strategy acquisition module is used for analyzing the received program release data packet to acquire a configuration file and a resource packet; the resource acquisition module is used for reading the configuration file to acquire the name of the resource packet and the path of the corresponding packaged resource; and the analysis module is used for analyzing the resource packet according to the name of the resource packet and the path of the packaged resource.
According to a fifth aspect of the present disclosure, there is provided a resource management apparatus comprising: a memory; and a processor coupled to the memory, the processor configured to perform any of the above-described resource packing management methods based on instructions stored in the memory.
According to the resource packaging management method provided by the disclosure, the information required for packaging (including the resource path, the packaging strategy, the preset name of the resource package, the dependency relationship of each package and the like) is recorded in the configuration file, the packaging details of the AssetBundle provided in the Unity are subjected to inheritance packaging, and the configuration file is loaded firstly during packaging and analysis, so that the packaging logic does not need to be embodied in the actual packaging process, developers can change the packaging strategy by setting the configuration file, the dimension is dynamically changed, the packaging details do not need to be concerned, the coupling relationship between the packaging strategy and the resource packaging is segmented and modified, and the project development efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Further, the drawings are merely schematic illustrations of the present disclosure, in which the same reference numerals denote the same or similar parts, and thus, a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The following detailed description of exemplary embodiments of the disclosure refers to the accompanying drawings.
Fig. 1 schematically illustrates a flow chart of a resourcepackaging management method 100 in an exemplary embodiment of the disclosure.
Referring to fig. 1, the resourcepackaging management method 100 can be applied to a program distribution device side, and includes:
step S102, reading the configuration file to obtain the path of the resource file to be packaged and the preset name of the resource package.
And step S104, acquiring the resource file to be packaged according to the path, packaging the resource file to be packaged by using the preset name of the resource package to generate the resource package, and generating the data package to be issued together with the configuration file.
In step S102, the configuration file may be a table file, such as a database file, an Excel table, or the like. The resource file to be updated may be, for example, a file that needs to be deleted, changed, or added to the running device side.
The resource files to be packaged are determined based on the resource files to be updated and comprise the resource files to be updated and the dependent resource files of the resource files to be updated. In addition, the resource file to be packaged can also comprise other files in the same file path as the resource file to be updated.
In step S104, the path of the resource file to be packaged includes a path of a folder to which the resource file to be packaged belongs, and acquiring the resource file to be packaged according to the path includes acquiring all resource files in the folder as the resource file to be packaged according to the path of the folder.
The path of the resource file to be packaged comprises the file name of the resource file to be packaged or the full-path file name of the resource file to be packaged, or the path of the folder to which the resource file to be packaged belongs.
Taking the game application program as an example, the resource files to be packaged mainly include resource files and dependent resource files in a Resources folder, and Scene resource files and dependent resource files in a Scene folder. The resource files under the Resources folder and the resource files that depend on the resource files are resource files that are packaged into the Assetbundle package by default and need to be loaded by calling load on the running equipment side. The Scene resource files and the dependent resource files in the Scene folder are packed as required, that is, usually, a planning staff is required to select the resource files to be packed according to the version requirement and the version plan.
The dependent resource file is a related resource file which needs to be called when the resource file runs. For example, in some embodiments, a "scene" resource file depends on a "preset" and a "model" resource file, a "preset" resource file depends on an "animation" resource file, a "model" resource file depends on a "material" resource file, and a "material" resource file depends on a "map" resource file. Thus, a resource file and its dependent resource files can be packaged together by setting dependencies in a configuration file. The dependent resource packages and resource files in the non-Resources folder of the "scene" resource files may be packaged into data packages by dependency settings.
In some embodiments of the present disclosure, in order to ensure the stability of the packing process, the rule packing in a dependent manner may not be adopted, but a path-based packing strategy is adopted, so as to avoid that the dynamic change of the dependency relationship affects the packing result.
The path format may be, for example:
the Resources in the Art folder include all Art resource files, such as animation files, model files, and the like, and the resource files are indirectly referenced by resource files in the Resources and Scene folders.
Fig. 2 to 4 schematically show the packing configuration of the configuration file for Scene path, Asset path and Resources path.
Referring to fig. 2 to 4, the configuration file may include a path name of the resource file to be packaged, a preset name of the resource package corresponding to the path, and an identifier indicating whether to package all the dependent resource files together.
Fig. 5 schematically shows a package union configuration in a configuration file.
Referring to fig. 5, resource files of multiple paths may be combined into one packet by setting preset names of the same resource packet for different resource paths. At this time, the resource files to be packaged include a plurality of resource files to be packaged located in different folders.
In an exemplary embodiment of the present disclosure, the configuration file includes a relative path and/or an absolute path depending on the resource file.
Fig. 6 schematically shows an absolute path configuration for a dependent resource file in a configuration file.
Referring to FIG. 6, the absolute path of a resource that needs to be indirectly packaged can be written to a configuration file.
Fig. 7 schematically shows the relative path configuration for dependent resource files in a configuration file.
Referring to fig. 7, since the path indirectly referenced by the scene resource is complex, changes are frequent, and the path is generally modified by the designer, and randomness is large, in this embodiment, the relative path of the resource that needs to be indirectly packaged can be written into the configuration file. Configuring the relative path of the dependent resource file may avoid modifying the configuration file by modifying or adding a path of the dependent resource file. However, in some embodiments, only absolute paths that depend on the resource file may be configured.
When setting the path of the dependent resource file, if a plurality of paths under the folder need to be packed, the preset name of the resource package can be named according to the path name. For example, the packing dimension may be controlled by packing files in the Character/Enemmy folder into a resource package named Character _ Enemy, and packing files in the Character folder but not in the Character/Enemmy folder into a resource package named Character. In addition, files under each folder in the resource package can be deleted or added through the packaging setting.
In summary, when packaging the resource, the resource path collection may be performed by obtaining and reading the configuration file, then integrating the resource according to the setting when the configuration file relates to the inclusion and the setting, and finally packaging the dependent resource file related to the configuration file into the data packet and submitting the data packet. In some embodiments of the present disclosure, the resource package may be an Assetbundle package.
Fig. 8 schematically illustrates a flow chart of a resourcepackaging management method 800 in an exemplary embodiment of the disclosure.
Referring to fig. 8, a resourcepackaging management method 800 can be applied to the program execution device side. Themethod 800 may include:
step S802, analyzing the received program release data packet to obtain a configuration file and a resource packet.
Step S804, the configuration file is read to obtain the name of the resource package and the path of the corresponding packaged resource.
Step S806, the resource package is analyzed according to the name of the resource package and the path of the packaged resource.
In an exemplary embodiment of the present disclosure, the packaged resource includes a resource file to be updated and a dependent resource file of the resource file to be updated.
In an exemplary embodiment of the present disclosure, the configuration file includes a relative path and/or an absolute path depending on the resource file.
In an exemplary embodiment of the present disclosure, the resource package is the AssetBundle package in Unity.
On the running device side, the resource file loading process is abstracted into loaderbase. The loader resource loading interface is used for loading a non-AssetBundle package, and the loader AssetBundle resource loading interface is used for loading an AssetBundle package.
The Loaderbase loads all resource files, and because the corresponding resource package name is set for the resource path under the Resources folder through the configuration file, when the Assetbundle package is loaded, the loaderasetbnle can firstly read the configuration file, perform positioning analysis on the resource package, find out the position of the resource package of the resource file to be updated, and therefore correctly load the resource package and the corresponding resource file.
Since all resource files need to be loaded from the Resources path and the same piece of code is provided for both the Assetbundle and non-Assetbundle packages, the LoaderAssetbundle can be processed as follows:
firstly, a file path to be loaded is obtained through a loaded interface object Load (string path), then the name of an Assetbundle package corresponding to the file path is found from a configuration file, whether the Assetbundle package is loaded or not is judged, if not, the Assetbundle package is loaded, if so, a resource file corresponding to the Assetbundle package is loaded, and the result is returned to a logic layer. Through the above encapsulation, the coupling relationship between the packaging policy and the AssetBundle package can be released.
Corresponding to the above method embodiment, the present disclosure also provides a resource management device, which may be used to execute the above method embodiment.
Fig. 9 schematically shows a block diagram of aresource management device 900 in an exemplary embodiment of the present disclosure.
Referring to fig. 9, theresource management apparatus 900 includes:
theresource obtaining module 902 is configured to read the configuration file to obtain a path of the resource file to be packaged and a preset name of the resource package.
And thepackaging module 904 is configured to obtain the resource file to be packaged according to the path, package the resource file to generate a resource package by using the preset name of the resource package, and generate a data package to be issued together with the configuration file.
Fig. 10 schematically illustrates a block diagram of aresource management apparatus 1000 in an exemplary embodiment of the present disclosure.
Referring to fig. 10, theresource management apparatus 1000 includes:
thepolicy obtaining module 1002 is configured to parse the received program distribution data packet to obtain a configuration file and a resource packet.
Theresource obtaining module 1004 is configured to read the configuration file to obtain a preset name of the resource package and a path of the corresponding packaged resource.
Theparsing module 1006 is configured to parse the resource packet according to the preset name of the resource packet and the path of the packaged resource.
Since the functions of thedevices 900, 1000 have been described in detail in their corresponding method embodiments, the disclosure is not repeated here.
FIG. 11 is a block diagram illustrating anapparatus 1100 for resource management in accordance with an example embodiment. Theresource management device 1100 may be a mobile terminal such as a smart phone or a tablet computer.
The Unity-basedresource management device 1100 may include a memory and a processor coupled to the memory, the processor configured to perform any of the resource packing management methods described above based on instructions stored in the memory. The specific manner in which the processor of the apparatus in this embodiment performs operations has been described in detail in the embodiment related to the resource packaging management method, and will not be elaborated here.
Referring to fig. 11,apparatus 1100 may include one or more of the following components:processing component 1102,memory 1104,power component 1106,multimedia component 1108,audio component 1110,sensor component 1114, andcommunications component 1116.
Theprocessing component 1102 generally controls overall operation of thedevice 1100, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Theprocessing components 1102 may include one ormore processors 1118 to execute instructions to perform all or a portion of the steps of the methods described above. Further, theprocessing component 1102 may include one or more modules that facilitate interaction between theprocessing component 1102 and other components. For example, theprocessing component 1102 may include a multimedia module to facilitate interaction between themultimedia component 1108 and theprocessing component 1102.
Thememory 1104 is configured to store various types of data to support operations at theapparatus 1100. Examples of such data include instructions for any application or method operating on thedevice 1100. Thememory 1104 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks. Also stored in thememory 1104 are one or more modules configured to be executed by the one ormore processors 1118 to perform all or a portion of the steps of any of the illustrated methods described above.
Apower component 1106 provides power to the various components of thedevice 1100. Thepower components 1106 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for theapparatus 1100.
Themultimedia component 1108 includes a screen that provides an output interface between thedevice 1100 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
Theaudio component 1110 is configured to output and/or input audio signals. For example, theaudio component 1110 includes a Microphone (MIC) configured to receive external audio signals when theapparatus 1100 is in operating modes, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in thememory 1104 or transmitted via thecommunication component 1116. In some embodiments, theaudio assembly 1110 further includes a speaker for outputting audio signals.
Thesensor assembly 1114 includes one or more sensors for providing various aspects of state assessment for theapparatus 1100. For example, thesensor assembly 1114 can detect the open/closed status of theapparatus 1100, the relative positioning of the components, thesensor assembly 1114 can also detect a change in position of theapparatus 1100 or a component of theapparatus 1100, and a change in temperature of theapparatus 1100. In some embodiments, thesensor assembly 1114 may also include a magnetic sensor, a pressure sensor, or a temperature sensor.
Thecommunication component 1116 is configured to facilitate wired or wireless communication between theapparatus 1100 and other devices. Theapparatus 1100 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, thecommunication component 1116 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, thecommunication component 1116 also includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, theapparatus 1100 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program which, when executed by a processor, implements the resource package management method as in any one of the above. The computer-readable storage medium may be, for example, transitory and non-transitory computer-readable storage media including instructions.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.