This commit is contained in:
ntr committed 2023-08-22 00:12:06 +10:00
1 parent 331e811e2d
commit fd985dd489
25 files changed
+1462 -235

No files matched your search

+15 -6
View File
@@ -1,4 +1,10 @@
class InterfaceIcon : VisualElement {
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
public class InterfaceIcon : VisualElement {
public enum Icon {
// Outputs
Acceleration,
@@ -23,9 +29,12 @@ class InterfaceIcon : VisualElement {
}
static readonly Dictionary<Icon, char> _iconGlyphMap = new() {
{ Icon.CandyCane, '\uf786' },
{ Icon.Sleigh, '\uf7cc' },
{ Icon.Snowflake, '\uf2dc' },
{ Icon.Acceleration, '\ue901' },
{ Icon.Deceleration, '\ue902' },
{ Icon.Strafing, '\ue903' },
{ Icon.Shield, '\ue904' },
{ Icon.Logo, '\ue900' },
};
public Icon icon {
@@ -39,12 +48,12 @@ class InterfaceIcon : VisualElement {
Icon _icon;
Label _iconLabel;
public InterfaceIcon() : this(Icon.CandyCane) {}
public InterfaceIcon() : this(Icon.Strafing) {}
public InterfaceIcon(Icon icon) {
_iconLabel = new Label {
style = {
unityFont = Resources.Load<Font>("fontawesome-solid"),
unityFont = Resources.Load<Font>("SpaceRace-Icons"),
unityFontDefinition = StyleKeyword.None,
},
};