shields
This commit is contained in:
1 parent
01e7df7a14
commit
b65238e422
5 files changed
+53
-18
No files matched your search
@@ -2,9 +2,16 @@
|
||||
<Style src="project://database/Assets/Src/UI/TimingUi.uss?fileID=7433441132597879392&guid=cf92f075876ddf7ffb4cd5c59633ad7b&type=3#TimingUi" />
|
||||
<ui:VisualElement name="VisualElement" style="-unity-font: url('project://database/Assets/UI%20Toolkit/Fonts/Jura-Medium.otf?fileID=12800000&guid=65648a14640996362a6b0929c723b6e4&type=3#Jura-Medium'); -unity-font-definition: initial; flex-direction: row; flex-grow: 1;">
|
||||
<ui:VisualElement name="left" style="flex-grow: 1; background-color: rgba(0, 0, 0, 0); justify-content: center; align-items: center;" />
|
||||
<ui:VisualElement name="middle" style="flex-direction: row; flex-grow: 1; justify-content: center; align-self: center; margin-top: 20%; -unity-text-align: upper-center;">
|
||||
<ui:Label tabindex="-1" display-tooltip-when-elided="true" name="speed" style="min-width: 5%; -unity-text-align: upper-right; flex-basis: 10%;" />
|
||||
<ui:Label tabindex="-1" text="u/s" display-tooltip-when-elided="true" name="units" style="flex-basis: 10%; -unity-text-align: upper-left;" />
|
||||
<ui:VisualElement name="middle" style="justify-content: flex-end;">
|
||||
<ui:VisualElement name="speedCtr" style="flex-direction: row; justify-content: center;">
|
||||
<ui:Label tabindex="-1" display-tooltip-when-elided="true" name="speed" style="min-width: 5%; -unity-text-align: upper-right; flex-basis: 10%;" />
|
||||
<ui:Label tabindex="-1" text="u/s" display-tooltip-when-elided="true" name="units" style="flex-basis: 10%; -unity-text-align: upper-left;" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="shieldCtr" style="align-items: center; flex-direction: row; justify-content: center;">
|
||||
<ui:Label tabindex="-1" display-tooltip-when-elided="true" name="shields" text="100" style="min-width: 5%; -unity-text-align: upper-right; flex-basis: 10%;" />
|
||||
<ui:Label tabindex="-1" text="%" display-tooltip-when-elided="true" name="units" style="flex-basis: 10%; -unity-text-align: upper-left;" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="middleBottom" style="flex-grow: 0; background-color: rgba(0, 0, 0, 0); flex-shrink: 0; flex-basis: 20%;" />
|
||||
</ui:VisualElement>
|
||||
<ui:VisualElement name="right" style="flex-grow: 1; background-color: rgba(0, 0, 0, 0); justify-content: center; align-items: center;" />
|
||||
</ui:VisualElement>
|
||||
|
||||
@@ -11,6 +11,7 @@ public class ControlsUI : MonoBehaviour {
|
||||
|
||||
UIDocument uiDocument;
|
||||
Label speed;
|
||||
Label shields;
|
||||
|
||||
void OnEnable() {
|
||||
Init();
|
||||
@@ -19,6 +20,7 @@ public class ControlsUI : MonoBehaviour {
|
||||
void Init() {
|
||||
uiDocument = GetComponent<UIDocument>();
|
||||
speed = uiDocument.rootVisualElement.Q<Label>("speed");
|
||||
shields = uiDocument.rootVisualElement.Q<Label>("shields");
|
||||
}
|
||||
|
||||
void FixedUpdate() {
|
||||
@@ -29,5 +31,6 @@ public class ControlsUI : MonoBehaviour {
|
||||
}
|
||||
|
||||
speed.text = $"{ship.Speed():0}";
|
||||
shields.text = ship.Shields;
|
||||
}
|
||||
}
|
||||
@@ -39,3 +39,12 @@
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.timingMiddle {
|
||||
flex-direction: row;
|
||||
flex-grow: 1;
|
||||
justify-content: center;
|
||||
align-self: center;
|
||||
margin-top: 20%;
|
||||
-unity-text-align: upper-center;
|
||||
}
|
||||
Reference in new issue
Block a user