A platform switching method and device

By backing up the library file directory of Unity project in different system platforms and switching with soft links, the problem of low switching rate of Unity project between different platforms is solved, the development efficiency and installation package generation rate are improved, and the storage space occupation is reduced.

CN112162881BActive Publication Date: 2024-12-20ZHENGZHOU APUS DIGITAL CLOUD INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010919663.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-04
Publication Date
2024-12-20
Estimated Expiration
2040-09-04

Smart Images

  • Figure CN112162881B_ABST
    Figure CN112162881B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a platform switching method and device, which relates to the field of computer technology, wherein the method includes: backing up the library file directory of the Unity project to be processed in different system platforms to obtain the backup directory corresponding to each system platform; if a first switching instruction is received when the Unity project is running in the current system platform, the target backup directory corresponding to the target system platform to be switched is determined according to the first switching instruction; the determined target backup directory is accessed by soft linking, and the Unity project is run based on the accessed target backup directory to achieve switching from the current system platform to the target system platform. Through the embodiment of the present application, the switching rate of the Unity project between different system platforms is improved, thereby improving the development efficiency and the generation rate of the corresponding installation package.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a platform switching method and device. Background Art

[0002] With the continuous improvement of science and technology, the game industry has developed rapidly in recent years, and Unity is one of the important tools for game development. Usually, game developers will release game installation packages suitable for different system platforms. Therefore, in the process of developing games through Unity and when packaging after development, it is necessary to switch between different system platforms. Currently, Unity switches between different system platforms mainly in the following ways: the first way is to re-convert the resources required by the Unity project each time it switches to generate resources and files in a recognizable format; the second way is to back up multiple projects for the same game project, and each project corresponds to an operating system. However, in the first way, each time the platform is switched, the resource conversion needs to be performed, which makes the platform switching rate low, which is not conducive to the rapid generation of the installation package; and in the second way, when the code needs to be modified, multiple modifications need to be made simultaneously, which affects the development efficiency and takes up too much storage space. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a platform switching method and device to improve the switching rate of Unity projects between different system platforms, thereby improving development efficiency and the generation rate of corresponding installation packages.

[0004] In a first aspect, an embodiment of the present application provides a station switching method, including:

[0005] Backing up the library file directory of the Unity project to be processed in different system platforms to obtain a backup directory corresponding to each system platform; wherein the library file directory includes data files required for the Unity project to run in the corresponding system platform;

[0006] If a first switching instruction is received when the Unity project is running in the current system platform, determining a target backup directory corresponding to the target system platform to be switched according to the first switching instruction;

[0007] Access the target backup directory by means of soft links;

[0008] The Unity project is run based on the accessed target backup directory to implement switching from the current system platform to the target system platform.

[0009] In a second aspect, an embodiment of the present application provides a platform switching device, including:

[0010] A backup module, used to perform backup processing on the library file directory of the Unity project to be processed in different system platforms, and obtain a backup directory corresponding to each system platform; wherein the library file directory includes data files required for the Unity project to run in the corresponding system platform;

[0011] A determination module, configured to determine a target backup directory corresponding to a target system platform to be switched according to the first switching instruction if a first switching instruction is received when the Unity project is running in the current system platform;

[0012] An access module, used to access the target backup directory by means of a soft link;

[0013] A running module is used to run the Unity project based on the accessed target backup directory to achieve switching from the current system platform to the target system platform.

[0014] In a third aspect, an embodiment of the present application provides a platform switching device, comprising: a processor; and a memory arranged to store computer executable instructions, wherein the computer executable instructions, when executed, enable the processor to implement the steps of the above-mentioned platform switching method.

[0015] In a fourth aspect, an embodiment of the present application provides a storage medium for storing computer-executable instructions, which implement the steps of the above-mentioned platform switching method when executed.

[0016] The platform switching method and device provided in the embodiment of the present application back up the library file directory of the Unity project to be processed in different system platforms to obtain the backup directory corresponding to each system platform; and if a first switching instruction is received when the Unity project is running in the current system platform, the target backup directory corresponding to the target system platform to be switched is determined according to the first switching instruction; the determined target backup directory is accessed by soft linking, and the Unity project is run based on the accessed target backup directory to achieve switching from the current system platform to the target system platform. Thus, the Unity project is switched between different system platforms based on the backup directory and soft linking, without the need to convert resources to update data files each time the system platform is switched, and there is no need to back up multiple Unity projects, which not only reduces the storage space occupied, but also improves the switching rate and development efficiency of the Unity project between different system platforms, thereby improving the generation rate of the corresponding installation package. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate one or more embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0018] Figure 1 A schematic diagram of a scenario of a platform switching method provided in an embodiment of the present application;

[0019] Figure 2 A first flow chart of a platform switching method provided in an embodiment of the present application;

