@@ -12,20 +12,26 @@ public class ValueEditorBehaviour : EntryCollectionHud<ValueEntry>
12
12
[ SerializeField ]
13
13
private GameObject _prefabChildValue ;
14
14
15
+ private MainTimeLineBehaviour _mainTimeline ;
16
+
15
17
protected override GameObject CreateEntry ( List < ValueEntry > sortedEntries , int i )
16
18
{
17
19
ValueEntry entry = sortedEntries [ i ] ;
18
20
var entryName = entry . Label . Clone ( ) ;
19
21
var hasParent = entry . ParentEntry != null ;
20
22
var go = Instantiate ( hasParent ? _prefabChildValue : _prefabEmptyValue , _contentTransform . transform ) ;
21
- go . GetComponentInChildren < Button > ( ) . onClick . AddListener ( ( ) => RemoveEntry ( entry ) ) ;
23
+ go . GetComponentInChildren < Button > ( ) . onClick . AddListener ( ( ) =>
24
+ {
25
+ RemoveEntry ( entry ) ;
26
+ _mainTimeline . Redraw ( ) ;
27
+ } ) ;
22
28
var input = go . GetComponentInChildren < InputField > ( ) ;
23
29
if ( input != null )
24
30
{
25
31
input . SetTextWithoutNotify ( entry . Label ) ;
26
32
input . onEndEdit . AddListener ( ( s ) => Rename ( entry , s ) ) ;
27
33
}
28
- var type = ( ParameterType ) ( entry . Type % ( ( int ) ParameterType . POS + 1 ) ) ;
34
+ var type = ( ParameterType ) ( ( int ) entry . Type % ( ( int ) ParameterType . POS + 1 ) ) ;
29
35
GameObject field = null ;
30
36
switch ( type )
31
37
{
@@ -50,6 +56,12 @@ protected override GameObject CreateEntry(List<ValueEntry> sortedEntries, int i)
50
56
return go ;
51
57
}
52
58
59
+ public override void AddEntryAtCursor ( ParameterType entryType )
60
+ {
61
+ base . AddEntryAtCursor ( entryType ) ;
62
+ _mainTimeline . Redraw ( ) ;
63
+ }
64
+
53
65
private GameObject NewVec2Field ( ValueEntry entry , GameObject go )
54
66
{
55
67
GameObject field = Instantiate ( EntryHudScriptableObject . Vec2Field , go . transform ) ;
@@ -115,6 +127,7 @@ private GameObject NewNumField(ValueEntry entry, GameObject go)
115
127
private void Rename ( ValueEntry entry , string s )
116
128
{
117
129
entry . Label = s ;
130
+ _mainTimeline . Redraw ( ) ;
118
131
Redraw ( ) ;
119
132
}
120
133
@@ -123,14 +136,15 @@ protected override void DisplayDropDownMenu(Dropdown dropDown)
123
136
dropDown . AddOptions ( Enum . GetNames ( typeof ( ParameterType ) ) . ToList ( ) ) ;
124
137
dropDown . onValueChanged . AddListener ( ( i ) =>
125
138
{
126
- AddNewEntryAtCursor ( i ) ;
139
+ AddEntryAtCursor ( ( ParameterType ) i ) ;
127
140
UnlockCursorLine ( ) ;
128
141
Destroy ( dropDown . gameObject ) ;
129
142
} ) ;
130
143
}
131
144
132
145
internal override void SetEntries ( List < ValueEntry > timeLineEntries )
133
146
{
147
+ _mainTimeline = FindObjectOfType < MainTimeLineBehaviour > ( ) ;
134
148
_entryPrefabs = new GameObject [ ] {
135
149
_prefabEmptyValue ,
136
150
_prefabChildValue ,
0 commit comments