Browse Source

视频插件BUG修改

develop
杨栋梁 2 years ago
parent
commit
40d0c5c03f
  1. 18
      Assets/FFmpeg/Standalone/StandaloneProxy.cs
  2. 26
      Assets/FFmpegVideoModule/RecPanel.cs
  3. 12
      Assets/FFmpegVideoModule/RecSavePanel.cs

18
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;

26
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<Image>().color = Color.red;

12
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))

Loading…
Cancel
Save