2013-05-28 61 views

回答

2

您可以輕鬆地在你的遊戲的第一個場景調用Everyplay.SharedInstance.SetDisableSingleCoreDevices(true)禁用單核器件(3GS/4/IPAD1)。之後,如果您在單核設備上致電StartRecording,則無需擔心,因爲Everyplay會忽略這些呼叫。 3G(和Unity編輯器)首先不支持錄製。

如果您需要支持iPad 1上的錄製,一種方法是創建一個Everyplay單例包裝器,它不會在您定義爲不支持的設備上調用錄製功能。

簡單打包例子(未經測試,但給你的想法):

using UnityEngine; 

public static class MyEveryplayWrapper { 
    private static iPhoneGeneration[] unsupportedDevices = { 
     iPhoneGeneration.iPad1Gen, 
     iPhoneGeneration.iPhone, 
     iPhoneGeneration.iPhone3G, 
     iPhoneGeneration.iPhone3GS, 
     iPhoneGeneration.iPodTouch1Gen, 
     iPhoneGeneration.iPodTouch2Gen, 
     iPhoneGeneration.iPodTouch3Gen 
    }; 

    private static bool CheckIfRecordingSupported() { 
     bool recordingSupported = !Application.isEditor; 

     foreach(iPhoneGeneration device in unsupportedDevices) { 
      if(device == iPhone.generation) { 
       recordingSupported = false; 
       break; 
      } 
     } 

     Debug.Log ("Everyplay recording support: " + recordingSupported); 

     return recordingSupported; 
    } 

    public static bool IsRecordingSupported = CheckIfRecordingSupported(); 

    public static void StartRecording() { 
     if(IsRecordingSupported) { 
      Everyplay.SharedInstance.StartRecording(); 
     } 
    } 

    public static void StopRecording() { 
     if(IsRecordingSupported) { 
      Everyplay.SharedInstance.StopRecording(); 
     } 
    } 
} 

要使用它,你只需要調用MyEveryplayWrapper.MethodName而不是Everyplay.SharedInstance.MethodName。在渲染你的UI時,你可以考慮IsRecordingSupported來顯示/隱藏Everplay相關按鈕等。

相關問題