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;
using System.IO; using System.IO;
using System.Text; using System.Text;
@ -36,14 +36,18 @@ namespace FFmpeg
{ {
#if UNITY_EDITOR #if UNITY_EDITOR
binaryPath = Path.Combine(Application.dataPath, EDITOR_BINARY_PATH); binaryPath = Path.Combine(Application.dataPath, EDITOR_BINARY_PATH);
#elif UNITY_STANDALONE_OSX //#elif UNITY_STANDALONE_OSX
string buildDir = Directory.GetCurrentDirectory(); // string buildDir = Directory.GetCurrentDirectory();
binaryPath = Path.Combine(buildDir, "ffmpeg"); // 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 #elif UNITY_STANDALONE_WIN
string buildDir = Directory.GetCurrentDirectory(); string buildDir = Application.dataPath; //Directory.GetCurrentDirectory();
string dataDir = Directory.GetDirectories(buildDir, "*_Data")[0]; binaryPath = Path.Combine(buildDir, "ffmpeg");
binaryPath = Path.Combine(dataDir, "ffmpeg");
#endif #endif
if (!File.Exists(binaryPath)) if (!File.Exists(binaryPath))
{ {
string err = "Binary is not found at " + binaryPath; string err = "Binary is not found at " + binaryPath;

26
Assets/FFmpegVideoModule/RecPanel.cs

@ -49,21 +49,25 @@ public class RecPanel : MonoBehaviour
} }
} }
} }
else //else
{ //{
if (gameObject.activeInHierarchy) // if (gameObject.activeInHierarchy)
{ // {
if (recLogic.isREC) // if (recLogic.isREC)
{ // {
recLogic.StopREC(); // recLogic.StopREC();
} // }
gameObject.SetActive(false); // gameObject.SetActive(false);
} // }
} //}
} }
public void OnStart() public void OnStart()
{ {
if (!GameSettings.othersSettings.IsStartDrill)
{
return;
}
StartButton.interactable = false; StartButton.interactable = false;
StopButton.interactable = true; StopButton.interactable = true;
StartButton.GetComponent<Image>().color = Color.red; StartButton.GetComponent<Image>().color = Color.red;

12
Assets/FFmpegVideoModule/RecSavePanel.cs

@ -32,6 +32,7 @@ public class RecSavePanel : MonoBehaviour
{ {
NameInput.text = ""; NameInput.text = "";
SureButton.interactable = true; SureButton.interactable = true;
CancelButton.interactable = true;
TipText.gameObject.SetActive(false); TipText.gameObject.SetActive(false);
WarnText.gameObject.SetActive(false); WarnText.gameObject.SetActive(false);
} }
@ -63,15 +64,16 @@ public class RecSavePanel : MonoBehaviour
void SureClick() void SureClick()
{ {
WarnText.gameObject.SetActive(false); WarnText.gameObject.SetActive(false);
if (!GameSettings.othersSettings.IsStartDrill) //if (!GameSettings.othersSettings.IsStartDrill)
{ //{
WarnText.gameObject.SetActive(true); // WarnText.gameObject.SetActive(true);
WarnText.text = "请先开始演练!"; // WarnText.text = "请先开始演练!";
} //}
if (string.IsNullOrEmpty(NameInput.text)) if (string.IsNullOrEmpty(NameInput.text))
{ {
WarnText.gameObject.SetActive(true); WarnText.gameObject.SetActive(true);
WarnText.text = "文件名不可为空"; WarnText.text = "文件名不可为空";
return;
} }
if (!Directory.Exists(path)) if (!Directory.Exists(path))

Loading…
Cancel
Save