don't add label to crosshair

This commit is contained in:
ntr committed 2023-08-08 18:18:27 +10:00
1 parent b65238e422
commit ef03905f9c
3 files changed
+13 -9

No files matched your search

+2 -1
View File
@@ -1,5 +1,6 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" editor-extension-mode="False">
<Style src="project://database/Assets/Src/UI/CrosshairComponents.uss?fileID=7433441132597879392&amp;guid=48feeaa21d44b719b9ecf7857f06e39c&amp;type=3#CrosshairComponents" />
<ui:VisualElement style="flex-grow: 1; background-color: rgba(0, 0, 0, 0);">
<CrosshairComponents.FourArmCrosshair style="width: 100%; height: 100%;" />
<CrosshairComponents.FourArmCrosshair />
</ui:VisualElement>
</ui:UXML>
+11 -6
View File
@@ -14,6 +14,9 @@ namespace CrosshairComponents {
}
public new class UxmlFactory : UxmlFactory<ThreeArmCrosshair, UxmlTraits> { }
public static readonly string ussClassName = "crosshair";
public static readonly string ussLabelClassName = "crosshair__label";
static CustomStyleProperty<Color> s_TrackColor = new CustomStyleProperty<Color>("--track-color");
static CustomStyleProperty<Color> s_ProgressColor = new CustomStyleProperty<Color>("--progress-color");
@@ -39,8 +42,10 @@ namespace CrosshairComponents {
public ThreeArmCrosshair() {
// Create a Label, add a USS class name, and add it to this visual tree.
m_Label = new Label();
Add(m_Label);
// m_Label = new Label();
// m_Label.AddToClassList(ussLabelClassName);
AddToClassList(ussClassName);
// Add(m_Label);
// Register a callback after custom style resolution.
RegisterCallback<CustomStyleResolvedEvent>(evt => CustomStylesResolved(evt));
@@ -113,7 +118,6 @@ namespace CrosshairComponents {
}
public new class UxmlFactory : UxmlFactory<FourArmCrosshair, UxmlTraits> { }
// These are USS class names for the control overall and the label.
public static readonly string ussClassName = "crosshair";
public static readonly string ussLabelClassName = "crosshair__label";
@@ -141,9 +145,10 @@ namespace CrosshairComponents {
}
public FourArmCrosshair() {
// Create a Label, add a USS class name, and add it to this visual tree.
m_Label = new Label();
Add(m_Label);
// m_Label = new Label();
// m_Label.AddToClassList(ussLabelClassName);
AddToClassList(ussClassName);
// Add(m_Label);
// Register a callback after custom style resolution.
RegisterCallback<CustomStyleResolvedEvent>(evt => CustomStylesResolved(evt));
-2
View File
@@ -1,7 +1,5 @@
# SpaceRace!
- shields
- power units
- tab through outputs
- accel