0

I want to disable everyplay, built in unity, when running iphone4/3G/3GS

but I'm not sure of the easiest place to just globally disable it. Any suggestions?

if (iPhone.generation == iPhoneGeneration.iPhone4  || iPhone.generation == iPhoneGeneration.iPhone3G || iPhone.generation == iPhoneGeneration.iPhone3GS )

1 Answers1

2

You can easily disable single core devices (3GS/4/iPad1) by calling Everyplay.SharedInstance.SetDisableSingleCoreDevices(true) in the first scene of your game. After that you don't have to worry if you are calling StartRecording on a single core device since the calls are ignored by Everyplay. 3G (and Unity editor) does not support the recording in the first place.

In case you need to support recording on iPad 1 one approach is to create an Everyplay singleton wrapper which simply does not call recording functions on devices which you have have defined to be not supported.

Simple wrapper example (untested but gives you the idea):

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();
        }
    }
}

To use it you just call MyEveryplayWrapper.MethodName instead of Everyplay.SharedInstance.MethodName. When rendering your UI you can take the IsRecordingSupported into account to show/hide Everplay related buttons etc.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Pauli Ojanen
  • 296
  • 2
  • 5