/// <summary> /// Pause or resume current game /// </summary> public void PauseOrResumeGame() { pauseState = !pauseState; panel.SetActive(pauseState); GameSessionController.Instance.ActualGameState = (pauseState ? Enumerators.GameStates.PAUSE : Enumerators.GameStates.GAMEPLAY); ConfigurationsController.ToggleCursor(pauseState); }
public CommentsActivity() { localStorage = SimpleStorage.EditGroup("Login"); Usuario_Fotos_Perfil = new Dictionary <KeyValuePair <string, string>, byte[]>(); List <ConfiguracionesModel> config = new ConfigurationsController().GetListConfiguraciones(); usuario_imagen_path = config.Find(parametro => parametro.Parametro_Descripcion == "RUTA DE IMAGENES DE PERFILES DE USUARIOS").Parametro_Varchar_1; publicaciones_imagen_path = config.Find(parametro => parametro.Parametro_Descripcion == "RUTA DE IMAGENES DE PUBLICACIONES").Parametro_Varchar_1; }
void Start() { configurationsController = GetComponent <ConfigurationsController>(); if (PlayerPrefs.HasKey("name") && PlayerPrefs.HasKey("player")) { Debug.Log(PlayerPrefs.GetString("name")); GameObject.Find("Name").GetComponent <Text>().text = "Name: " + PlayerPrefs.GetString("name"); GameObject.Find("Player").GetComponent <Text>().text = "Player: " + PlayerPrefs.GetString("player"); } }
private void Awake() { ConfigurationsController.ToggleCursor(true); GetRequiredComponents(); Translate(); BindEventListeners(); AudioController.Instance.ChangeMusic(AudioController.Instance.AllLoopedSongs[3], false, string.Empty, true, false); }
/// <summary> /// Pass values /// </summary> /// <param name="timeScore"></param> /// <param name="bestCombo"></param> /// <param name="currentScore"></param> public void CallLevelComplete(float timeScore, int bestCombo, long currentScore) { ConfigurationsController.ToggleCursor(true); this.timeScore = Mathf.FloorToInt(timeScore); this.bestCombo = bestCombo; this.currentScore = currentScore; this.numberOfBalls = FindObjectsOfType <Ball>().Length; StartCoroutine(LevelComplete()); }
private void Awake() { coversDictionary = new Dictionary <string, Sprite>(); Time.timeScale = 1f; ConfigurationsController.ToggleCursor(true); FillCoversDictionary(); GetRequiredComponents(); Translate(); BindEventListeners(); GetSongInfo(); defaultColor = repeatButtonImage.color; }
private void Awake() { Instance = this; ConfigurationsController.ToggleCursor(true); GetRequiredComponents(); Translate(); BindEventListeners(); AudioController.Instance.ChangeMusic(AudioController.Instance.AllLoopedSongs[0], false, string.Empty, true, false); // Resets for animation works Time.timeScale = 1f; HasSavedGame = ProgressManager.HasProgress(); }
/// <summary> /// Apply selected values /// </summary> private void ApplyValues() { try { ConfigurationsController.SetAudioSourceVolume(AudioController.Instance.AudioSourceBGM, (BGMVolume / (BGMVolume > 1f ? 100f : 1f))); ConfigurationsController.SetAudioSourceVolume(AudioController.Instance.AudioSourceME, (MEVolume / (MEVolume > 1f ? 100f : 1f))); ConfigurationsController.SetAudioSourceVolume(AudioController.Instance.AudioSourceSFX, (SFXVolume / (SFXVolume > 1f ? 100f : 1f))); AudioController.Instance.MaxBGMVolume = BGMVolume; AudioController.Instance.MaxMEVolume = MEVolume; AudioController.Instance.MaxSFXVolume = SFXVolume; } catch (Exception ex) { throw ex; } }
public void Initialize() { this.MockUrlHelper(); this.MockViewModelFactory(); this.InitializeConfiguration(); this.InitializeConfigurationViewAll(); this.MockDbSet(); this.MockConfigurationService(); this.MockDeploymentServerLogging(); this.controller = new ConfigurationsController(this.Context, this.ConfigurationService, this.DeploymentServerLogging) { Request = new HttpRequestMessage ( HttpMethod .Get, "http://localhost/api/v2/configurations"), Configuration = new HttpConfiguration(), RequestContext = { RouteData = new HttpRouteData( new HttpRoute(), new HttpRouteValueDictionary { { "controller", "configurations" } }) } }; }
public void GenerarPago() { Parametros = new ConfigurationsController().GetListConfiguraciones(); string varEstatus = "Correcto|0"; try { if (Parametros.Count > 0) { //Cpnfiguración string varServidor = Parametros[0].Parametro_Varchar_1; string varIp = Parametros[0].Parametro_Varchar_2; string varSolicitudUrl = Parametros[0].Parametro_Varchar_3; string varCuenta = Parametros[0].Parametro_Varchar_4; string varPuerto = Parametros[0].Parametro_Int_1; string varVersion = Parametros[0].Parametro_Int_2; string varTerminalId = Parametros[1].Parametro_Varchar_1; //Transacción string varTransaccionFecha = DateTime.Today.ToString("MMddyyyy"); string varCuentaDatos = ""; string varTransaccionCodigo = ""; string varSolicitudTipo = ""; decimal varPagoImportePagado = 0; string varTransaccionImporte = Math.Truncate(varPagoImportePagado * 100).ToString(); string varSesionId = ""; string varOrdenVentaId = ""; string varMiembroId = ""; //Post string varEnviar = "Request=" + varSolicitudTipo; varEnviar += "&Version=" + varVersion; varEnviar += "&HD.Network_Status_Byte=*"; varEnviar += "&HD.Application_ID=HZ0000GC"; varEnviar += "&HD.Terminal_ID=" + varTerminalId; varEnviar += "&HD.Device_Tag=" + varSesionId; varEnviar += "&01.POS_Entry_Capability=02"; varEnviar += "&01.Account_Entry_Mode=01"; varEnviar += "&01.Partial_Auth_Indicator=0"; varEnviar += "&01.Account_Data=" + varCuentaDatos; varEnviar += "&01.Transaction_Amount=" + varTransaccionImporte; varEnviar += "&10.CVV2_Indicator=9"; varEnviar += "&10.CVV2_Value=" + varTransaccionCodigo; //varEnviar += "&11.Customer_Code=WL100000000000000"; //+ varMiembroId; //varEnviar += "&12.Invoice_Number=" + varOrdenVentaId; //Este valor se utiliza para incluir la factura de la transacción local del TPV o el número de pedido. Este es un valor necesario para transacciones de pedido por correo y comercio electrónico. //varEnviar += "&12.Shipping_Date=" + varTransaccionFecha; //El valor es la fecha en que se enviaron los bienes del consumidor.Este valor es la "Fecha de transacción" para las transacciones de marketing directo y de comercio electrónico. byte[] varDatos = Encoding.ASCII.GetBytes(varEnviar); ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; var varUrl = "https://" + varServidor + ":" + varPuerto + varSolicitudUrl; var wbrSolicitud = (HttpWebRequest)WebRequest.Create(new Uri(varUrl)); wbrSolicitud.Method = "POST"; wbrSolicitud.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"; wbrSolicitud.Host = varServidor + ":" + varPuerto; wbrSolicitud.Accept = "application/x-www-form-urlencoded"; wbrSolicitud.ContentType = "application/x-www-form-urlencoded"; wbrSolicitud.ContentLength = varDatos.Length; wbrSolicitud.Headers.Add("Registration-Key", varCuenta); Stream srmDatosSolicitud = wbrSolicitud.GetRequestStream(); srmDatosSolicitud.Write(varDatos, 0, varDatos.Length); srmDatosSolicitud.Close(); WebResponse wbrRespuesta = wbrSolicitud.GetResponse(); string varRespuestaEstatus = ((HttpWebResponse)wbrRespuesta).StatusDescription; if (varRespuestaEstatus == "OK") { srmDatosSolicitud = wbrRespuesta.GetResponseStream(); StreamReader srmDatosRespuesta = new StreamReader(srmDatosSolicitud, Encoding.UTF8); string varLinea = string.Empty; string varTransaccionId = string.Empty; string varTransaccionAutorizacion = string.Empty; string varTransaccionNumero = string.Empty; string varRespuestaCompleta = string.Empty; while ((varLinea = srmDatosRespuesta.ReadLine()) != null) { if (varLinea.Contains("RD.Device_Tag=")) { int varCaracterInicio = varLinea.IndexOf("=") + 1; int varCaracterFin = varLinea.Length - varCaracterInicio; varTransaccionId = varLinea.Substring(varCaracterInicio, varCaracterFin); } if (varLinea.Contains("02.Authorization_Response=")) { int varCaracterInicio = varLinea.IndexOf("=") + 1; int varCaracterFin = varLinea.Length - varCaracterInicio; varTransaccionAutorizacion = varLinea.Substring(varCaracterInicio, varCaracterFin); } if (varLinea.Contains("02.Trace_Number=")) { int varCaracterInicio = varLinea.IndexOf("=") + 1; int varCaracterFin = varLinea.Length - varCaracterInicio; varTransaccionNumero = varLinea.Substring(varCaracterInicio, varCaracterFin); } varRespuestaCompleta = varRespuestaCompleta + varLinea + "\r\n"; } if (varTransaccionId == varSesionId) { if (string.IsNullOrEmpty(varRespuestaCompleta) == false) { ConfiguracionesModel rutaPagos = new ConfigurationsController().GetConfiguraciones("10"); if (rutaPagos.Equals(null)) { string varArchivo = "ID ORDEN DE VENTA " + varOrdenVentaId + ", ID MIEMBRO " + varMiembroId + ", ID SESION " + varSesionId + ".txt"; if (varTransaccionAutorizacion == "APROBADA" || varTransaccionAutorizacion == "APPROVAL") { string varArchivoPago = Path.Combine("", rutaPagos.Parametro_Varchar_3 + varArchivo); File.WriteAllText(varArchivoPago, varRespuestaCompleta, Encoding.UTF8); varEstatus = "Correcto|" + varTransaccionNumero.Trim().Replace("02.Trace_Number=", ""); } else { string varArchivoPago = Path.Combine("", rutaPagos.Parametro_Varchar_4 + varArchivo); File.WriteAllText(varArchivoPago, varRespuestaCompleta, Encoding.UTF8); varEstatus = "Incorrecto|0"; } } } else { varEstatus = "Incorrecto|0"; } } else { varEstatus = "Incorrecto|0"; } srmDatosRespuesta.Close(); } else { varEstatus = "Incorrecto|0"; } srmDatosSolicitud.Close(); wbrRespuesta.Close(); } } catch (Exception e) { SlackLogs.SendMessage(e.Message, GetType().Name, "GenerarPago"); } }
public ConfigurationsUnitTests() { _laptopService = new ECommerceConfigDataFake(); _controller = new ConfigurationsController(_laptopService); }
/// <summary> /// Choose volume value /// </summary> /// <param name="labelButton"> Instance of Label Button </param> /// <param name="volumeButton"> Instance of Volume Button </param> /// <param name="volumeButtonLabel"> Instance of Volume Button Label </param> /// <param name="audioSource"> Instance of Audio Source </param> private void ChooseVolume(Button labelButton, Button volumeButton, TextMeshProUGUI volumeButtonLabel, AudioSource audioSource) { if (volumeButton.interactable) { InputControl currentControl = navigateAction.activeControl; Vector2 current = Vector2.zero; string volumeText = volumeButtonLabel.text; volumeText = volumeText.Replace("%", ""); float volume = float.Parse(volumeText); if (currentControl != null && currentControl.IsPressed()) { current = navigateAction.ReadValue <Vector2>(); } // Horizontal inputs if (current == Vector2.right) { if (volume >= 100) { return; } timeToWaitUpdateVolume -= Time.fixedDeltaTime; if (timeToWaitUpdateVolume <= 0) { volume++; volume = (volume >= 100 ? 100 : volume); volumeButtonLabel.text = string.Concat(volume, "%"); timeToWaitUpdateVolume = startTimeToWaitUpdateVolume; } } else if (current == Vector2.left) { if (volume <= 0) { return; } timeToWaitUpdateVolume -= Time.fixedDeltaTime; if (timeToWaitUpdateVolume <= 0) { volume--; volume = (volume <= 0 ? 0 : volume); volumeButtonLabel.text = string.Concat(volume, "%"); timeToWaitUpdateVolume = startTimeToWaitUpdateVolume; } } if (audioSource == AudioController.Instance.AudioSourceBGM) { BGMVolume = volume / 100f; ConfigurationsController.SetAudioSourceVolume(AudioController.Instance.AudioSourceBGM, BGMVolume); } else if (audioSource == AudioController.Instance.AudioSourceSFX) { SFXVolume = volume / 100f; ConfigurationsController.SetAudioSourceVolume(AudioController.Instance.AudioSourceSFX, SFXVolume); } else if (audioSource == AudioController.Instance.AudioSourceME) { MEVolume = volume / 100f; ConfigurationsController.SetAudioSourceVolume(AudioController.Instance.AudioSourceME, MEVolume); } if (current == Vector2.left || current == Vector2.right) { if (audioSource == AudioController.Instance.AudioSourceSFX) { timeToPlaySound -= Time.fixedDeltaTime; if (timeToPlaySound <= 0) { AudioController.Instance.PlaySFX(AudioController.Instance.PowerUpSound, SFXVolume); timeToPlaySound = startTimeToPlaySound; } } else if (audioSource == AudioController.Instance.AudioSourceME) { timeToPlaySound -= Time.fixedDeltaTime; if (timeToPlaySound <= 0) { AudioController.Instance.PlaySFX(AudioController.Instance.NewScoreEffect, MEVolume); timeToPlaySound = startTimeToPlaySound; } } } if (cancelAction.triggered) { AudioController.Instance.PlaySFX(AudioController.Instance.UiCancelSound, SFXVolume); volumeButton.interactable = false; ToggleButtonColor(volumeButton); ToggleAllLabelButtonsInteractable(); labelButton.Select(); } if (submitAction.triggered) { volumeButton.onClick.Invoke(); } } }