public override void OnInspectorGUI() { base.OnInspectorGUI(); ZoomNumber g = target as ZoomNumber; if (g.gameObject.activeSelf == false) { return; } int newV = EditorGUILayout.IntField("值", g.GetValue()); if (newV != g.GetValue()) { g.SetValue(newV); } if (GUILayout.Button("增加1", GUILayout.Height(50))) { g.Add(); } }
/// <summary> /// 设置箭头,计算分数 /// </summary> /// <param name="type"></param> void SetArrowResult(Global.TIMING_JUAGE_TYPE type, Arrow arrow, bool isMainBeat = true) { switch (type) { case Global.TIMING_JUAGE_TYPE.BAD: Sounder.instance.Play("BAD音效"); break; } if (arrow.isLastOne) { bool end = true; if (arrow is LongPressArrow) { LongPressArrow longPress = arrow as LongPressArrow; switch (longPress.subState) { case Arrow.STATE.PRESSING: case Arrow.STATE.READY: end = false; break; } } if (hp > 0 && end) { ClearnArrow(); Eff.instance.lastHit.SetActive(true); BeatGame.instance.ArrowComplete(); } } if (type != Global.TIMING_JUAGE_TYPE.MISS) { int comboTime = combo.GetCount(); GetComponent <AudioSource>().volume = comboTime < 10 ? 0.7f : 1; if (isMainBeat) { GetComponent <AudioSource>().PlayOneShot(leftRightClip); } } timingJudge.Show(type); if (type < Global.TIMING_JUAGE_TYPE.BAD) { AddCombo(type); BeatLight bl = null; switch (arrow.songTime.direction) { case SongInfo.DIRECTION.LEFT: bl = leftLight; break; case SongInfo.DIRECTION.RIGHT: bl = rightLight; break; case SongInfo.DIRECTION.UP: bl = upLight; break; case SongInfo.DIRECTION.DOWN: bl = downLight; break; } bl.Show(); Eff.instance.ScreenHit(arrow.songTime.direction); } else { //道具 if (correctProp != null && DataUtils.mode == Global.MODE.MODE_1P) { if (correctProp.Use()) { Sounder.instance.Play("道具消耗音效"); AddCombo(Global.TIMING_JUAGE_TYPE.PREFECT); Eff.instance.ScreenHit(arrow.songTime.direction); type = Global.TIMING_JUAGE_TYPE.PREFECT; } else { combo.Reset(); } } else { combo.Reset(); } switch (type) { case Global.TIMING_JUAGE_TYPE.BAD: mark += 5; //bad加5 break; case Global.TIMING_JUAGE_TYPE.MISS: RefreshHP(); break; } } scoreData.AddJuade(info.data, type); markText.SetValue(mark); }