/// <summary> /// 初始化进度条,这里的thumb值是归一后的值 /// </summary> /// <param name="title_IDS">Title_ identifier.</param> /// <param name="thumbValue1">Thumb value1.</param> /// <param name="thumbValue2">Thumb value2.</param> public void InitThumnb(string title_IDS, DefenceSliderType defenceSliderType, float thumbValue1, float thumbValue2, float originValue) { m_originValue = originValue; m_defenceSliderType = defenceSliderType; Title.text = LanguageTextManager.GetString(title_IDS); m_thumbValue1 = thumbValue1 * 0.01f; m_thumbValue2 = thumbValue2 * 0.01f; ThresholdThumb1.transform.localPosition = new Vector3(m_thumbValue1 * WidthFactor, 0, 0); ThresholdThumb2.transform.localPosition = new Vector3(m_thumbValue2 * WidthFactor, 0, 0); if (defenceSliderType != DefenceSliderType.DoorBlood) { PercentSymbal.gameObject.SetActive(false); } }
private void SliderFinish(DefenceSliderType defenceSliderType) { //进度条动画完成。播放下一个 switch (defenceSliderType) { case DefenceSliderType.DoorBlood: m_sliders[DefenceSliderType.DoubleHit].StartProcess(m_doubleHitVal); break; case DefenceSliderType.DoubleHit: m_sliders[DefenceSliderType.BeHit].StartProcess(m_beHitVal); break; case DefenceSliderType.BeHit: //完成,触发委托 if (SettleInfoComplete != null) { SettleInfoComplete(); } break; } }
private void SliderReachThreshold(DefenceSliderType defenceSliderType, bool threshold1, bool threshold2) { //计算评分 bool pinfenChanged = false; switch (defenceSliderType) { case DefenceSliderType.DoorBlood: if (threshold1 && threshold2) { m_spriteId++; pinfenChanged = true; } break; case DefenceSliderType.DoubleHit: if (threshold1) { if (threshold2) { m_spriteId++; pinfenChanged = true; } else { m_spriteId++; pinfenChanged = true; } } break; case DefenceSliderType.BeHit: if (threshold1) { if (threshold2) { m_spriteId++; pinfenChanged = true; } else { m_spriteId++; pinfenChanged = true; } } break; } if (pinfenChanged) { PinFenValue.ChangeSprite(m_spriteId); //特效 if (PinFenValueInstance == null) { PinFenValueInstance = NGUITools.AddChild(PinFenValue.transform.parent.gameObject, PinFenEff); PinFenValueInstance.transform.localPosition = PinFenValue.transform.localPosition; } else { PinFenValueInstance.SetActive(false); PinFenValueInstance.SetActive(true); } } }