public void ResetIdentity() { #if UNITY_IOS && !UNITY_EDITOR resetIdentity(); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.ResetIdentity(); #endif }
/// <summary> /// Note a change in score for highlight recording /// </summary> /// <remarks> /// For highlight recording use only. Calling this function when the score changes means that the end recording /// will focus on the stretch of gameplay with the most frequent / highest value events logged. /// </remarks> public void RegisterScoreChange(int scoreDelta) { #if UNITY_IOS && !UNITY_EDITOR registerScoreChange(scoreDelta); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.RegisterScoreChange(scoreDelta); #endif }
public void ShareToMail() { #if UNITY_IOS && !UNITY_EDITOR presentShareToMail(); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.ShareToMail(); #endif }
/// <summary> /// Delete a recording /// </summary> /// <description> /// Will remove any frames of the recording in memory and on disk. Both completed and incomplete /// recordings will take space on disk, thus particularly if you're using <c>KeepCompletedRecordings = true</c> you might want /// to provide an interface to your users for removing recordings they don't care about anymore to free up space for new recordings. /// </description> /// <param name="recordingId">Recording identifier.</param> public void DeleteRecording(string recordingId) { #if UNITY_IOS && !UNITY_EDITOR deleteRecording(recordingId); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.DeleteRecording(recordingId); #endif }
public void SubmitDebugData(string message) { #if UNITY_IOS && !UNITY_EDITOR submitDebugDataWithMessage(message); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.SubmitDebugData(message); #endif }
public void ShareToMail(MegacoolShareConfig config) { #if UNITY_IOS && !UNITY_EDITOR presentShareToMailWithConfig(config.RecordingId, config.LastFrameOverlay, config.FallbackImage, config.Share.Url.ToString(), config.Share.Data != null ? MegacoolThirdParty_MiniJSON.Json.Serialize(config.Share.Data) : null); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.ShareToMail(config); #endif }
public void DeleteShares(Func <MegacoolShare, bool> filter) { #if UNITY_IOS && !UNITY_EDITOR deleteSharesFilter = filter; deleteShares(Marshal.GetFunctionPointerForDelegate(new Func <MegacoolShareData, bool>(DeleteSharesFilter))); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.DeleteShares(filter); #endif }
public void GetShares(Action <List <MegacoolShare> > shares) { OnSharesRetrieved = shares; #if UNITY_IOS && !UNITY_EDITOR getShares(); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.GetShares(shares); #endif }
/// <summary> /// Stops the recording. /// </summary> public void StopRecording() { #if UNITY_IOS && !UNITY_EDITOR stopRecording(); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.StopRecording(); #endif _isRecording = false; }
public void PauseRecording() { #if UNITY_IOS && !UNITY_EDITOR pauseRecording(); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.PauseRecording(); #endif _isRecording = false; }
private void Awake() { _ins = this; #if UNITY_ANDROID && !UNITY_EDITOR //Meteor = new AndroidJavaClass("com.meteorsdk.MainActivity"); //if (Meteor != null) //ActivityInstance = Meteor.GetStatic<AndroidJavaObject>("Instance"); #endif }
public string GetPreviewInfoForRecording(string recordingId) { #if UNITY_IOS && !UNITY_EDITOR return(getPreviewInfoForRecording(recordingId)); #elif UNITY_ANDROID && !UNITY_EDITOR return(AndroidWrapper.GetPreviewInfoForRecording(recordingId)); #else throw new NotImplementedException("GetPreviewInfoForRecording not supported in editor"); #endif }
private void Awake() { instance = this; AndroidWrapper.Initialize(); menuInstance.OpenListMenu(); if (!AndroidWrapper.IsAuthorizationSuccess()) { WriteError(AndroidWrapper.I.GetJaveExeption()); } }
private void Start() { if (AndroidWrapper.IsAuthorizationSuccess()) { headerText.text = "Token = " + AndroidWrapper.I.GetToken() + " ID = " + AndroidWrapper.I.GetAppID(); } else { startButton.gameObject.SetActive(false); } }
//单机版不更新. void Start() { #if UNITY_ANDROID AndroidWrapper.Init(); #elif UNITY_IOS IosWrapper.Init(); #endif GameData.LoadVersion(); GameData.LoadState(); StartCoroutine(LoadData()); }
/// <summary> /// Capture a single frame. /// </summary> /// <remarks> /// Capture a single frame to the buffer. The buffer size is 50 frames (default) and the oldest frames will be deleted if the method gets called more than 50 times. /// The total number of frames can be customized by setting the <c>MaxFrames</c> property. /// </remarks> public void CaptureFrame() { InitializeManager(); RenderThisFrame = true; #if UNITY_IOS && !UNITY_EDITOR captureFrame(); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.CaptureFrame(); #endif }
/// <summary> /// Start recording a GIF /// </summary> /// <remarks> /// This will keep a buffer of 50 frames (default). The frames are overwritten until <c>StopRecording</c> gets called. /// </remarks> public void StartRecording() { InitializeManager(); #if UNITY_IOS && !UNITY_EDITOR startRecording(); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.StartRecording(); #endif _isRecording = true; }
public static void Init() { if (Instance == null) { GameObject cssdkObj = new GameObject("Meteor2Android"); cssdkObj.transform.position = Vector3.zero; cssdkObj.transform.rotation = Quaternion.identity; cssdkObj.transform.localScale = Vector3.one; _ins = cssdkObj.AddComponent <AndroidWrapper>(); GameObject.DontDestroyOnLoad(cssdkObj); } }
public void CaptureFrame(MegacoolFrameCaptureConfig config) { config.SetDefaults(); InitializeManager(); RenderThisFrame = true; #if UNITY_IOS && !UNITY_EDITOR captureFrameWithConfig(config.RecordingId, config.OverflowStrategy.ToString(), new Crop(new Rect(0, 0, 0, 0)), config.ForceAdd, config.MaxFrames, config.FrameRate); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.CaptureFrame(config); #endif }
/// <summary> /// Start customized GIF recording. /// </summary> /// <remarks> /// This will keep a buffer of 50 frames (default). The frames are overwritten until <c>StopRecording</c> gets called. /// </remarks> /// <param name="config">Config to customize the recording.</param> public void StartRecording(MegacoolRecordingConfig config) { config.SetDefaults(); InitializeManager(); #if UNITY_IOS && !UNITY_EDITOR startRecordingWithConfig(config.RecordingId, new Crop(new Rect(0, 0, 0, 0)), config.MaxFrames, config.FrameRate, config.PeakLocation, config.OverflowStrategy.ToString()); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.StartRecording(config); #endif _isRecording = true; }
// Temporary extracted method to initialize SDK until deprecated Start is removed private void _Start(Action <MegacoolEvent> eventHandler) { if (hasStarted) { // Allowing multiple initializations would make it hard to maintain both thread-safety and performance // of the underlying capture code, and doesn't have any good use case for allowing it, thus ignoring. UnityEngine.Debug.Log("Megacool: Skipping duplicate init"); return; } hasStarted = true; // Set debugging first so that it can be enabled before initializing the native SDK Debug = MegacoolConfiguration.Instance.debugMode; EventHandler = eventHandler; // Delegates must be initialized before start() since start() might trigger the event callbacks. InitializeSharingDelegate(); #if UNITY_IOS && !UNITY_EDITOR startWithAppConfig(MegacoolConfiguration.Instance.appConfigIos); #elif UNITY_ANDROID && !UNITY_EDITOR AndroidWrapper.Start(MegacoolConfiguration.Instance.appConfigAndroid, eventHandler); #endif SetupDefaultConfiguration(); ManualApplicationDidBecomeActive(); #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR int width = (int)(Screen.width / ScaleFactor); int height = (int)(Screen.height / ScaleFactor); mcl_init_capture(width, height, SystemInfo.graphicsDeviceType.ToString()); #endif IssuePluginEvent(MCRS); SignalRenderTexture(renderTexture); }
// Use this for initialization void Start() { score = 0; androidWrapper = this.GetComponent <AndroidWrapper>(); }