diff --git a/Assets/FFmpeg/Standalone/StandaloneProxy.cs b/Assets/FFmpeg/Standalone/StandaloneProxy.cs index dd28e47..dc0d8c2 100644 --- a/Assets/FFmpeg/Standalone/StandaloneProxy.cs +++ b/Assets/FFmpeg/Standalone/StandaloneProxy.cs @@ -1,4 +1,4 @@ -#if UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_EDITOR +#if UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_EDITOR using System; using System.IO; using System.Text; @@ -36,14 +36,18 @@ namespace FFmpeg { #if UNITY_EDITOR binaryPath = Path.Combine(Application.dataPath, EDITOR_BINARY_PATH); -#elif UNITY_STANDALONE_OSX - string buildDir = Directory.GetCurrentDirectory(); - binaryPath = Path.Combine(buildDir, "ffmpeg"); + //#elif UNITY_STANDALONE_OSX + // string buildDir = Directory.GetCurrentDirectory(); + // binaryPath = Path.Combine(buildDir, "ffmpeg"); + //#elif UNITY_STANDALONE_WIN + // string buildDir = Directory.GetCurrentDirectory(); + // string dataDir = Directory.GetDirectories(buildDir, "*_Data")[0]; + // binaryPath = Path.Combine(dataDir, "ffmpeg"); #elif UNITY_STANDALONE_WIN - string buildDir = Directory.GetCurrentDirectory(); - string dataDir = Directory.GetDirectories(buildDir, "*_Data")[0]; - binaryPath = Path.Combine(dataDir, "ffmpeg"); + string buildDir = Application.dataPath; //Directory.GetCurrentDirectory(); + binaryPath = Path.Combine(buildDir, "ffmpeg"); #endif + if (!File.Exists(binaryPath)) { string err = "Binary is not found at " + binaryPath; diff --git a/Assets/FFmpegVideoModule/RecPanel.cs b/Assets/FFmpegVideoModule/RecPanel.cs index 8950323..ab8b742 100644 --- a/Assets/FFmpegVideoModule/RecPanel.cs +++ b/Assets/FFmpegVideoModule/RecPanel.cs @@ -49,21 +49,25 @@ public class RecPanel : MonoBehaviour } } } - else - { - if (gameObject.activeInHierarchy) - { - if (recLogic.isREC) - { - recLogic.StopREC(); - } - gameObject.SetActive(false); - } - } + //else + //{ + // if (gameObject.activeInHierarchy) + // { + // if (recLogic.isREC) + // { + // recLogic.StopREC(); + // } + // gameObject.SetActive(false); + // } + //} } public void OnStart() { + if (!GameSettings.othersSettings.IsStartDrill) + { + return; + } StartButton.interactable = false; StopButton.interactable = true; StartButton.GetComponent().color = Color.red; diff --git a/Assets/FFmpegVideoModule/RecSavePanel.cs b/Assets/FFmpegVideoModule/RecSavePanel.cs index 167ffcd..4459859 100644 --- a/Assets/FFmpegVideoModule/RecSavePanel.cs +++ b/Assets/FFmpegVideoModule/RecSavePanel.cs @@ -32,6 +32,7 @@ public class RecSavePanel : MonoBehaviour { NameInput.text = ""; SureButton.interactable = true; + CancelButton.interactable = true; TipText.gameObject.SetActive(false); WarnText.gameObject.SetActive(false); } @@ -63,15 +64,16 @@ public class RecSavePanel : MonoBehaviour void SureClick() { WarnText.gameObject.SetActive(false); - if (!GameSettings.othersSettings.IsStartDrill) - { - WarnText.gameObject.SetActive(true); - WarnText.text = "请先开始演练!"; - } + //if (!GameSettings.othersSettings.IsStartDrill) + //{ + // WarnText.gameObject.SetActive(true); + // WarnText.text = "请先开始演练!"; + //} if (string.IsNullOrEmpty(NameInput.text)) { WarnText.gameObject.SetActive(true); WarnText.text = "文件名不可为空"; + return; } if (!Directory.Exists(path))