private void DrawFighter(Fighter fighter) { Rect labelRect = new Rect(0, Screen.height * 0.86f, Screen.width * 0.22f, 50); if (fighter.IsFaceRight) { labelRect.x = Screen.width * 0.01f; debugTextStyle.alignment = TextAnchor.UpperLeft; } else { labelRect.x = Screen.width * 0.77f; debugTextStyle.alignment = TextAnchor.UpperRight; } GUI.Label(labelRect, fighter.Position.ToString(), debugTextStyle); labelRect.y += Screen.height * 0.03f; int frameAdvantage = battleCore.GetFrameAdvantage(fighter.IsFaceRight); string frameAdvText = frameAdvantage > 0 ? $"+{frameAdvantage}" : frameAdvantage.ToString(); GUI.Label( labelRect, $"Frame: {fighter.CurrentActionFrame}/{fighter.CurrentActionFrameCount}({frameAdvText})", debugTextStyle ); labelRect.y += Screen.height * 0.03f; GUI.Label(labelRect, $"Stun: {fighter.CurrentHitStunFrame}", debugTextStyle); labelRect.y += Screen.height * 0.03f; GUI.Label( labelRect, $"Action: {fighter.CurrentActionID} {(CommonActionID) fighter.CurrentActionID}", debugTextStyle ); foreach (Hurtbox hurtbox in fighter.Hurtboxes) { DrawFightBox(hurtbox.Rect, Color.yellow, true); } if (fighter.Pushbox != null) { DrawFightBox(fighter.Pushbox.Rect, Color.blue, true); } foreach (Hitbox hitbox in fighter.Hitboxes) { if (hitbox.Proximity) { DrawFightBox(hitbox.Rect, Color.gray, true); } else { DrawFightBox(hitbox.Rect, Color.red, true); } } }
void DrawFighter(Fighter fighter) { var labelRect = new Rect(0, Screen.height * 0.86f, Screen.width * 0.22f, 50); if (fighter.isFaceRight) { labelRect.x = Screen.width * 0.01f; debugTextStyle.alignment = TextAnchor.UpperLeft; } else { labelRect.x = Screen.width * 0.77f; debugTextStyle.alignment = TextAnchor.UpperRight; } GUI.Label(labelRect, fighter.position.ToString(), debugTextStyle); labelRect.y += Screen.height * 0.03f; var frameAdvantage = battleCore.GetFrameAdvantage(fighter.isFaceRight); var frameAdvText = frameAdvantage > 0 ? "+" + frameAdvantage : frameAdvantage.ToString(); GUI.Label(labelRect, "Frame: " + fighter.currentActionFrame + "/" + fighter.currentActionFrameCount + "(" + frameAdvText + ")", debugTextStyle); labelRect.y += Screen.height * 0.03f; GUI.Label(labelRect, "Stun: " + fighter.currentHitStunFrame, debugTextStyle); labelRect.y += Screen.height * 0.03f; GUI.Label(labelRect, "Action: " + fighter.currentActionID + " " + (CommonActionID)fighter.currentActionID, debugTextStyle); foreach (var hurtbox in fighter.hurtboxes) { DrawFightBox(hurtbox.rect, Color.yellow, true); } if (fighter.pushbox != null) { DrawFightBox(fighter.pushbox.rect, Color.blue, true); } foreach (var hitbox in fighter.hitboxes) { if (hitbox.proximity) { DrawFightBox(hitbox.rect, Color.gray, true); } else { DrawFightBox(hitbox.rect, Color.red, true); } } }