// Update is called once per frame void Update() { if (isCounting) { if (!sumTime) { sum += (int)(countSecond * Time.deltaTime); ++sum; if (sum > ManagerScore.Instance.CurrentScore) { //isCounting = false; sum = ManagerScore.Instance.CurrentScore; CheckCoins(); SetTextNum(); //enabled = false; sumTime = true; currentTime = ManagerTime.Instance.getCurrentTimeOfGame; //Showtime clock.transform.parent = transform; scalesT = TweenScale.Begin(clock.gameObject, 0.3f, new Vector3(1.3f, 1.3f, 1.3f)); scalesT.style = UITweener.Style.PingPong; clock.PlayFinalClock(currentTime / countSecondTime); texteffect.alpha = 1; tweenPos = TweenPosition_2.Begin <TweenPosition_2> (texteffect.gameObject, 0.1f); tweenPos.from = clockWid.transform.localPosition; tweenPos.to = textNum.transform.localPosition; tweenPos.style = UITweener.Style.Loop; } else { if (changued) { } else { CheckCoins(); SetTextNum(); changued = true; StartCoroutine("ChangueText", (secondToChangue)); } // } } else { float aux = (countSecondTime * Time.deltaTime); currentTime -= aux; if (currentTime <= 0) { currentTime += aux; sum += (int)(currentTime * ManagerScore.Instance.TimeBySecondScore); CheckCoins(); SetTextNum(); tweenPos.enabled = false; texteffect.alpha = 0; scalesT.enabled = false; clockWid.alpha = 0; timer.alpha = 0; scalesT = TweenScale.Begin(textNum.gameObject, 0.3f, new Vector3(1.3f, 1.3f, 1.3f)); scalesT.style = UITweener.Style.Once; currentTime = 0; isCounting = false; audioSum.Stop(); audioSum.clip = score03; audioSum.loop = false; audioSum.Play(); Invoke("DisableAudio", score03.length); enabled = false; } else { sum += (int)(aux * ManagerScore.Instance.TimeBySecondScore); CheckCoins(); SetTextNum(); } } } }