[0020] Figure 3 A second flow chart of a platform switching method provided in an embodiment of the present application;

[0021] Figure 4 A third flow chart of a platform switching method provided in an embodiment of the present application;

[0022] Figure 5 A fourth flow chart of a platform switching method provided in an embodiment of the present application;

[0023] Figure 6 A schematic diagram of the module composition of a platform switching device provided in an embodiment of the present application;

[0024] Figure 7 A schematic diagram of the structure of a platform switching device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0026] Figure 1 A schematic diagram of an application scenario of a platform switching method provided in an embodiment of the present application, taking Windows, Android, and IOS as examples, such as Figure 1As shown, the platform switching device backs up the library file directory of the Unity project to be processed in the Windows, Android, and IOS system platforms, respectively, and obtains the backup directory 1, backup directory 2, and backup directory 3 corresponding to each system platform as an example; wherein the library file directory includes the data files required for the Unity project to run in the corresponding system platform, such as files in a specific format that can be recognized by Unity in the corresponding system platform, atlases, shader (Shader) cache, DLL (Dynamic Link Library) files obtained by converting program codes, etc. Take the current system platform as the Windows system platform and the target system platform to be converted as the Android system platform as an example for explanation, if the first switching instruction to switch to the Android system platform is received when the Unity project is running in the Windows system platform, the target backup directory corresponding to the Android system platform to be switched is determined to be the backup directory 2 according to the first switching instruction; the determined backup directory 2 is accessed by soft linking, and the Unity project is run in the Android system platform based on the accessed backup directory 2, so as to realize the switch from the Windows system platform to the Android system platform. Therefore, the Unity project can be switched between different system platforms based on the backup directory and soft link method, without the need to convert resources to update data files every time the system platform is switched, and there is no need to back up multiple Unity projects. This not only reduces the storage space occupied, but also improves the switching speed of the Unity project between different system platforms and the development efficiency, thereby improving the generation rate of the corresponding installation package.

[0027] Based on the above application scenario architecture, the present application embodiment provides a platform switching method. Figure 2 A flow chart of a platform switching method provided in an embodiment of the present application is provided. Figure 2 The method in can be Figure 1 The platform switching device in the implementation, such as Figure 2 As shown, the method comprises the following steps:

[0028] Step S102, backing up the library file directory of the Unity project to be processed in different system platforms to obtain a backup directory corresponding to each system platform; wherein the library file directory includes data files required for the Unity project to run in the corresponding system platform;

[0029] Among them, the Unity project can be a project to be created or a project that has been created; the specific type of the Unity project can be set according to the actual application needs, such as a game project project, etc. System platforms include Windows, Android, IOS, Mac and other system platforms. Library file directories such as the Library directory. Specifically, the root directory of the Unity project mainly includes three directories: Assets, Library, and ProjectSettings; Among them, the Assets directory includes the resources required for the Unity project. Taking the Unity project as a game project as an example, the Assets directory includes resources such as models, actions, scenes, videos, audios, scripts, prefabs, etc.; the Library directory includes data files required for the Unity project to run, such as files in a specific format that can be recognized by Unity in the corresponding system platform obtained by converting the aforementioned actions, scenes and other resources, shader (Shader) cache, image sets, DLL files obtained by converting program codes such as scripts, etc.; the ProjectSettings directory includes setting options for each system platform, etc.

[0030] Step S104, if a first switching instruction is received when the Unity project is running in the current system platform, a target backup directory corresponding to the target system platform to be switched is determined according to the first switching instruction;

[0031] Among them, the current system platform can be any platform among Windows, Android, IOS, Mac and other system platforms. When running the Unity project in the current system platform, when developers need to switch the system platform, they can enter the switching information in the specified location in the development interface and submit the input switching information to send a first switching instruction to the platform switching device; when the platform switching device obtains the first switching instruction, it determines the target system platform and the target backup directory corresponding to the target system platform according to the switching information included in the first switching instruction.

[0032] Step S106, accessing the target backup directory by means of a soft link;

[0033] Step S108: running the Unity project based on the accessed target backup directory to implement switching from the current system platform to the target system platform.

[0034] In an embodiment of the present application, by backing up the library file directory of the Unity project to be processed in different system platforms, a backup directory corresponding to each system platform is obtained; and, when the Unity project is run in the current system platform, if a first switching instruction is received, the target backup directory corresponding to the target system platform to be switched is determined according to the first switching instruction; the determined target backup directory is accessed by means of soft links, and the Unity project is run based on the accessed target backup directory to achieve switching from the current system platform to the target system platform. Thus, the Unity project is switched between different system platforms based on the backup directory and soft links, without the need to convert resources to update data files each time the system platform is switched, and without the need to back up multiple Unity projects, which not only reduces the storage space occupied, but also improves the switching rate and development efficiency of the Unity project between different system platforms, thereby improving the generation rate of the corresponding installation package.

