public IEnumerator GetSolution(float f) { solution = new ChestSolution(f); while (!solution.GetChests()) { yield return(null); } //Debug.Log("-------FINAL CHESTS!-----"); float finalSum = 0f; for (int i = 0; i < solution.winAmounts.Count; i++) { solution.winAmounts[i] = float.Parse(GameView.BeautifyF(solution.winAmounts[i])); // Debug.Log("FINAL CHEST #" + i + " PRIZE: " + solution.winAmounts[i]); finalSum += solution.winAmounts[i]; } //Debug.Log("Total " + finalSum +"\nAmount of iterations: "+solution.iterationsOnSolution); }
public IEnumerator ShowPrizeAnimation(float prize) { float multiplier = 1f; if (prize > 1f) { multiplier = 1.25f; } if (prize > 50f) { multiplier = 1.5f; } PrizeText.gameObject.SetActive(true); PrizeText.text = "+$" + GameView.BeautifyF(prize); iTween.ScaleTo(PrizeText.gameObject, iTween.Hash("scale", Vector3.one * multiplier, "time", 0.5f, "easeType", iTween.EaseType.easeOutExpo)); yield return(new WaitForSeconds(0.5f)); iTween.MoveTo(PrizeText.gameObject, iTween.Hash("position", prizeLastPos.position, "time", 1.25f, "easeType", iTween.EaseType.easeInExpo)); yield return(new WaitForSeconds(5f)); PrizeText.gameObject.SetActive(false); }