added: revive ui bar

This commit is contained in:
Chris
2025-10-22 11:24:51 -04:00
parent bd97b3eeb5
commit eb1622d4ed
3 changed files with 74 additions and 0 deletions

View File

@@ -149,6 +149,29 @@ namespace Reset.Units{
Color.orchid);
}
}
[Rpc(SendTo.Everyone)]
public void DrawReviveBarRpc(float elapsedTime){
Debug.Log("test is drawn");
using (Draw.ingame.WithLineWidth(5f)) {
using (Draw.InLocalSpace(transform)){
float width = .9f;
float widthDone = width * elapsedTime / 5f;
widthDone = Mathf.Clamp(widthDone, 0, width);
Vector3 pos = Vector3.up * 1.8f + Vector3.left * width + Vector3.forward * .01f;
Draw.ingame.Line(Camera.main.transform.rotation * pos, Camera.main.transform.rotation *
(pos + Vector3.right * width * 2f), Color.rebeccaPurple);
Vector3 donePos = Vector3.up * 1.8f + Vector3.left * widthDone;
Draw.ingame.Line(Camera.main.transform.rotation * donePos, Camera.main.transform.rotation *
(donePos + Vector3.right * widthDone * 2f), Color.red);
}
}
lastKnownReviveTime = elapsedTime;
}
void LateUpdate(){
// Clear the pickupTarget every frame