[0035] In order to realize the fast switching of Unity project between different system platforms, in the embodiment of the present application, the library file directory of Unity project is first backed up in different system platforms, specifically, Figure 3 As shown, step S102 includes:

[0036] Step S1022, loading the Unity project to be processed in different system platforms to obtain the library file directory of the Unity project in the corresponding system platform; wherein the different system platforms are switched based on the second switching instruction;

[0037] Step S1024, creating a first directory under the specified path of each system platform, copying the data files in the corresponding library file directory to the corresponding first directory, and determining the first directory including the data files as the backup directory corresponding to the corresponding system platform.

[0038] Specifically, a corresponding backup directory can be created when a Unity project is loaded for the first time in each system platform. That is, first, the Unity project to be processed is loaded in the first system platform (such as the Windows system platform) to obtain the library file directory of the Unity project in the first system platform; and a first directory is created under the specified path of the first system platform, and the data files in the library file directory of the Unity project in the first system platform are copied to the created first directory, and the first directory including the data files is determined as the backup directory corresponding to the first system platform. Then, the developer or the control module connected to the platform switching device can send a second switching instruction to the platform switching device. When the platform switching device receives the second switching instruction, the second system platform to be switched (such as the IOS system platform) is determined according to the switching information included in the second switching instruction, and the system platform is switched, that is, the Unity project to be processed is loaded in the second system platform to obtain the library file directory of the Unity project in the second system platform; and a first directory is created under the specified path of the second system platform, and the data files in the library file directory of the Unity project in the second system platform are copied to the created first directory, and the first directory including the data files is determined as the backup directory corresponding to the second system platform. At this time, the developer or the control module connected to the platform switching device can send a second switching instruction to the platform switching device. When the platform switching device receives the second switching instruction, it creates a backup directory corresponding to the third system platform to be switched in the above manner, and so on, until the backup directory corresponding to each system platform is obtained, so that fast switching between different system platforms can be performed based on the backup directory. It should be pointed out that the specified paths in different system platforms can be the same or different, and they can be set according to needs in actual applications.

[0039] Furthermore, since the above operation of creating a backup directory is performed when the Unity project is first loaded in the corresponding system platform, and there is no backup directory at this time, it is necessary to perform resource conversion processing when the system platform is switched. Figure 4 As shown, step S1022 includes the following steps S1022-2 to S1022-6:

[0040] Step S1022-2, loading the resources of the Unity project to be processed in different system platforms;

[0041] Specifically, the resources in the Assets directory of the Unity project to be processed are loaded and processed in different system platforms; wherein, the resources of the Unity project can be set according to the type of the Unity project in actual application. Taking the Unity project as a game project as an example, the models, actions, scenes, videos, audios, scripts, prefabs and other resources of the Unity project to be processed are loaded and processed in different system platforms.

[0042] Step S1022-4, generating a data file of the Unity project in the corresponding system platform according to the loaded resources;

[0043] For example, a file of a specific format that can be recognized by the Unity project on the corresponding platform system is generated based on the above-mentioned models, actions, scenes and other resources, and a DLL file is obtained by converting the program code such as scripts. It should be pointed out that when the resources of the Unity project are loaded into Unity, these resources are not changed, but data files that can be run and processed by the corresponding system platform are generated based on the resources based on preset rules, so as to generate the corresponding library file directory based on the generated data files.

[0044] Step S1022-6, generating a library file directory of the Unity project in the corresponding system platform according to the generated data file.

[0045] Specifically, if the current system platform is the first system platform to load the Unity project, an empty directory is created, and the generated data files are saved in the created empty directory to obtain the library file directory of the current system platform; if the current system platform is not the first system platform to load the Unity project, the existing data files in the current library file directory are deleted, and the currently generated data files are saved in the library file directory to obtain the library file directory of the current system platform; wherein, the data files in the current library file directory are the data files of the Unity project in the previous system platform of the current system platform.

[0046] Still using the above example for illustration, when the data files of the Unity project in the first system platform (such as the Windows system platform) are generated according to the loaded resources, an empty directory is created, and the generated data files are saved in the empty directory, and the library file directory of the Unity project in the first system platform is obtained. When the data files of the Unity project in the second system platform (such as the IOS system platform) are generated according to the loaded resources, the data files in the first system platform included in the current library file directory are deleted, and the data files currently generated in the second system platform are saved in the library file directory, and the library file directory of the second system platform is obtained. When switching from the second system platform to the third system platform, the method of generating the library file directory in the third system platform is the same as the method of generating the library file directory in the second system platform, and so on, so they are not listed one by one.

