don't add label to crosshair
This commit is contained in:
1 parent
6b3f1f5338
commit
7d155b17b6
3 files changed
+13
-9
No files matched your search
@@ -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">
|
<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&guid=48feeaa21d44b719b9ecf7857f06e39c&type=3#CrosshairComponents" />
|
||||||
<ui:VisualElement style="flex-grow: 1; background-color: rgba(0, 0, 0, 0);">
|
<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:VisualElement>
|
||||||
</ui:UXML>
|
</ui:UXML>
|
||||||
@@ -14,6 +14,9 @@ namespace CrosshairComponents {
|
|||||||
}
|
}
|
||||||
public new class UxmlFactory : UxmlFactory<ThreeArmCrosshair, UxmlTraits> { }
|
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_TrackColor = new CustomStyleProperty<Color>("--track-color");
|
||||||
static CustomStyleProperty<Color> s_ProgressColor = new CustomStyleProperty<Color>("--progress-color");
|
static CustomStyleProperty<Color> s_ProgressColor = new CustomStyleProperty<Color>("--progress-color");
|
||||||
|
|
||||||
@@ -39,8 +42,10 @@ namespace CrosshairComponents {
|
|||||||
|
|
||||||
public ThreeArmCrosshair() {
|
public ThreeArmCrosshair() {
|
||||||
// Create a Label, add a USS class name, and add it to this visual tree.
|
// Create a Label, add a USS class name, and add it to this visual tree.
|
||||||
m_Label = new Label();
|
// m_Label = new Label();
|
||||||
Add(m_Label);
|
// m_Label.AddToClassList(ussLabelClassName);
|
||||||
|
AddToClassList(ussClassName);
|
||||||
|
// Add(m_Label);
|
||||||
|
|
||||||
// Register a callback after custom style resolution.
|
// Register a callback after custom style resolution.
|
||||||
RegisterCallback<CustomStyleResolvedEvent>(evt => CustomStylesResolved(evt));
|
RegisterCallback<CustomStyleResolvedEvent>(evt => CustomStylesResolved(evt));
|
||||||
@@ -113,7 +118,6 @@ namespace CrosshairComponents {
|
|||||||
}
|
}
|
||||||
public new class UxmlFactory : UxmlFactory<FourArmCrosshair, UxmlTraits> { }
|
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 ussClassName = "crosshair";
|
||||||
public static readonly string ussLabelClassName = "crosshair__label";
|
public static readonly string ussLabelClassName = "crosshair__label";
|
||||||
|
|
||||||
@@ -141,9 +145,10 @@ namespace CrosshairComponents {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public FourArmCrosshair() {
|
public FourArmCrosshair() {
|
||||||
// Create a Label, add a USS class name, and add it to this visual tree.
|
// m_Label = new Label();
|
||||||
m_Label = new Label();
|
// m_Label.AddToClassList(ussLabelClassName);
|
||||||
Add(m_Label);
|
AddToClassList(ussClassName);
|
||||||
|
// Add(m_Label);
|
||||||
|
|
||||||
// Register a callback after custom style resolution.
|
// Register a callback after custom style resolution.
|
||||||
RegisterCallback<CustomStyleResolvedEvent>(evt => CustomStylesResolved(evt));
|
RegisterCallback<CustomStyleResolvedEvent>(evt => CustomStylesResolved(evt));
|
||||||
|
|||||||
Reference in new issue
Block a user