Пример #1
0
    // 유틸 : App 빌드
    static void BuildApplication(string[] strScenes, BuildTarget eTarget, BuildOptions eOptions)
    {
        string strBuildName = GetBuildName(eTarget, Single.AppInfo.GetAppName(), Single.Table.GetClientVersion());

        Debug.LogFormat("** Build Start({0}) -> {1}", strBuildName, DateTime.Now.ToString("yyyy-MM-dd [ HH:mm:ss ]"));
        {
            EditorUserBuildSettings.SwitchActiveBuildTarget(eTarget);

            string strFileName = string.Format("{0}/{1}", SHPath.GetPathToBuild(), strBuildName);

            if (false == SHUtils.IsExistsDirectory(strFileName))
            {
                eOptions = BuildOptions.None;
            }

            SHUtils.CreateDirectory(strFileName);

            string strResult = BuildPipeline.BuildPlayer(strScenes, strFileName, eTarget, eOptions);
            if (0 < strResult.Length)
            {
                throw new Exception("BuildPlayer failure: " + strResult);
            }
        }
        Debug.LogFormat("** Build End({0}) -> {1}", strBuildName, DateTime.Now.ToString("yyyy-MM-dd [ HH:mm:ss ]"));
    }