[0047] It should be pointed out that when the current system platform is the first system platform to load the Unity project, the operation of creating an empty directory can be executed before the operation of generating the data file, and can also be executed after the operation of generating the data file, or can be executed at the same time; when the current system platform is not the first system platform to load the Unity project, the operation of generating the data file can be executed before the operation of deleting the data file in the library file directory, and can also be executed after the operation of deleting the data file in the library file directory, and can also be executed simultaneously with the operation of deleting the data file in the library file directory; no specific limitation is made in the embodiments of the present application.

[0048] Therefore, when the Unity project is loaded for the first time in each system platform, the resources are converted to generate data files, and the library file directory of the Unity project in each system platform is generated based on the data files, and a backup directory of the library file directory is created, so that when switching between different system platforms in the future, it can be quickly switched based on the backup directory. In addition, compared with backing up multiple projects for the same Unity project, creating a backup directory saves storage space because the data in the backup directory is much smaller than the complete data of the Unity project.

[0049] In order to enable the Unity project to quickly switch between different system platforms based on the backup directory, in one or more embodiments of this specification, the switching information in the first switching instruction includes the directory information of the target backup directory. Figure 5 As shown, step S104 includes the following steps S1042:

[0050] Step S1042: If a first switching instruction is received when the Unity project is running in the current system platform, path information is obtained from the first switching instruction, and a backup directory corresponding to the obtained path information is determined as a target backup directory corresponding to the target system platform to be switched.

[0051] Specifically, the switching information in the first switching instruction includes the platform information of the target system platform and the directory information of the target backup directory; when the platform switching device receives the first switching instruction, it obtains the platform information and directory information from the switching information included in the first switching instruction, determines the target system platform according to the platform information, and determines the target backup directory according to the directory information. Among them, the platform information includes platform identification, platform name, etc.; the directory information includes path information of the location of the target backup directory, etc. It should be pointed out that if the Unity project is run for the first time in the current system platform, the Unity project is run based on the library file directory of the Unity project in the current system platform; if it is not the first time to run the Unity project in the current system platform, the Unity project is run based on the backup directory corresponding to the current system platform.

[0052] Corresponding to step S1042, Figure 5 As shown, step S106 includes the following steps S1062:

[0053] Step S1062: According to the acquired path information, a soft link is established to the target backup directory through an access instruction corresponding to the current system platform.

[0054] As an example, if the current system platform is a Windows system platform, the access instruction is the mklink command; if the current system platform is a Mac system platform, the access instruction is the Ln command, etc.

[0055] Therefore, after obtaining the backup directory of the target system platform, by specifying the path information of the target backup directory in the first switching instruction, the platform switching device can quickly link from the library file directory or backup directory of the current system to the target backup directory corresponding to the target system platform through a soft link according to the path information, thereby running the Unity project based on the data files in the target backup directory; there is no need to load resources and generate data files again, thereby greatly improving the switching efficiency of the system platform.

[0056] In order to better understand the technical solution of the present application, the following is further explained by taking switching between the IOS system platform and the Windows system platform as an example, which may include the following steps:

[0057] Step S202, loading the resources of the preset Unity project in the IOS system platform;

[0058] Step S204, generating a data file of the Unity project in the IOS system platform according to the loaded resources;

[0059] Step S206, creating an empty directory, saving the generated data file in the empty directory, obtaining a library file directory of the Unity project in the IOS system platform, and running the Unity project in the IOS system platform based on the library file directory;

[0060] Step S208, creating a first directory under the specified path of the IOS system platform, copying the data files of the Unity project in the library file directory of the IOS system platform to the first directory created, and determining the first directory including the data files as the backup directory corresponding to the IOS system platform;

[0061] For example, the backup directory corresponding to the IOS system platform is the IosLibrary directory

[0062] Step S210, receiving a second switching instruction in the IOS system platform, and determining that the target system platform to be switched is the Windows system platform according to the second switching instruction;

[0063] For example, the second switching instruction includes the platform name Windows.

[0064] Step S212, loading the pre-set Unity project resources in the Windows system platform;

[0065] Step S214, generating a data file of the Unity project in the Windows system platform according to the loaded resources;

[0066] Step S216, deleting the data files in the current library file directory, and saving the generated data files in the library file directory, obtaining the library file directory of the Unity project in the Windows system platform, and running the Unity project in the Windows system platform based on the library file directory;

[0067] Specifically, the data files in the IOS system platform included in the current library file directory are deleted, and the data files generated in the Windows system platform are saved in the library file directory to obtain the library file directory of the Unity project in the Windows system platform, and the Unity project is run in the Windows system platform based on the library file directory.

[0068] Step S218, creating a first directory under the specified path of the Windows system platform, copying the data files of the Unity project in the library file directory of the Windows system platform to the first directory created, and determining the first directory including the data files as the backup directory corresponding to the Windows system platform;

[0069] For example, the backup directory corresponding to the Windows system platform is the WindowsLibrary directory.

