Disclosure of Invention
The invention aims to at least solve one of the technical problems in the prior art, and provides a method, a device and a medium for reducing the redundancy of a bundle dependent chain, so that the redundancy of the bundle dependent chain is reduced, the memory occupation and the loading time are reduced, and the game running efficiency is improved.
The technical scheme of the invention includes that the method for rapidly splitting non-reference relation resources is characterized by comprising the steps of S100, obtaining a Unity 3D-based engineering resource list, setting identification bits in each resource, simultaneously creating a dynamic identification, S200, generating a recursion reference resource list of corresponding resources each time when the resources are taken out of an engineering, writing corresponding resource flag bits into the recursion reference resource list, S300, traversing the recursion reference resource list, modifying the resource identification bits according to the reference relation of the resources, and dynamically adjusting the dynamic identification, S400, repeating the steps S200-S300 until the resources in the resource list are marked, S500, determining the quantity of the non-reference relation of the resources according to the quantity of the identification bits of all the resources, and packing the engineering resources by using a plurality of corresponding threads according to the quantity of the non-reference relation of the resources.
The method for rapidly splitting the non-reference relation resources comprises the following steps of traversing all resources in an engineering, obtaining all resource lists, setting an identification bit for each resource, wherein the identification bit is default to 0, and setting a dynamic identification, and the dynamic identification bit is default to 1.
The method for rapidly splitting the non-reference relation resource comprises the steps of S310, taking out the resource, searching all the recursion reference resource lists of the resource, adding information of the resource into the recursion reference resource list, S320, judging whether an identification bit is 0 for each taken out resource through the recursion reference resource list processed by S310, if the identification bit of the resource is 0, setting the identification bit of the resource as a current dynamic identification value directly, and if the identification bit of the resource is not 0, searching the resource corresponding to the resource list according to the identification bit value of the resource, modifying the identification bit of the searched resource as the dynamic identification value, and then carrying out self-increment on the dynamic identification.
According to the method for rapidly splitting the non-reference relation resource, the engineering resource list is read sequentially.
The method for rapidly splitting the non-reference relation resources comprises the following steps of S500, obtaining the zone bits of all the resources obtained through S400, determining the quantity of the non-reference relation according to the values of the zone bits of the resources and the values of the dynamic identifications, and packaging the corresponding resources by using the threads with the corresponding quantity.
The technical scheme of the invention also comprises a device for rapidly splitting non-reference relation resources, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, and is characterized in that any one of the method steps is realized when the processor executes the computer program.
The technical solution of the present invention further comprises a computer-readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method steps according to any one of the claims.
The method has the beneficial effects that under the condition of increasing the Bundle redundancy, the Bundle packing speed is increased, and the fast Bundle discharging verification effect of the project is facilitated.
Detailed Description
Reference will now be made in detail to the present embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein the accompanying drawings are used to supplement the description of the written description so that one can intuitively and intuitively understand each technical feature and overall technical scheme of the present invention, but not to limit the scope of the present invention.
In the description of the present invention, a number means one or more, a number means two or more, and greater than, less than, exceeding, etc. are understood to not include the present number, and above, below, within, etc. are understood to include the present number.
In the description of the present invention, the continuous reference numerals of the method steps are used for facilitating examination and understanding, and by combining the overall technical scheme of the present invention and the logic relationships between the steps, the implementation sequence between the steps is adjusted without affecting the technical effect achieved by the technical scheme of the present invention.
In the description of the present invention, unless explicitly defined otherwise, terms such as arrangement and the like should be construed broadly, and those skilled in the art can reasonably determine the specific meaning of the terms in the present invention in combination with the specific contents of the technical scheme.
FIG. 1 shows a general flow chart according to an embodiment of the invention, which comprises S100, obtaining a Unity 3D-based engineering resource list, setting an identification bit in each resource, creating a dynamic identification at the same time, S200, generating a recursively referenced resource list of the corresponding resource each time the resource is taken out from the engineering, writing the corresponding resource flag bit into the recursively referenced resource list, S300, traversing the recursively referenced resource list, modifying the resource identification bit according to the referencing relation of the resource, dynamically adjusting the dynamic identification, S400, repeating steps S200-S300 until all the resources in the resource list are marked, S500, determining the number of the resources without referencing relation with each other according to the number of the identification bits of all the resources, and packaging the engineering resources by using a plurality of corresponding threads according to the number of the resources without referencing relation with each other.
FIG. 2 is a schematic flow diagram of splitting non-reference resources according to an embodiment of the invention, including:
(1) Firstly, traversing all resources in an engineering to obtain a whole resource list, setting an identification bit ASSETFLAG for each resource, marking the default as 0, and setting a dynamic mark as BundleFlag (default as 1);
(2) Traversing the list one by one, and taking out a resource Itor _asset_A according to list sequence;
(3) After one resource is fetched, called Itor _asset_a, all recursively referenced resource lists asset_a_ DEPENDECNLIST of Itor _ Aaset _a are first searched, and Itor _asset_a is also added to Itor _asset_a recursively referenced resource list asset_a_ DEPENDECNLIST, asset_a_ DEPENDECNLIST contains itself for all recursively referenced resources of asset_a;
(4) Traversing asset_a_ DEPENDECNLISTT again, for fetching each Asset Itor _asset_ DEPENDECNLIST _x, firstly judging whether the identification bit ASSETFLAG of Itor _asset_ DEPENDECNLIST _x is 0, if the identification bit ASSETFLAG is not temporarily referenced by other assets, setting the Asset identification bit as current BundleFlag directly, if the identification bit ASSETFLAG is not 0, and if the Asset is referenced by other assets, dividing the assets, assuming that the identification bit ASSETFLAG of Itor _asset_ DEPENDECNLIST _x is N, finding out the Asset list NASSETLIST of all the identification bits N, setting the identification bit of all the assets in NASSETLIST as BundleFlag, and then performing self-increment on BundleFlag (BundleFlag = BundleFlag +1);
(5) Sequentially taking out the second resource, and repeating the steps (3) - (4) until all the resources are marked;
(6) The number of the flag bits of all the resources is obtained, namely the number of the flag bits can be divided into a plurality of parts which are not related with each other, and the flag bits are packaged in a plurality of processes, for example, only 0,2,55 kinds of flag bits can be divided into 3 parts, and the flag bits are packaged in 3 processes.
Fig. 3 shows a device diagram according to an embodiment of the invention. The device comprises a memory 100 and a processor 200, wherein the processor 200 stores a computer program for executing the steps of obtaining a Unity 3D-based engineering resource list, setting identification bits in each resource, creating a dynamic identification at the same time, generating a recursion reference resource list of the corresponding resource each time the resource is taken out from the engineering, writing the corresponding resource flag bits into the recursion reference resource list, traversing the recursion reference resource list, modifying the resource identification bits according to the reference relation of the resource, dynamically adjusting the dynamic identification, repeating until all the resources in the resource list are marked, determining the number of the resources without reference relation according to the number of the identification bits of all the resources, and packing the engineering resources by using a plurality of corresponding threads according to the number of the resources without reference relation. Wherein the memory 100 is used for storing data.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge of one of ordinary skill in the art without departing from the spirit of the present invention.