public void Check() { if (slotText[0].text.ToString() == "" || slotText[1].text.ToString() == "" || slotText[2].text.ToString() == "" || slotText[3].text.ToString() == "") { SSTools.ShowMessage("Please fill all boxes", SSTools.Position.bottom, SSTools.Time.threeSecond); return; } if (int.Parse(slotText[0].text.ToString()) == 0) { SSTools.ShowMessage("You can not put 0 at first box", SSTools.Position.bottom, SSTools.Time.threeSecond); return; } else { CheckValues(); } guessTime++; prefabText = Instantiate(prefabText, new Vector3(0, 0, 0), Quaternion.identity) as GameObject; prefabText.GetComponent <Text>().text = guessTime + ". " + slotText[0].text + slotText[1].text + slotText[2].text + slotText[3].text + " |" + "+" + plus + "-" + minus + "| "; prefabText.transform.SetParent(GameObject.Find("Content").transform, false); lastGuess.text = "Last Guess: " + guessTime + ". " + slotText[0].text + slotText[1].text + slotText[2].text + slotText[3].text + " |" + "+" + plus + "-" + minus + "| "; if (plus == 4) { CheckForGameWin(); } else { minus = 0; } plus = 0; }
IEnumerator Upload(string Codigo) { WWWForm form = new WWWForm(); form.AddField("codigo", Codigo); UnityWebRequest www = UnityWebRequest.Post("http://40.86.95.152:5000/entrarClase", form); yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError) { Debug.Log(www.error); } else { CodeResponse myCodeClass = JsonUtility.FromJson <CodeResponse>(www.downloadHandler.text); Debug.Log(www.downloadHandler.text); if (myCodeClass.mensaje == "Correcto") { SceneManager.LoadScene("Avatar"); } else { SSTools.ShowMessage("Tu código no esta asociado a ningun maestro", SSTools.Position.bottom, SSTools.Time.threeSecond); } } }
public void add_order_in_list(List <Item> items, int index, int quantity, List <OrderItems> orders) { int addin = -1; OrderItems order = new OrderItems(); for (int i = 0; i < items.Count; i++) { if (items[i].itemid == index) { if (items[i].itemid >= quantity) { addin = i; items[addin].stock = items[addin].stock - quantity; break; } SSTools.ShowMessage("Out of Stock", SSTools.Position.bottom, SSTools.Time.twoSecond); return; } } for (int i = 0; i < orders.Count; i++) { if (addin != -1 && orders[i].fname == items[addin].fname) { orders[i].quantity = orders[i].quantity + quantity; return; } } order.fname = items[addin].fname; order.quantity = quantity; order.price = items[addin].price; orders.Add(order); }
// Update is called once per frame void Update() { if (Input.touchCount == 2) { Touch touchZero = Input.GetTouch(0); Touch touchOne = Input.GetTouch(1); Vector2 touchZeroPrevPos = touchZero.position - touchZero.deltaPosition; Vector2 touchOnePrevPos = touchZero.position - touchOne.deltaPosition; float prevTouchDeltaMagnitude = (touchZeroPrevPos - touchOnePrevPos).magnitude; float touchDeltaMagnitude = (touchZero.position - touchOne.position).magnitude; float deltaMagnitudeDiff = prevTouchDeltaMagnitude - touchDeltaMagnitude; Debug.Log(deltaMagnitudeDiff.ToString()); SSTools.ShowMessage(deltaMagnitudeDiff.ToString(), SSTools.Position.bottom, SSTools.Time.oneSecond); if (camera.orthographic) { camera.orthographicSize -= deltaMagnitudeDiff * orthoZoomSpeed; camera.orthographicSize = Mathf.Max(camera.orthographicSize, 0.1f); } else { // Otherwise change the field of view based on the change in distance between the touches. camera.fieldOfView -= deltaMagnitudeDiff * perspectiveZoomSpeed; // Clamp the field of view to make sure it's between 0 and 180. camera.fieldOfView = Mathf.Clamp(camera.fieldOfView, 0.1f, 179.9f); } } }
public void ApplySettings() { if (inputUsername.GetComponent <InputField>().text.Equals("")) { SSTools.ShowMessage("Please insert a valid Username", SSTools.Position.bottom, SSTools.Time.threeSecond); Debug.Log("Please insert valid username"); return; } else { PlayerPrefs.SetString("userName", inputUsername.GetComponent <InputField>().text); } if (inputIpAdress.GetComponent <InputField>().text.Equals("")) { SSTools.ShowMessage("Please insert a valid Ip-Adress", SSTools.Position.bottom, SSTools.Time.threeSecond); Debug.Log("Please insert valid ip"); return; } else { PlayerPrefs.SetString("ip", inputIpAdress.GetComponent <InputField>().text); } PlayerPrefs.SetString("localPort", "4321"); PlayerPrefs.SetString("remotePort", "4321"); PlayerPrefs.Save(); SSTools.ShowMessage("Settings saved to disk", SSTools.Position.bottom, SSTools.Time.threeSecond); }
public void SetSkin() { string skin = this.gameObject.name; int coins = PlayerPrefs.GetInt("Coins"); string isUnlocked = PlayerPrefs.GetString("UnlockedSkin" + skin); if (isUnlocked == "" || isUnlocked == "false") { if (coins >= price) { TogglePurchaseUI(); purchaseUI.transform.Find("PurchaseText").GetComponent <Text>().text = "Purchase for " + price.ToString() + " coins?"; yesBtn.onClick.AddListener(delegate { BuySkin(isUnlocked, price, coins, skin); }); purchaseUI.transform.Find("SkinImage").GetComponent <Image>().sprite = Resources.Load <Sprite>("Skin" + skin); } else { SSTools.ShowMessage("Not enough coins", SSTools.Position.bottom, SSTools.Time.twoSecond); } } if (isUnlocked == "true") { PlayerPrefs.SetString("Skin", "Skin" + skin); PlayerPrefs.Save(); SSTools.ShowMessage("Skin set to " + skin, SSTools.Position.bottom, SSTools.Time.twoSecond); cs.SetCurrentSkin(); } }
public void buyButtonAct(string CanoeOrCoin) { try { if (Price.text.Split("Rp."[2])[1] != null) { CanoeOrCoin = Price.text.Split("Rp."[2])[0]; print(Price.text); print(Price.text.Split("Rp."[2])[0]); print(Price.text.Split("Rp."[2])[1]); SSTools.ShowMessage("Not Implemented Yet", SSTools.Position.bottom, SSTools.Time.oneSecond); } } catch { float val = float.Parse(Price.text); if (ShoppingListManager.MyInstance.Decrease(val)) { Locked.GetComponent <Image>().enabled = false; ShoppingListManager.MyInstance.updateBpught(ItemID); } else { SSTools.ShowMessage(" Not Enough Coins ", SSTools.Position.bottom, SSTools.Time.twoSecond); } } }
// Start is called before the first frame update void Start() { GameObject go = GameObject.Find("SocketIO"); socket = go.GetComponent <SocketIOComponent>(); socket.On("response", (E) => { Debug.Log(E.data["team"]); if (E.data[1].ToString().Equals("false")) { SSTools.ShowMessage("La sala no existe o esta llena", SSTools.Position.bottom, SSTools.Time.twoSecond); } else if (E.data[0].ToString().Equals("true")) { string id = E.data["team"].ToString(); id = id.Substring(0, id.Length - 1); id = id.Substring(1, id.Length - 1); if (id.Equals(team.GetComponent <TeamInfo>().id)) { socket.Emit("callTeams", JSONObject.CreateStringObject(code.GetComponent <UnityEngine.UI.Text>().text)); team.GetComponent <TeamInfo>().name = name.GetComponent <UnityEngine.UI.Text>().text; team.GetComponent <TeamInfo>().code = code.GetComponent <UnityEngine.UI.Text>().text; Navegar navegar = new Navegar(); navegar.navegarSalaEspera(); } } }); }
IEnumerator Upload(string codigo, string oracion) { WWWForm form = new WWWForm(); form.AddField("codigo", codigo); form.AddField("oracion", oracion); SSTools.ShowMessage("entre al resquest", SSTools.Position.bottom, SSTools.Time.twoSecond); UnityWebRequest www = UnityWebRequest.Post("http://40.86.95.152:5000/traduccion", form); yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError) { SSTools.ShowMessage(www.error, SSTools.Position.bottom, SSTools.Time.twoSecond); Debug.Log(www.error); } else { if (www.downloadHandler.isDone) { SSTools.ShowMessage(www.downloadHandler.text, SSTools.Position.bottom, SSTools.Time.twoSecond); //SceneManager.LoadScene("Voice"); } else { Debug.Log("false"); SSTools.ShowMessage("Upps hubo un error", SSTools.Position.bottom, SSTools.Time.twoSecond); } } }
//Start is called before the first frame update void Start() { Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => { var dependencyStatus = task.Result; if (dependencyStatus == Firebase.DependencyStatus.Available) { // Create and hold a reference to your FirebaseApp, // where app is a Firebase.FirebaseApp property of your application class. // app = Firebase.FirebaseApp.DefaultInstance; SSTools.ShowMessage("Firebase Analytics is Initilized Dependency Status : " + dependencyStatus, SSTools.Position.top, SSTools.Time.threeSecond); // Set a flag here to indicate whether Firebase is ready to use by your app. } else { // UnityEngine.Debug.LogError(System.String.Format( SSTools.ShowMessage("Could not resolve all Firebase dependencies: {0}" + dependencyStatus, SSTools.Position.top, SSTools.Time.threeSecond); // Firebase Unity SDK is not safe to use here. } }); Debug.Log("Firebase is Started :"); // SSTools.ShowMessage("Firebase started", SSTools.Position.bottom, SSTools.Time.oneSecond); }
//Select the desired Pawn public void SelectPawn() { string type = ButtonsManager.Base; int index = ButtonsManager.Model; Debug.Log("Base: " + type); Debug.Log("Model: " + index); if (PawnsManager.GetPrefabFromIndex(type, index) != null) { PawnPrefab = PawnsManager.GetPrefabFromIndex(type, index); //Maybe show a text message like "Base Normal HXXX Selected" //Maybe close the panel Debug.Log(PawnPrefab.name + " " + LanguageManager.StringBaseSelected + "!"); SSTools.ShowMessage(PawnPrefab.name + " " + LanguageManager.StringBaseSelected + "!", SSTools.Position.bottom, SSTools.Time.twoSecond); } else { //Maybe show an error text message Debug.Log(LanguageManager.StringBaseNotFound); SSTools.ShowMessage(LanguageManager.StringBaseNotFound, SSTools.Position.bottom, SSTools.Time.twoSecond); } return; }
public void saveInfo() { //checking if fields are empty if (firstNameField.text == "" | lastNameField.text == "" | emailField.text == "" | passwordField.text == "") { print("a" + firstNameField.text + lastNameField.text + emailField.text + passwordField.text); //input field message SSTools.ShowMessage("input field empty", SSTools.Position.bottom, SSTools.Time.twoSecond); return; } else { string x; x = activitymanager.getCustomerLoggedIn().getEmail(); print("x" + x); //fields not empty activitymanager.getCustomerLoggedIn().setFirstName(firstNameField.text); activitymanager.getCustomerLoggedIn().setLastName(lastNameField.text); activitymanager.getCustomerLoggedIn().setEmail(emailField.text); activitymanager.getCustomerLoggedIn().setPassword(passwordField.text); print("x" + x); //only neccessary if email changes //if(emailField.text != x){ // canvas.GetComponent<loginActivity> ().editCustomerInfo (activitymanager.getCustomerLoggedIn().getID()); //} canvas.GetComponent <loginActivity> ().saveCustomer(activitymanager.getCustomerLoggedIn()); SSTools.ShowMessage("info saved", SSTools.Position.bottom, SSTools.Time.twoSecond); } }
IEnumerator Upload(string Email) { WWWForm form = new WWWForm(); form.AddField("correo", Email); UnityWebRequest www = UnityWebRequest.Post("http://40.86.95.152:5000/codigo", form); yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError) { Debug.Log(www.error); } else { MyCodeClass myCodeClass = JsonUtility.FromJson <MyCodeClass>(www.downloadHandler.text); Debug.Log(www.downloadHandler.text); if (www.downloadHandler.isDone) { PlayerPrefs.SetString("codigo", myCodeClass.codigo); SceneManager.LoadScene("Voice"); } else { Debug.Log("false"); SSTools.ShowMessage("Upps hubo un error", SSTools.Position.bottom, SSTools.Time.twoSecond); } } }
IEnumerator Upload(string Email) { WWWForm form = new WWWForm(); form.AddField("correo", Email); UnityWebRequest www = UnityWebRequest.Post("http://40.86.95.152:5000/registro", form); yield return(www.SendWebRequest()); if (www.isNetworkError || www.isHttpError) { SSTools.ShowMessage(www.error, SSTools.Position.bottom, SSTools.Time.oneSecond); Debug.Log(www.error); } else { RegistroResponse myCodeClass = JsonUtility.FromJson <RegistroResponse>(www.downloadHandler.text); Debug.Log(www.downloadHandler.text); if (myCodeClass.mensaje == "Registro exitoso") { SSTools.ShowMessage("Cambiar scene", SSTools.Position.bottom, SSTools.Time.oneSecond); SceneManager.LoadScene("LoginTeacher"); } else { SSTools.ShowMessage("Algo salió mal", SSTools.Position.bottom, SSTools.Time.threeSecond); } } }
// Start is called before the first frame update void Start() { gameManager = GameManager.GetInstance(); keysRequired = 3; SSTools.ShowMessage("Get Keys & Reach the Goal", SSTools.Position.top, SSTools.Time.threeSecond); }
public void SetLevel() { Debug.Log("klikam"); PlayerPrefs.SetString("GameLevel", this.gameObject.name); PlayerPrefs.Save(); SSTools.ShowMessage("Level set to " + this.gameObject.name, SSTools.Position.bottom, SSTools.Time.twoSecond); cl.SetCurrentLevel(); }
/// <summary> /// Metodo que se ejecuta al presionar el código para copiar en Portapapeles /// </summary> public void CopyToClipboard() { Text invitationCode = GameObject.Find("TxtCode").GetComponent <Text>(); //EditorGUIUtility.systemCopyBuffer = invitationCode.text; SSTools.ShowMessage(LocalizationManager.instance.GetLocalizedValue("message_lobby_code_copied"), SSTools.Position.bottom, SSTools.Time.oneSecond); }
public void StartSinglePlayer() { Scenes.Drop(); SSTools.ShowMessage("Start singlePalyer Clicked", SSTools.Position.bottom, SSTools.Time.oneSecond); Scenes.setParam("multiplayer", "false"); Scenes.MyLoad("Cubes"); //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); }
public bool checkOrderListEmpty(List <OrderItems> orderItems) { if (orderItems.Count == 0) { SSTools.ShowMessage("Place Some Order First", SSTools.Position.bottom, SSTools.Time.twoSecond); return(false); } return(true); }
//clear objects on scene and AR session public void ClearAll() { SSTools.ShowMessage("ClearAll", SSTools.Position.bottom, SSTools.Time.twoSecond); ClearFurniture(); //reset the AR tracking //Destroy(sessionOriginTmp.gameObject); //sessionOriginTmp = null; //sessionOriginTmp = Instantiate(m_SessionOrigin, Vector3.zero, Quaternion.identity); }
/// <summary> /// Metodo que se ejecuta al presionar enviar codigo (envia el codigo de activacion para registrarse) /// </summary> public void ClickSendConfirmation() { InputField username = GameObject.Find("/Canvas/SignUpPanel/TFUsername").GetComponent <InputField>(); Debug.Log(username); InputField correo = GameObject.Find("/Canvas/SignUpPanel/TFEmail").GetComponent <InputField>(); InputField password = GameObject.Find("/Canvas/SignUpPanel/TFPassword").GetComponent <InputField>(); InputField confirmationPass = GameObject.Find("/Canvas/SignUpPanel/TFConfirmation").GetComponent <InputField>(); Debug.Log("Comparando contraseñas"); string hashPass = HashManager.GeneratePasswordHash(password.text); string hashPassConfirmation = HashManager.GeneratePasswordHash(confirmationPass.text); if (username.text == null || correo.text == null || password.text == null || confirmationPass == null) { Debug.Log("Hay campos vacios"); SSTools.ShowMessage(LocalizationManager.instance.GetLocalizedValue("message_empty_fields"), SSTools.Position.bottom, SSTools.Time.oneSecond); } else { if (hashPassConfirmation.Equals(hashPass)) { GameObject.Find("/Canvas/SignUpPanel").SetActive(false); GameObject VerificationSignUpPanel = BuscarObjetoInactivo("VerificationSignUpPanel"); VerificationSignUpPanel.SetActive(true); string nombre = username.text; string email = correo.text; Jugador.instance.Username = nombre; Jugador.instance.Pass = hashPass; Jugador.instance.Correo = email; Jugador.instance.PartidasGanadas = 0; Jugador.instance.PartidasJugadas = 0; Debug.Log("Datos antes de clase mail = " + nombre + ", " + email); MailMessage mail = new MailMessage(nombre, email); string mailData = JsonConvert.SerializeObject(mail); Debug.Log("JSON = " + mailData); Debug.Log("Enviando codigo de activacion a " + correo.text); ConnectionManager.instance.socket.Emit("sendActivationCode", mailData); username.text = ""; correo.text = ""; password.text = ""; confirmationPass.text = ""; } else { Debug.Log("La contraseña y la confirmacion de la contraseñ son diferentes"); SSTools.ShowMessage(LocalizationManager.instance.GetLocalizedValue("passwords_diferent"), SSTools.Position.bottom, SSTools.Time.oneSecond); } } }
IEnumerator Submit() { WWW www; Hashtable postHeader = new Hashtable(); postHeader.Add("Content-Type", "application/json"); LoginObject postData = new LoginObject(); postData.Username = userName.text; postData.Password = userPassword.text; var jsonData = JsonMapper.ToJson(postData); //var formData = System.Text.Encoding.UTF8.GetBytes("{'Username':'******', 'Password':'******'}"); if (Constant.CheckNetworkAvailability()) { www = new WWW(Constant.LOGIN_URL, System.Text.Encoding.UTF8.GetBytes(jsonData), postHeader); yield return(www); if (www.text.Equals("null")) { alertText.text = "Check Your User Name Password"; } //else if (www.text != null) //{ // string[] msg = www.text.Split(char.Parse(":")); // if (msg[1].Equals("\"An error has occurred.\"}")) // { // print("An error has occurred!!!!!!!!!!!!!"); // } //} else { Debug.Log("request success"); alertText.text = "Login Success"; landingPanel.SetActive(true); //loginPannel.enabled = false; print(www.text); var userData = JsonMapper.ToObject <PlayerObject>(www.text); PlayerPrefsUtil.SavePlayer(userData); titleText.text = "Hi " + userData.Name.ToString(); loggedUsername = userData.Name; StartCoroutine(Deactivatetext()); } } else { SSTools.ShowMessage("No Network Connection", SSTools.Position.bottom, SSTools.Time.oneSecond); } }
public void LoginButtonPressed() { Debug.Log("hey"); FirebaseAuth.DefaultInstance.SignInWithEmailAndPasswordAsync(email.text, password.text). ContinueWith((obj) => { SSTools.ShowMessage(email.text, SSTools.Position.bottom, SSTools.Time.oneSecond); SceneManager.LoadSceneAsync("MainGame"); }); }
public void add_in_database() { if (checkTableNO(totalItems[0].tableno, tableNo.text) && checkOrderListEmpty(orders)) { string time = DateTime.Now.ToString("h:mm:ss tt"); Adaptor adaptor = RESTConnect.Instance; adaptor.send(orders, items, Convert.ToInt32(tableNo.text), time, linkName); SSTools.ShowMessage("Order Confirmed", SSTools.Position.bottom, SSTools.Time.twoSecond); } }
public void HandleUserEarnedReward(object sender, Reward args) { SSTools.ShowMessage("Reward Received!", SSTools.Position.bottom, SSTools.Time.twoSecond); PlayerControl.health = PlayerPrefs.GetInt("DefaultMaxHP"); gameOver.InactiveSetup(); PlayerControl.isDead = false; PlayerControl.playerCanShoot = true; SceneManager.LoadScene("Main"); }
// Use this for initialization void Start() { SSTools.ShowMessage("object spawned", SSTools.Position.bottom, SSTools.Time.twoSecond); //m_SessionOrigin = FindObjectOfType<ARSessionOrigin>().GetComponent<ARSessionOrigin>(); m_SessionOrigin = GameObject.FindGameObjectWithTag("ARSO").GetComponent <ARSessionOrigin>(); //meshRenderer = GetComponent<Renderer>(); //shaderOutline = Shader.Find("Custom/Outline"); //shaderBump = Shader.Find("Mobile/Bumped Diffuse"); //meshRenderer.material.shader = shaderBump; }
public void setIndex(Button button) { if (button.name.Equals("ButtonTree_1")) { m_currentObjectIndex = 0; } else if (button.name.Equals("ButtonTree_2")) { m_currentObjectIndex = 1; } else if (button.name.Equals("ButtonTiger")) { m_currentObjectIndex = 2; } else if (button.name.Equals("ButtonElephant")) { m_currentObjectIndex = 3; } else if (button.name.Equals("ButtonRhino")) { m_currentObjectIndex = 4; } else if (button.name.Equals("ButtonZebra")) { m_currentObjectIndex = 5; } else if (button.name.Equals("ButtonHorse")) { m_currentObjectIndex = 6; } else if (button.name.Equals("ButtonBeagle")) { m_currentObjectIndex = 7; } else if (button.name.Equals("ButtonTree_3")) { m_currentObjectIndex = 8; } else if (button.name.Equals("ButtonTree_4")) { m_currentObjectIndex = 9; } else if (button.name.Equals("ButtonBush_1")) { m_currentObjectIndex = 10; } else if (button.name.Equals("ButtonBush_2")) { m_currentObjectIndex = 11; } else if (button.name.Equals("BuildButton")) { SSTools.ShowMessage("Will Destroy The Habitat", SSTools.Position.bottom, SSTools.Time.twoSecond); } }
//show or hide AR mesh of floor public void DisplayTracking() { boolTrackingOnOff = !boolTrackingOnOff; Material mat = boolTrackingOnOff ? featheredPlaneMaterial : transparentPlaneMaterial; SSTools.ShowMessage("DisplayTracking " + boolTrackingOnOff.ToString(), SSTools.Position.bottom, SSTools.Time.twoSecond); //if (GameObject.FindGameObjectWithTag("arplane")) //{ // m_PlaneMeshVisualizer = GameObject.FindGameObjectWithTag("arplane"); // m_PlaneMeshVisualizer.GetComponent<ARFeatheredPlaneMeshVisualizer>().SetPlaneMaterial(mat); //} }
//button choose furniture regarding the index i of furnitures public void ChooseFurniture(int i) { SSTools.ShowMessage("ChooseFurniture", SSTools.Position.bottom, SSTools.Time.twoSecond); //clear all outlined buttons before to outline the clicked one //foreach (GameObject b in buttons) //{ // b.GetComponent<Outline>().enabled = false; //} //buttons[i].GetComponent<Outline>().enabled = true; objectSelected = furnitures[i]; }
void BuySkin(string isUnlocked, int price, int coins, string skin) { coins -= price; PlayerPrefs.SetInt("Coins", coins); isUnlocked = "true"; PlayerPrefs.SetString("UnlockedSkin" + skin, isUnlocked); SSTools.ShowMessage("Unlocked skin " + skin + "!", SSTools.Position.bottom, SSTools.Time.twoSecond); PlayerPrefs.Save(); TogglePurchaseUI(); pp.UpdateCoinsCount(); isu.CheckIfUnlocked(); }