[0070] Step S220, receiving a first switching instruction in the Windows system platform, and determining that the target system platform to be switched is the IOS system platform according to the first switching instruction;

[0071] Step S222, obtaining path information from the first switching instruction, determining the backup directory corresponding to the obtained path information as the target backup directory; and soft linking to the target backup directory based on the preset access instruction according to the obtained path information;

[0072] For example, based on the mklink instruction, a soft link is created to the target backup directory whose directory name is IosLibrary.

[0073] Step S224, running the Unity project based on the target backup directory to achieve switching from the Windows system platform to the IOS system platform.

[0074] In an embodiment of the present application, by backing up the library file directory of the Unity project to be processed in different system platforms, a backup directory corresponding to each system platform is obtained; and, when the Unity project is run in the current system platform, if a first switching instruction is received, the target backup directory corresponding to the target system platform to be switched is determined according to the first switching instruction; and the determined target backup directory is accessed by means of soft links, and the Unity project is run based on the accessed target backup directory to achieve switching from the current system platform to the target system platform. Thus, the Unity project is switched between different system platforms based on the backup directory and soft links, without the need to convert resources to update data files each time the system platform is switched, and without the need to back up multiple Unity projects, which not only reduces the storage space occupied, but also improves the switching rate and development efficiency of the Unity project between different system platforms, thereby improving the generation rate of the corresponding installation package.

[0075] Furthermore, corresponding to the above Figures 2 to 5 The platform switching method described is based on the same technical concept, and an embodiment of the present application also provides a platform switching device. Figure 6A schematic diagram of the module composition of a platform switching device provided in an embodiment of the present application, the device is used to perform Figures 2 to 5 The platform switching method described in Figure 6 As shown, the device comprises:

[0076] The backup module 301 is used to perform backup processing on the library file directory of the Unity project to be processed in different system platforms to obtain a backup directory corresponding to each system platform; wherein the library file directory includes data files required for the Unity project to run in the corresponding system platform;

[0077] A determination module 302 is configured to determine a target backup directory corresponding to a target system platform to be switched according to the first switching instruction if a first switching instruction is received when the Unity project is running in the current system platform;

[0078] Access module 303, used to access the target backup directory through soft link;

[0079] The running module 304 is used to run the Unity project based on the accessed target backup directory to achieve switching from the current system platform to the target system platform.

[0080] In an embodiment of the present application, by backing up the library file directory of the Unity project to be processed in different system platforms, a backup directory corresponding to each system platform is obtained; and if a first switching instruction is received when the Unity project is running in the current system platform, the target backup directory corresponding to the target system platform to be switched is determined according to the first switching instruction; the determined target backup directory is accessed by means of soft links, and the Unity project is run based on the accessed target backup directory to achieve switching from the current system platform to the target system platform. Thus, the Unity project is switched between different system platforms based on the backup directory and soft links, without the need to convert resources to update data files each time the system platform is switched, and there is no need to back up multiple Unity projects, which not only reduces the storage space occupied, but also improves the switching rate and development efficiency of the Unity project between different system platforms, thereby improving the generation rate of the corresponding installation package.

[0081] Optionally, the backup module 301 is specifically used for:

[0082] Loading the Unity project in different system platforms to obtain a library file directory of the Unity project in the corresponding system platform; wherein the different system platforms are switched based on a second switching instruction;

[0083] A first directory is created under a specified path of each system platform, the data files in the library file directory are copied to the corresponding first directory, and the first directory including the data files is determined as a backup directory corresponding to the corresponding system platform.

[0084] Optionally, the backup module 301 is further specifically configured to:

[0085] Loading the resources of the Unity project in different system platforms;

[0086] Generate a data file of the Unity project in a corresponding system platform according to the loaded resources;

[0087] Generate a library file directory of the Unity project in the corresponding system platform according to the data file.

[0088] Optionally, the backup module 301 is further specifically configured to:

[0089] If the current system platform is the first system platform to load the Unity project, create an empty directory, save the data file in the empty directory, and obtain the library file directory of the current system platform;

[0090] If the current system platform is not the first system platform to load the Unity project, the data file in the library file directory is deleted, and the currently generated data file is saved in the library file directory to obtain the library file directory of the current system platform; wherein, the data file in the current library file directory is the data file of the Unity project in the previous system platform of the current system platform.

[0091] Optionally, the determining module 302 is specifically configured to:

[0092] Path information is obtained from the first switching instruction, and a backup directory corresponding to the obtained path information is determined as a target backup directory corresponding to the target system platform.

[0093] Optionally, the access module 303 is specifically used to:

[0094] According to the path information, a soft link is established to the target backup directory through an access instruction corresponding to the current system platform.

