代码如下:
if (useAI){/** 通过PaddlePaddle进行合成处理* */// 创建线程参数对象ThreadParameters parameters = new ThreadParameters(){pythonPath = "python", // 如果 Python 在系统路径中,可以直接使用 "python"pythonScript = UnityEngine.Application.streamingAssetsPath + "/facechanging.py",facePath = Utility.DistributePath + "/" + CStarApp.Instance.gameName + ".png",photoPath = UnityEngine.Application.streamingAssetsPath + $"/{imgFolder}/Role{roleId}Scene{sceneId}_face.png",outputPath = Utility.DistributePath + "/" + CStarApp.Instance.gameName + ".jpeg",};Thread thread = new Thread(new ParameterizedThreadStart(ExecuteCommandLineProgram));thread.Start(parameters);/** 配合PaddlePaddle合成处理,查询Python程序执行是否结束*/StartCoroutine(queryProcessing());}