欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

利用命令行启动更新程序

程序员文章站 2022-03-20 11:10:49
...

1、看代码逻辑

///
/// 命令行
///
private void ParseCommandLine()
{
string[] CommandLineArgs = Environment.GetCommandLineArgs();

#if !UNITY_EDITOR
foreach ( var item in CommandLineArgs )
{
if ( item == “–import” )
{
ImportSinglePlayerData();
}
}

#elif DATA_BASE_MERGE
ImportSinglePlayerData();
#endif
}

private void ImportSinglePlayerData()
{

        string backupPath = Application.dataPath.Substring( 0, Application.dataPath.LastIndexOf( '/' ) ) + "/data_for_update/";
        string tgtFilePath = Application.dataPath+ "/StreamingAssets/Upload/DrillMissionRecord";
        string srcFilePath = backupPath+ "DrillMissionRecord";
    }