Agenda
? What is hot update
? Why Hot Updates
? How to make a hot update to a Unity app on IOS
? Comparison of various Lua plugins that support Unity iOS hot update
What is hot update
? Generalized definition
? No need to shut down the server, fix the bug in the non-stop state, update the resources, etc., focus on updating the logic code.
? narrow definition ( iOS hot update)
? without repackaging the code into AppStore, you can update the execution code of the client, which automatically updates the program without downloading the app .
? Present situation
? Apple prohibits partial reflection operations in C #, disables JIT(Immediate compilation, creates and runs new code while the program is running), does not allow logical hot updates, and only allows the use of assetbundle Make a resource hot update.
Why Hot Updates
? Improve the user experience by shortening the process for users to get a new version of the app's client.
? specific to the IOS platform for the application, there are several reasons
? The APP store's audit cycle is difficult to control.
? Mobile apps are frequently updated.
? For large applications, the cost of updating is too high.
? Ultimate State
? Completely transform the content of an app without re-downloading and non-stop.
How to make a hot update to a Unity app on IOS
? Hot updates for Android apps
? precompile The execution code to Assemblydll.
? Package The code as Textasset into the assetbundle.
? at run time, the functionality of the code is implemented using the Reflection mechanism.
? update the appropriate Assetbundle to implement the hot update.
? the similarities and differences between Android and IOS hot updates
? Apple officially prohibits program hot updates under iOS, and theJIT is not available under iOS.
? Hot update Scenario:Unity+lua plugin.
? how IOS hot update works with the Lua plugin
? Note Points for Unity hot update
? code and resources that need to be updated must be packaged into assetbundle(for packaging with uncompressed format)
? familiar with several important paths to Unity
? Resources (Read only)
? Streamingassets (Read only)
? Application.datapath (Read only)
? Application.persistentdatapath (Readable and writable)
? Resources of the important path
? Resources will be packaged for use or not in resource folders
? Resources are compressed and converted into binary
? Resource read-only under folder after packaging
? Cannot be changed dynamically, hot update cannot be made
? loading with resources.load
? the streamingassets of the important path
? Cache directory for streaming data
? Resources under the folder will be packaged regardless of whether they are used or not
? Resources are not compressed and encrypted
? The resources under the folder are read-only, and the binaries are mostly stored
? Cannot make hot updates
? WWW class Load (general use CreateFromFile , if the resource is assetbundle, according to its packaging method to see if it is compressed to determine)
? Relative path, the specific path depends on the actual platform
? Application.streamingassetspath
? IOS:Application.dataPath + "/raw" or Application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxx.app/data/raw
? the Application.datapath of the important path
? The path to the game's Data folder (for example, Assets in editor )
? Rarely used
? Cannot make hot updates
? IOS path : application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/xxx.app/data
? the Application.persistentdatapath of the important path
? the path to the persisted data store directory ( sandbox directory, which does not exist before packaging )
? Resources under the folder will be packaged regardless of whether they are used or not
? Valid at run time, readable and writable
? no content restrictions, read binary files from Streamingasset or read files from Assetbundle to write persistentdatapath
? Suitable for hot updates
? IOS path : application/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/documents
? The overall process for IOS hot update using the Lua plugin
Comparison of various Lua plugins that support Unity iOS hot update
? Ulua (Asset Store)
? Ulua plug-in native version, pedigree
? does not produce static code
? reflection mechanism, low efficiency, slow speed, frequent gcalloc
? Update maintenance stopped, unity5.x not supported , fade out of mainstream
? Ulua & Cstolua
? Mature and stable development platform, fast Bug fixes
? Many developers, rich resources
? static method, excellent performance
? Successful commercial product case (PA, super God, cool fish fishing, Jedi, this is not the turret, etc.) fish, Jedi Police, this is not the turret, etc.
? are based on native version improvements; In the future, the two will be merged into a single plugin
? Slua
? static method, excellent performance
? The core code is simple
? Less resources, the development platform is not mature and stable
? No Success Commercial product case Success Commercial product case
? Improvements based on the native version
Comparison of various Lua plugins that support Unity iOS hot update
? C#light (l#)
? Fade out of mainstream
? Unilua
? C # implementation of Lua virtual machines, non-complete scenarios
? Fade out of mainstream
Comparison of various Lua plugins that support Unity iOS hot update
Then there is The test code for Ulua and Slua.
In a comprehensive sense , the Ulua will be better.
Test results will not be done , you can download the PDF yourself to see
Http://china.unity3d.com
Unity Hot More (one)