-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStyleRuleSelector.cs
More file actions
43 lines (36 loc) · 1017 Bytes
/
StyleRuleSelector.cs
File metadata and controls
43 lines (36 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using CodeName.Styling.MatchConditions;
using JetBrains.Annotations;
using Sirenix.OdinInspector;
using UnityEngine;
namespace CodeName.Styling
{
[Serializable]
public class StyleRuleSelector<T>
{
private const int LabelWidth = 45;
[LabelWidth(LabelWidth)]
[SerializeField] private T value;
[UsedImplicitly]
[LabelWidth(LabelWidth)]
[Tooltip("Notes and comments about how this selector is used.")]
[SerializeField] private string notes;
[HideLabel]
[InlineProperty]
[SerializeField] private CompositeMatchCondition condition = new();
public T Value
{
get => value;
set => this.value = value;
}
public CompositeMatchCondition Condition
{
get => condition;
set => condition = value;
}
public bool IsMatch(IStyleClassNode node)
{
return condition.IsMatch(node);
}
}
}