public static void Share() { if (Everyplay.IsSupported()) { Everyplay.ShowSharingModal(); } }
void OnTriggerEnter2D(Collider2D col) { //tag if (col.gameObject.tag == "Lazer") { anim.SetTrigger("died"); GetComponent <Rigidbody2D>().isKinematic = true; GetComponent <Collider2D>().enabled = false; endmenu.SetActive(true); ingamedisplay.SetActive(false); buttonup.SetActive(false); buttondown.SetActive(false); GetComponent <AudioSource>().PlayOneShot(died, 3.0F); int totalcans = 5; UnityAnalytics.CustomEvent("gameOver", new Dictionary <string, object> { { "totalcan", totalcans }, }); Everyplay.StopRecording(); //Everyplay.SetMetadata("score", score); //Everyplay.PlayLastRecording(); } }
void OnGUI() { if (recordingPermissionGranted) { if (GUI.Button(new Rect(Screen.width - 10 - 158, 10, 158, 48), Everyplay.FaceCamIsSessionRunning() ? "Stop FaceCam session" : "Start FaceCam session")) { if (Everyplay.FaceCamIsSessionRunning()) { Everyplay.FaceCamStopSession(); } else { Everyplay.FaceCamStartSession(); } #if UNITY_EDITOR Debug.Log("Everyplay FaceCam is not available in the Unity editor. Please compile and run on a device."); #endif } } else { if (GUI.Button(new Rect(Screen.width - 10 - 158, 10, 158, 48), "Request REC permission")) { Everyplay.FaceCamRequestRecordingPermission(); #if UNITY_EDITOR Debug.Log("Everyplay FaceCam is not available in the Unity editor. Please compile and run on a device."); #endif } } }
public void FaceCamToggle() { DebugLog("Face Cam Toggle!"); if (Everyplay.FaceCamIsRecordingPermissionGranted()) { isFaceCameOn = !isFaceCameOn; if (isFaceCameOn) { if (!Everyplay.FaceCamIsSessionRunning()) { Everyplay.FaceCamStartSession(); Everyplay.FaceCamSetAudioOnly(true); //added } } else { if (Everyplay.FaceCamIsSessionRunning()) { Everyplay.FaceCamStopSession(); } } } else //For the first time in the game we want to turn on the camera { Everyplay.FaceCamRequestRecordingPermission(); startFaceCamWhenPermissionGranted = true; } }
void OnPreRender() { #pragma warning disable 612,618 if (readyForRecording) { #if EVERYPLAY_NATIVE_PLUGIN if (renderEventPtr != IntPtr.Zero) { if (isMetalDevice || isAndroidDevice) { #if EVERYPLAY_NATIVE_PLUGIN_USE_PTR GL.IssuePluginEvent(renderEventPtr, EPSR); #else GL.IssuePluginEvent(EPSR); #endif } else { Everyplay.SnapshotRenderbuffer(); } } #else Everyplay.SnapshotRenderbuffer(); #endif } #pragma warning restore 612,618 }
public void OnStopRecordingEvent() { text.text = "stop recording "; Everyplay.SetMetadata("level", "FunnyCamera!"); ShowLastVideo(); }
public void faceCamSetAudioOnly(bool val) { #if BROADCAST_USE_EVERYPLAY Everyplay.FaceCamSetAudioOnly(val); #else #endif }
public void facecamStop() { #if BROADCAST_USE_EVERYPLAY Everyplay.FaceCamStopSession(); #else #endif }
/// <summary> /// 用于录屏操作开始的触发器 /// </summary> /// <param name="isrecording"></param> public void Dooperation(bool isrecording) { if (!isinited) { return; } if (!issupported && !isrecording) { Uimanager.Getinstance().Showtips("当前硬件设备不支持该功能"); return; } if (isrecording) { Debug.Log("停止录制" + isstarted); Everyplay.StopRecording(); } else { Debug.Log("开始录制" + isstarted); if (isrecording) { return; } Everyplay.StartRecording(); } }
// Game End private void GameEnd() { HUDController.s_Instance.SetHudEnabled(false); DisableTankControl(); m_GameIsFinished = true; if (m_EndGameModal != null) { m_EndGameModal.Show(); } if (Everyplay.IsRecording()) { int tankIndex = s_Tanks.IndexOf(m_LocalPlayer); if (tankIndex >= 0) { Everyplay.SetMetadata("final_position", tankIndex + 1); } Everyplay.StopRecording(); } LazyLoadLoadingPanel(); m_LoadingScreen.transform.SetAsLastSibling(); }
// Use this for initialization void Start() { Everyplay.StartRecording(); //#if UNITY_EDITOR //Debug.Log("The video recording is not available in the Unity editor. Please compile and run on a device."); //#endif }
//para a gravaçao public void Parar() { if (Everyplay.IsRecording()) { Everyplay.StopRecording(); } }
IEnumerator Wait() { yield return(new WaitForSeconds(1.0f)); Everyplay.SetMetadata("score", GameManager.Score.Value); Everyplay.StopRecording(); }
public void faceCamSetTargetTextureWidth(int val) { #if BROADCAST_USE_EVERYPLAY Everyplay.FaceCamSetTargetTextureWidth(val); #else #endif }
public void faceCamSetMonitorAudioLevels(bool val) { #if BROADCAST_USE_EVERYPLAY Everyplay.FaceCamSetMonitorAudioLevels(val); #else #endif }
public void startRecording() { if (!IsSupported() || !IsRecordingSupported()) { return; } if (!IsRecording()) { SetMaxRecordingMinutesLength(10); SetMetadata("about", Locos.Get(LocoKeys.social_everyplay_game_explore_message)); SetMetadata("game", Locos.Get(LocoKeys.app_display_name)); SetMetadata("level", Locos.Get(LocoKeys.game_type_arcade)); SetMetadata("level_name", Locos.Get(LocoKeys.game_type_arcade_mode)); if (FPSDisplay.isUnder25FPS) { SetLowMemoryDevice(true); } #if BROADCAST_USE_EVERYPLAY Everyplay.StartRecording(); #endif BroadcastRecordingStart(); } }
public void faceCamSetPreviewBorderColor(float r, float g, float b, float a) { #if BROADCAST_USE_EVERYPLAY Everyplay.FaceCamSetPreviewBorderColor(r, g, b, a); #else #endif }
IEnumerator InitializeEveryplay() { yield return(0); Everyplay.Initialize(); Destroy(gameObject); }
public void faceCamSetPreviewOrigin(Everyplay.FaceCamPreviewOrigin val) { #if BROADCAST_USE_EVERYPLAY Everyplay.FaceCamSetPreviewOrigin(val); #else #endif }
public void SetThumbnail(Texture texture) { if (isEnable) { Everyplay.SetThumbnailTargetTexture((Texture2D)texture); } }
public void faceCamSetPreviewPositionY(int val) { #if BROADCAST_USE_EVERYPLAY Everyplay.FaceCamSetPreviewPositionY(val); #else #endif }
private void FaceCamToggle() { if (faceCamPermissionGranted) { faceCamToggleButton.toggled = !faceCamToggleButton.toggled; if (faceCamToggleButton.toggled) { if (!Everyplay.FaceCamIsSessionRunning()) { Everyplay.FaceCamStartSession(); } } else { if (Everyplay.FaceCamIsSessionRunning()) { Everyplay.FaceCamStopSession(); } } } else { Everyplay.FaceCamRequestRecordingPermission(); startFaceCamWhenPermissionGranted = true; } }
public void faceCamSetPreviewScaleRetina(bool val) { #if BROADCAST_USE_EVERYPLAY Everyplay.FaceCamSetPreviewScaleRetina(val); #else #endif }
private void RpcGameEnd() { HUDController.s_Instance.SetHudEnabled(false); DisableTankControl(); m_GameIsFinished = true; if (m_EndGameModal != null) { m_EndGameModal.Show(); } if (Everyplay.IsRecording()) { int tankIndex = s_Tanks.IndexOf(m_LocalPlayer); if (tankIndex >= 0) { Everyplay.SetMetadata("final_position", tankIndex + 1); } Everyplay.StopRecording(); } // Tell menu UI that we'll be returning to the lobby scene MainMenuUI.s_ReturnPage = MenuPage.Lobby; LazyLoadLoadingPanel(); m_LoadingScreen.transform.SetAsLastSibling(); }
public void faceCamSetPreviewSideWidth(int val) { #if BROADCAST_USE_EVERYPLAY Everyplay.FaceCamSetPreviewSideWidth(val); #else #endif }
void Start() { if (Everyplay.IsSupported()) { Everyplay.StartRecording(); } }
public void faceCamSetPreviewVisible(bool val) { #if BROADCAST_USE_EVERYPLAY Everyplay.FaceCamSetPreviewVisible(val); #else #endif }
void OnDestroy() { Everyplay.ReadyForRecording -= OnReadyForRecording; if (initialized) { // Set Everyplay not to render to a texture anymore and remove event handlers Everyplay.SetThumbnailTargetTexture(null); Everyplay.RecordingStarted -= OnRecordingStarted; Everyplay.ThumbnailTextureReady -= OnThumbnailReady; // Destroy thumbnail textures foreach (Texture2D texture in thumbnailTextures) { if (texture != null) { Destroy(texture); } } thumbnailTextures = null; initialized = false; } }
public void StopScreenCap(string jsonstr) { #if UNITY_ANDROID // //ShareREC.OnRecorderStoppedHandler 这里可以监听停止录制之后可以干的事情,开始录制也一样 // ShareREC.OnRecorderStoppedHandler = StopRecorderEnd;//不能在这个函数中回传路径给移动端,因为视频可能还没有合成成功,要监听事件之后成功后再传 // //这里记得加判断,如果jsonstr有值,说明要删除视频 // if(jsonstr.Length>=1) // isDeleteVideo = true; // ShareREC.StopRecorder (); Everyplay.RecordingStopped += EveryPlayStopREC; Everyplay.StopRecording(); #endif #if UNITY_IPHONE /// if(jsonstr.Length >=1) // { // isDeleteVideoIniOS = true; // } // FinishedRecordEvent evt = new FinishedRecordEvent(recordFinishedHandler); /// ShareREC.stopRecording(evt); //ShareRECIOS.stopRecording(evt); Everyplay.StopRecording(); Everyplay.RecordingStopped += EveryPlayStopREC; #endif }
void OnPreRender() { #if EVERYPLAY_NATIVE_PLUGIN GL.IssuePluginEvent(EPSR); #else Everyplay.SnapshotRenderbuffer(); #endif }
public static void FaceCamSetPreviewOrigin(Everyplay.FaceCamPreviewOrigin origin) { if (EveryplayInstance != null) { #if EVERYPLAY_BINDINGS_ENABLED EveryplayFaceCamSetPreviewOrigin((int) origin); #endif } }
public static void FaceCamSetRecordingMode(Everyplay.FaceCamRecordingMode mode) { if (EveryplayInstance != null && hasMethods == true) { #if EVERYPLAY_FACECAM_BINDINGS_ENABLED EveryplayFaceCamSetRecordingMode((int)mode); #endif } }
void OnApplicationQuit() { RemoveAllEvents(); appIsClosing = true; sharedInstance = null; }
// Monobehaviour methods void OnApplicationQuit() { if (currentThumbnailTargetTexture != null) { SetThumbnailTargetTexture(null); currentThumbnailTargetTexture = null; } RemoveAllEventHandlers(); appIsClosing = true; everyplayInstance = null; }
public static void FaceCamSetPreviewOrigin(Everyplay.FaceCamPreviewOrigin origin) { if (EveryplayInstance != null && hasMethods == true) { #if EVERYPLAY_FACECAM_BINDINGS_ENABLED EveryplayFaceCamSetPreviewOrigin((int) origin); #endif } }
public static void LoadThumbnailFromFilePath(string filePath, Everyplay.ThumbnailLoadReadyDelegate readyDelegate, Everyplay.ThumbnailLoadFailedDelegate failedDelegate) { if(EveryplayInstance != null) { #if ((UNITY_IPHONE && EVERYPLAY_IPHONE) || (UNITY_ANDROID && EVERYPLAY_ANDROID)) && !UNITY_EDITOR EveryplayInstance.AsyncLoadThumbnailFromFilePath(filePath, readyDelegate, failedDelegate); #endif } }
public static void MakeRequest(string method, string url, Dictionary<string, object> data, Everyplay.RequestReadyDelegate readyDelegate, Everyplay.RequestFailedDelegate failedDelegate) { if(EveryplayInstance != null) { EveryplayInstance.AsyncMakeRequest(method, url, data, readyDelegate, failedDelegate); } }
public void FaceCamSetPreviewOrigin(Everyplay.FaceCamPreviewOrigin origin) { Everyplay.FaceCamSetPreviewOrigin(origin); }
public static void FaceCamSetPreviewOrigin(Everyplay.FaceCamPreviewOrigin origin) { if(EveryplayInstance != null) { #if ((UNITY_IPHONE && EVERYPLAY_IPHONE) || (UNITY_ANDROID && EVERYPLAY_ANDROID)) && !UNITY_EDITOR EveryplayFaceCamSetPreviewOrigin((int)origin); #endif } }
public void MakeRequest(string method, string url, Dictionary<string, object> data, Everyplay.RequestReadyDelegate readyDelegate, Everyplay.RequestFailedDelegate failedDelegate) { Everyplay.MakeRequest(method, url, data, readyDelegate, failedDelegate); }
public void LoadThumbnailFromFilePath(string filePath, Everyplay.ThumbnailLoadReadyDelegate readyDelegate, Everyplay.ThumbnailLoadFailedDelegate failedDelegate) { Everyplay.LoadThumbnailFromFilePath(filePath, readyDelegate, failedDelegate); }
// Private instance methods private void AsyncLoadThumbnailFromFilePath(string filePath, Everyplay.ThumbnailLoadReadyDelegate readyDelegateMethod, Everyplay.ThumbnailLoadFailedDelegate failedDelegateMethod) { if(filePath != null) { StartCoroutine(LoadThumbnailEnumerator(filePath, readyDelegateMethod, failedDelegateMethod)); } else { failedDelegateMethod("Everyplay error: Thumbnail is not ready."); } }
// Monobehaviour methods void OnApplicationQuit() { RemoveAllEventHandlers(); appIsClosing = true; everyplayInstance = null; }
private IEnumerator MakeRequestEnumerator(string method, string url, Dictionary<string, object> data, Everyplay.RequestReadyDelegate readyDelegate, Everyplay.RequestFailedDelegate failedDelegate) { if(data == null) { data = new Dictionary<string, object>(); } if(url.IndexOf("http") != 0) { if(url.IndexOf("/") != 0) { url = "/" + url; } url = "https://api.everyplay.com" + url; } method = method.ToLower(); #if UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 Hashtable headers = new Hashtable(); #else Dictionary<string, string> headers = new Dictionary<string, string>(); #endif string accessToken = AccessToken(); if(accessToken != null) { headers["Authorization"] = "Bearer " + accessToken; } else { if(url.IndexOf("client_id") == -1) { if(url.IndexOf("?") == -1) { url += "?"; } else { url += "&"; } url += "client_id=" + clientId; } } data.Add("_method", method); string dataString = Json.Serialize(data); byte[] dataArray = System.Text.Encoding.UTF8.GetBytes(dataString); headers["Accept"] = "application/json"; headers["Content-Type"] = "application/json"; headers["Data-Type"] = "json"; headers["Content-Length"] = dataArray.Length.ToString(); WWW www = new WWW(url, dataArray, headers); yield return www; if(!string.IsNullOrEmpty(www.error) && failedDelegate != null) { failedDelegate("Everyplay error: " + www.error); } else if(string.IsNullOrEmpty(www.error) && readyDelegate != null) { readyDelegate(www.text); } }
private void AsyncMakeRequest(string method, string url, Dictionary<string, object> data, Everyplay.RequestReadyDelegate readyDelegate, Everyplay.RequestFailedDelegate failedDelegate) { StartCoroutine(MakeRequestEnumerator(method, url, data, readyDelegate, failedDelegate)); }
private IEnumerator LoadThumbnailEnumerator(string fileName, Everyplay.ThumbnailLoadReadyDelegate readyDelegateMethod, Everyplay.ThumbnailLoadFailedDelegate failedDelegateMethod) { WWW www = new WWW("file://" + fileName); yield return www; if(!string.IsNullOrEmpty(www.error)) { failedDelegateMethod("Everyplay error: " + www.error); } else { if(www.texture) { readyDelegateMethod(www.texture); } else { failedDelegateMethod("Everyplay error: Loading thumbnail failed."); } } }