Continued
This commit is contained in:
@@ -27,6 +27,8 @@ namespace ProjectM.Client
|
||||
Text _phaseText;
|
||||
Text _resourceText;
|
||||
Text _locationText;
|
||||
RectTransform _goalFill;
|
||||
Text _goalText;
|
||||
GameObject _respawnOverlay;
|
||||
EntityQuery _huskQuery;
|
||||
|
||||
@@ -81,6 +83,13 @@ namespace ProjectM.Client
|
||||
_locationText.color = onExpedition ? new Color(1f, 0.8f, 0.4f) : new Color(0.6f, 0.85f, 1f);
|
||||
}
|
||||
|
||||
if (_goalFill != null && SystemAPI.TryGetSingleton<GoalProgress>(out var goal))
|
||||
{
|
||||
float gfrac = goal.Target > 0 ? Mathf.Clamp01(goal.Charge / (float)goal.Target) : 0f;
|
||||
SetFill(_goalFill, gfrac);
|
||||
if (_goalText != null) _goalText.text = "GOAL " + goal.Charge + " / " + goal.Target;
|
||||
}
|
||||
|
||||
if (_resourceText != null)
|
||||
{
|
||||
string res = "";
|
||||
@@ -211,6 +220,12 @@ namespace ProjectM.Client
|
||||
var lrt = _locationText.rectTransform;
|
||||
lrt.anchorMin = new Vector2(0.5f, 1f); lrt.anchorMax = new Vector2(0.5f, 1f); lrt.pivot = new Vector2(0.5f, 1f);
|
||||
lrt.anchoredPosition = new Vector2(0, -96); lrt.sizeDelta = new Vector2(760, 36);
|
||||
// Goal progress bar (top-center, below the location line).
|
||||
var goalBg = MakeBar("GoalBg", _canvas.transform, new Color(0f, 0f, 0f, 0.55f), Vector2.zero, new Vector2(360, 16));
|
||||
goalBg.anchorMin = new Vector2(0.5f, 1f); goalBg.anchorMax = new Vector2(0.5f, 1f); goalBg.pivot = new Vector2(0.5f, 1f);
|
||||
goalBg.anchoredPosition = new Vector2(0, -126); goalBg.sizeDelta = new Vector2(360, 16);
|
||||
_goalFill = MakeFill("GoalFill", goalBg, new Color(0.8f, 0.6f, 1f));
|
||||
_goalText = MakeText("GoalText", goalBg, "GOAL 0 / 10", 15, TextAnchor.MiddleCenter, Color.white, font);
|
||||
|
||||
// Downed / respawning overlay (full screen, toggled by Dead).
|
||||
_respawnOverlay = new GameObject("RespawnOverlay", typeof(RectTransform));
|
||||
|
||||
Reference in New Issue
Block a user