IEnumerator ContadorPisoVerde() { cont cc = c.GetComponent <cont>(); if (material[x].ToString() == "Piso_EstalaDown (UnityEngine.Material)") { cc.p2 += 1; } else if (material[x].ToString() == "piso rojo (UnityEngine.Material)") { cc.p2 += 1; cc.p1 -= 1; } HUD_Bar.PuntuacionVerde(cc.p2); HUD_Bar.FillVerde.color = HUD_Bar.GradVerde.Evaluate(HUD_Bar.sliderVerde.normalizedValue); Debug.Log("verde" + cc.p2); yield return(new WaitForSeconds(.1f)); }
IEnumerator ContadorPisoRojo() { cont cc = c.GetComponent <cont>(); if (material[x].ToString() == "Piso_EstalaDown (UnityEngine.Material)") { cc.p1 += 1; } else if (material[x].ToString() == "piso verde (UnityEngine.Material)") { cc.p2 -= 1; cc.p1 += 1; } HUD_Bar.PuntuacionNaranja(cc.p1); HUD_Bar.FillNaranja.color = HUD_Bar.GradNaranja.Evaluate(HUD_Bar.sliderNaranja.normalizedValue); Debug.Log("rojo" + cc.p1); yield return(new WaitForSeconds(.1f)); }
void Update() { if (!mActive) { return; } if (mReset) { mNextChar = 0; mLabel.text = ""; mCurrentOffset = 0; mReset = false; if (mSupportRichText) { mFullText = ReplaceCharInTag(val); } else { mFullText = val; } } while (mCurrentOffset < mFullText.Length && mNextChar <= Time.unscaledTime) { int lastOffset = mCurrentOffset; charsPerSecond = Mathf.Max(1, charsPerSecond); // Automatically skip all symbols while (ParseSymbol(mFullText, ref mCurrentOffset)) { } ++mCurrentOffset; // Periods and end-of-line characters should pause for a longer time. float delay = 1f / charsPerSecond; char c = (lastOffset < mFullText.Length) ? mFullText[lastOffset] : '\n'; if (c == ' ') { delay += delayOnSpace; } if (mNextChar == 0f) { mNextChar = Time.unscaledTime + delay; } else { mNextChar += delay; } if (mSupportRichText) { cont ct = GetRealIndex(mCurrentOffset - 1); mLabel.text = val.Substring(0, ct.realIdx + 1) + (ct.bCont ? ct.endStr : ""); } else { mLabel.text = mFullText.Substring(0, mCurrentOffset);; } } if (mCurrentOffset == mFullText.Length) { onFinished.Invoke(); mActive = false; } }