[0095] The platform switching device provided in the embodiment of the present application obtains the backup directory corresponding to each system platform by backing up the library file directory of the Unity project to be processed in different system platforms; and if a first switching instruction is received when the Unity project is running in the current system platform, the target backup directory corresponding to the target system platform to be switched is determined according to the first switching instruction; the determined target backup directory is accessed by soft linking, and the Unity project is run based on the accessed target backup directory to achieve switching from the current system platform to the target system platform. Thus, the Unity project is switched between different system platforms based on the backup directory and soft linking, without the need to convert resources to update data files each time the system platform is switched, and there is no need to back up multiple Unity projects, which not only reduces the storage space occupied, but also improves the switching rate and development efficiency of the Unity project between different system platforms, thereby improving the generation rate of the corresponding installation package.

[0096] It should be noted that the embodiment of the platform switching device in the present application and the embodiment of the platform switching method in the present application are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding platform switching method mentioned above, and the repeated parts will not be repeated.

[0097] Further, corresponding to the platform switching method described above, based on the same technical concept, an embodiment of the present application also provides a platform switching device, which is used to execute the platform switching method described above. Figure 7 A schematic diagram of the structure of a platform switching device provided in an embodiment of the present application.

[0098] like Figure 7 As shown, the platform switching device may have relatively large differences due to different configurations or performances, and may include one or more processors 401 and memory 402, and the memory 402 may store one or more storage applications or data. Among them, the memory 402 may be a short-term storage or a persistent storage. The application stored in the memory 402 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the platform switching device. Furthermore, the processor 401 may be configured to communicate with the memory 402 and execute a series of computer executable instructions in the memory 402 on the platform switching device. The platform switching device may also include one or more power supplies 403, one or more wired or wireless network interfaces 404, one or more input and output interfaces 405, one or more keyboards 406, etc.

[0099] In a specific embodiment, the platform switching device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the platform switching device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:

[0100] Backing up the library file directory of the Unity project to be processed in different system platforms to obtain a backup directory corresponding to each system platform; wherein the library file directory includes data files required for the Unity project to run in the corresponding system platform;

[0101] If a first switching instruction is received when the Unity project is running in the current system platform, determining a target backup directory corresponding to the target system platform to be switched according to the first switching instruction;

[0102] Access the target backup directory by means of soft links;

[0103] The Unity project is run based on the accessed target backup directory to implement switching from the current system platform to the target system platform.

[0104] In an embodiment of the present application, by backing up the library file directory of the Unity project to be processed in different system platforms, a backup directory corresponding to each system platform is obtained; and if a first switching instruction is received when the Unity project is running in the current system platform, the target backup directory corresponding to the target system platform to be switched is determined according to the first switching instruction; the determined target backup directory is accessed by means of soft links, and the Unity project is run based on the accessed target backup directory to achieve switching from the current system platform to the target system platform. Thus, the Unity project is switched between different system platforms based on the backup directory and soft links, without the need to convert resources to update data files each time the system platform is switched, and there is no need to back up multiple Unity projects, which not only reduces the storage space occupied, but also improves the switching rate and development efficiency of the Unity project between different system platforms, thereby improving the generation rate of the corresponding installation package.

[0105] Optionally, when the computer executable instruction is executed, the library file directories of the Unity project to be processed are backed up in different system platforms to obtain a backup directory corresponding to each system platform, including:

[0106] Loading the Unity project in different system platforms to obtain a library file directory of the Unity project in the corresponding system platform; wherein the different system platforms are switched based on a second switching instruction;

[0107] A first directory is created under a specified path of each system platform, the data files in the library file directory are copied to the corresponding first directory, and the first directory including the data files is determined as a backup directory corresponding to the corresponding system platform.

[0108] Optionally, when the computer executable instruction is executed, the Unity project is loaded in different system platforms to obtain a library file directory of the Unity project in the corresponding system platform, including:

[0109] Loading the resources of the Unity project in different system platforms;

[0110] Generate a data file of the Unity project in a corresponding system platform according to the loaded resources;

[0111] Generate a library file directory of the Unity project in the corresponding system platform according to the data file.

[0112] Optionally, when the computer executable instruction is executed, generating a library file directory of the Unity project in a corresponding system platform according to the data file includes:

[0113] If the current system platform is the first system platform to load the Unity project, create an empty directory, save the data file in the empty directory, and obtain the library file directory of the current system platform;

[0114] If the current system platform is not the first system platform to load the Unity project, the data file in the library file directory is deleted, and the currently generated data file is saved in the library file directory to obtain the library file directory of the current system platform; wherein, the data file in the current library file directory is the data file of the Unity project in the previous system platform of the current system platform.

[0115] Optionally, when the computer executable instruction is executed, determining the target backup directory corresponding to the target system platform to be switched according to the first switching instruction includes:

