2013-12-10 1 views
0

안드로이드 게임에서 러닝 씬에서 비디오 레코딩이 필요했습니다. Android Kamcord 플러그인의 도움을 사용하고 있지만 녹음이 완료되지 않았습니다. 아무런 도움이되지 않으므로 제발 도와주세요.Unity3D에서 Kamcord를 사용하는 안드로이드 비디오 레코딩

화합 버전 4.2.2 &을 사용하고 있습니다. 안드로이드 장치는 삼성 갤럭시 노트입니다. 3. 아래 코드를 찾으십시오.

코드는 다음과 같습니다

using UnityEngine; 
using System.Collections; 

public class VideoRecord : MonoBehaviour 
{ 
    public GameObject KamcordPrefab; 
    public GameObject KamcordGO; 
    public GameObject PlayBtn; 
    public GameObject PauseBtn; 
    public GameObject StopBtn; 
    public GameObject Stop_ShadowBtn; 
    public bool IsPlaying = false; 
    public UILabel Check; 
    public UILabel KamCheck; 

// Use this for initialization 
void Start() 
{ 
     if(KamcordGO == null) 
     KamcordGO = (GameObject)Instantiate(KamcordPrefab,this.gameObject.transform.position,this.gameObject.transform.rotation); 

     Kamcord.WhitelistAllBoards(); 
} 

// Update is called once per frame 
void Update() 
{ 

    if(IsPlaying) 
    { 
     if(!GameObject.Find("***").animation.isPlaying) 
     { 

      Debug.Log(" *** KamCord Stops the Recording *** "); 
      Kamcord.StopRecording(); 
      IsPlaying = false; 
      // *** Animation & Audio is Completed then it comes to Default Buttons. 
      PlayBtn.SetActive(true); 
      StopBtn.SetActive(true); 
      PauseBtn.SetActive(false); 
      Stop_ShadowBtn.SetActive(false); 
     } 
    } 
    if(GameObject.Find("***").audio.isPlaying) 
    { 
     Debug.Log("*** Audio is Playing **** "); 
    } 

    if(Kamcord.IsRecording()) 
    { 
     Check.text = "RECORDING ..."; 
     Debug.Log(" *** Is Recording.. *** "); 
    } 
    else 
    { 
     Check.text = "NOT RECORDING..."; 
     Debug.Log(" *** Not Recording.. *** "); 
    } 



} 

void Play() 
{ 
    Debug.Log(" *** Play Button Clicked *** "); 

    GameObject.Find("***").animation["***"].speed = 1; 
    GameObject.Find("***").animation.Play(); 
    GameObject.Find("***").audio.Play(); 
    IsPlaying = true; 

    Kamcord.StartRecording(); 


    if(Kamcord.IsRecording()) 
    { 
     Debug.Log(" *** Is Recording *** "); 
    } 
    else 
    { 
     Debug.Log(" *** Not Recording *** "); 
    } 

    PauseBtn.SetActive(true); 
    PlayBtn.SetActive(false); 
    Stop_ShadowBtn.SetActive(true); 
    StopBtn.SetActive(false); 

} 

void Pause() 
{ 
    Debug.Log(" *** Pause Button Clicked *** "); 
    GameObject.Find("***").animation["***"].speed = 0; 
    GameObject.Find("***").audio.Pause(); 


    Kamcord.Pause(); 

    PlayBtn.SetActive(true); 
    PauseBtn.SetActive(false); 
    StopBtn.SetActive(true); 
    Stop_ShadowBtn.SetActive(false); 
} 

void Stop() 
{ 
     Debug.Log(" *** Stop Button Clicked *** "); 
     GameObject.Find("***").animation["***"].time=0.0F; 
     GameObject.Find("***").animation.Sample(); 
     GameObject.Find("***").animation["***"].enabled = false; 
     GameObject.Find("***").audio.Stop(); 

     Kamcord.StopRecording(); 

     //GameObject.Find("***").audio.Stop(); 
     PlayBtn.SetActive(true); 
     PauseBtn.SetActive(false); 
     StopBtn.SetActive(true); 
     Stop_ShadowBtn.SetActive(false); 
} 



} 
+0

"녹화가 완료되지 않았습니다"- 발생하지 않았거나 작동하지 않은 사항에 대해 자세히 설명해주십시오. 코드 디버깅을 시도 했습니까? – HaemEternal

+0

코드에 여러 개의 디버그 로그가 있습니다. 어떤 디버그 로그가 실행됩니까? "재생"버튼을 클릭하면 어떤 메시지가 나타 납니까? –

+0

예 위의 코드는 좋은 실행 장면의 비디오 녹화를 기대하는 모든 완벽하게 완료됩니다. 그래서 아무 생각이 나지 않았어 도와주세요. – Venkat

답변

0

우리가 현재 이메일을 통해 소통하고 생각합니다. [email protected]으로 이메일을 보내 주셨습니다. 받은 편지함을 확인하십시오!