[0116] Path information is obtained from the first switching instruction, and a backup directory corresponding to the obtained path information is determined as a target backup directory corresponding to the target system platform.

[0117] Optionally, when the computer executable instruction is executed, accessing the target backup directory by means of a soft link includes:

[0118] According to the path information, a soft link is established to the target backup directory through an access instruction corresponding to the current system platform.

[0119] The platform switching device provided in the embodiment of the present application obtains the backup directory corresponding to each system platform by backing up the library file directory of the Unity project to be processed in different system platforms; and if a first switching instruction is received when the Unity project is running in the current system platform, the target backup directory corresponding to the target system platform to be switched is determined according to the first switching instruction; the determined target backup directory is accessed by soft linking, and the Unity project is run based on the accessed target backup directory to achieve switching from the current system platform to the target system platform. Thus, the Unity project is switched between different system platforms based on the backup directory and soft linking, without the need to convert resources to update data files each time the system platform is switched, and there is no need to back up multiple Unity projects, which not only reduces the storage space occupied, but also improves the switching rate and development efficiency of the Unity project between different system platforms, thereby improving the generation rate of the corresponding installation package.

[0120] It should be noted that the embodiment of the platform switching device in the present application and the embodiment of the platform switching method in the present application are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding platform switching method mentioned above, and the repeated parts will not be repeated.

[0121] Further, corresponding to the platform switching method described above, based on the same technical concept, one or more embodiments of the present application further provide a storage medium for storing computer executable instructions. In a specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer executable instructions stored in the storage medium are executed by the processor, the following process can be implemented:

[0122] Backing up the library file directory of the Unity project to be processed in different system platforms to obtain a backup directory corresponding to each system platform; wherein the library file directory includes data files required for the Unity project to run in the corresponding system platform;

[0123] If a first switching instruction is received when the Unity project is running in the current system platform, determining a target backup directory corresponding to the target system platform to be switched according to the first switching instruction;

[0124] Access the target backup directory by means of soft links;

[0125] The Unity project is run based on the accessed target backup directory to implement switching from the current system platform to the target system platform.

[0126] In an embodiment of the present application, by backing up the library file directory of the Unity project to be processed in different system platforms, a backup directory corresponding to each system platform is obtained; and if a first switching instruction is received when the Unity project is running in the current system platform, the target backup directory corresponding to the target system platform to be switched is determined according to the first switching instruction; the determined target backup directory is accessed by means of soft links, and the Unity project is run based on the accessed target backup directory to achieve switching from the current system platform to the target system platform. Thus, the Unity project is switched between different system platforms based on the backup directory and soft links, without the need to convert resources to update data files each time the system platform is switched, and there is no need to back up multiple Unity projects, which not only reduces the storage space occupied, but also improves the switching rate and development efficiency of the Unity project between different system platforms, thereby improving the generation rate of the corresponding installation package.

[0127] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, the library file directories of the Unity project to be processed are backed up in different system platforms to obtain a backup directory corresponding to each system platform, including:

[0128] Loading the Unity project in different system platforms to obtain a library file directory of the Unity project in the corresponding system platform; wherein the different system platforms are switched based on a second switching instruction;

[0129] A first directory is created under a specified path of each system platform, the data files in the library file directory are copied to the corresponding first directory, and the first directory including the data files is determined as a backup directory corresponding to the corresponding system platform.

[0130] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, the Unity project is loaded in different system platforms to obtain a library file directory of the Unity project in the corresponding system platform, including:

[0131] Loading the resources of the Unity project in different system platforms;

[0132] Generate a data file of the Unity project in a corresponding system platform according to the loaded resources;

[0133] Generate a library file directory of the Unity project in the corresponding system platform according to the data file.

[0134] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, generating a library file directory of the Unity project in a corresponding system platform according to the data file includes:

[0135] If the current system platform is the first system platform to load the Unity project, create an empty directory, save the data file in the empty directory, and obtain the library file directory of the current system platform;

[0136] If the current system platform is not the first system platform to load the Unity project, the data file in the library file directory is deleted, and the currently generated data file is saved in the library file directory to obtain the library file directory of the current system platform; wherein, the data file in the current library file directory is the data file of the Unity project in the previous system platform of the current system platform.

[0137] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, determining the target backup directory corresponding to the target system platform to be switched according to the first switching instruction includes:

[0138] Path information is obtained from the first switching instruction, and a backup directory corresponding to the obtained path information is determined as a target backup directory corresponding to the target system platform.

[0139] Optionally, when the computer executable instructions stored in the storage medium are executed by the processor, accessing the target backup directory by means of a soft link includes:

[0140] According to the path information, a soft link is established to the target backup directory through an access instruction corresponding to the current system platform.

[0141] The computer executable instructions stored in the storage medium provided in the embodiment of the present application are executed by the processor, by backing up the library file directory of the Unity project to be processed in different system platforms, to obtain the backup directory corresponding to each system platform; and if a first switching instruction is received when the Unity project is running in the current system platform, the target backup directory corresponding to the target system platform to be switched is determined according to the first switching instruction; the determined target backup directory is accessed by means of soft links, and the Unity project is run based on the accessed target backup directory to achieve switching from the current system platform to the target system platform. Thus, the Unity project is switched between different system platforms based on the backup directory and soft links, without the need to convert resources to update data files each time the system platform is switched, and without the need to back up multiple Unity projects, which not only reduces the storage space occupied, but also improves the switching rate and development efficiency of the Unity project between different system platforms, thereby improving the generation rate of the corresponding installation package.

[0142] The computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0143] It should be noted that the embodiment of the storage medium in the present application and the embodiment of the platform switching method in the present application are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding platform switching method mentioned above, and the repeated parts will not be repeated.

[0144] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0145] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A platform switching method, characterized in that: include: Backing up the library file directory of the Unity project to be processed in different system platforms to obtain a backup directory corresponding to each system platform; wherein the library file directory includes data files required for the Unity project to run in the corresponding system platform, and the library file directory includes a Library directory; If a first switching instruction is received when the Unity project is running in the current system platform, determining a target backup directory corresponding to the target system platform to be switched according to the first switching instruction; Access the target backup directory by means of soft links; Running the Unity project based on the accessed target backup directory to implement switching from the current system platform to the target system platform; The library file directories of the Unity projects to be processed are backed up in different system platforms to obtain the backup directories corresponding to each system platform, including: Loading the Unity project in different system platforms to obtain a library file directory of the Unity project in the corresponding system platform; wherein the different system platforms are switched based on a second switching instruction; Create a first directory under a specified path of each system platform, copy the data files in the library file directory to the corresponding first directory, and determine the first directory including the data files as a backup directory corresponding to the corresponding system platform; The Unity project is loaded in different system platforms to obtain the library file directory of the Unity project in the corresponding system platform, including: Loading the resources of the Unity project in different system platforms; Generate a data file of the Unity project in a corresponding system platform according to the loaded resources; Generate a library file directory of the Unity project in the corresponding system platform according to the data file.

2. The method according to claim 1, wherein generating a library file directory of the Unity project in a corresponding system platform according to the data file comprises: If the current system platform is the first system platform to load the Unity project, create an empty directory, save the data file in the empty directory, and obtain the library file directory of the current system platform; If the current system platform is not the first system platform to load the Unity project, the data file in the current library file directory is deleted, and the currently generated data file is saved in the library file directory to obtain the library file directory of the current system platform; wherein, the data file in the current library file directory is the data file of the Unity project in the previous system platform of the current system platform.

3. The method according to claim 1, wherein determining the target backup directory corresponding to the target system platform to be switched according to the first switching instruction comprises: Path information is obtained from the first switching instruction, and a backup directory corresponding to the obtained path information is determined as a target backup directory corresponding to the target system platform.

4. The method according to claim 3, wherein accessing the target backup directory by means of a soft link comprises: According to the path information, a soft link is established to the target backup directory through an access instruction corresponding to the current system platform.

5. A platform switching device, characterized in that: include: A backup module, used for backing up the library file directory of the Unity project to be processed in different system platforms to obtain a backup directory corresponding to each system platform; wherein the library file directory includes data files required for the Unity project to run in the corresponding system platform, and the library file directory includes a Library directory; A determination module, configured to determine a target backup directory corresponding to a target system platform to be switched according to the first switching instruction if a first switching instruction is received when the Unity project is running in the current system platform; An access module, used for accessing the target backup directory by means of a soft link; A running module, used to run the Unity project based on the accessed target backup directory to achieve switching from the current system platform to the target system platform; The backup module is specifically used for: Loading the Unity project in different system platforms to obtain a library file directory of the Unity project in the corresponding system platform; wherein the different system platforms are switched based on a second switching instruction; Create a first directory under a specified path of each system platform, copy the data files in the library file directory to the corresponding first directory, and determine the first directory including the data files as a backup directory corresponding to the corresponding system platform; In the backup module, the Unity project is loaded in different system platforms to obtain the library file directory of the Unity project in the corresponding system platform, including: Loading the resources of the Unity project in different system platforms; Generate a data file of the Unity project in a corresponding system platform according to the loaded resources; Generate a library file directory of the Unity project in the corresponding system platform according to the data file.

6. The device according to claim 5, wherein the determining module is specifically configured to: Path information is obtained from the first switching instruction, and a backup directory corresponding to the obtained path information is determined as a target backup directory corresponding to the target system platform.

7. The device according to claim 5, wherein the access module is specifically configured to: According to the path information, a soft link is established to the target backup directory through an access instruction corresponding to the current system platform.