@@ -856,7 +856,7 @@ public void Main()
856
856
if ( nextColumn == null )
857
857
{
858
858
context . columns = ArrayHelper . Add ( context . columns , new Column ( context . columns . Length , Controller . Instance . Options ) ) ;
859
- nextColumn = context . columns [ context . columns . Length ] ;
859
+ nextColumn = context . columns [ context . columns . Length - 1 ] ;
860
860
}
861
861
862
862
// Create a new message.
@@ -1061,22 +1061,20 @@ private void Sidebar()
1061
1061
EditorGUILayout . Separator ( ) ;
1062
1062
GUILayout . Label ( "Message attributes (most influence in): " ) ;
1063
1063
1064
- foreach ( string attrName in Controller . Instance . Options . attributes )
1064
+ foreach ( var attrName in Controller . Instance . Options . attributes )
1065
1065
{
1066
- for ( int i = 0 ; i < message . attributes . Length ; i ++ )
1066
+ for ( var i = 0 ; i < message . attributes . Length ; i ++ )
1067
1067
{
1068
1068
if ( message . attributes [ i ] . key == attrName )
1069
- {
1070
1069
break ;
1071
- }
1072
- else if ( i == message . attributes . Length - 1 )
1073
- {
1070
+ if ( i == message . attributes . Length - 1 )
1074
1071
message . attributes = ArrayHelper . Add ( message . attributes , new AttributeDictionary ( attrName ) ) ;
1075
- }
1076
1072
}
1073
+ if ( message . attributes . Length == 0 )
1074
+ message . attributes = ArrayHelper . Add ( message . attributes , new AttributeDictionary ( attrName ) ) ;
1077
1075
}
1078
1076
1079
- for ( int i = 0 ; i < message . attributes . Length ; i ++ )
1077
+ for ( var i = 0 ; i < message . attributes . Length ; i ++ )
1080
1078
{
1081
1079
message . attributes [ i ] . value =
1082
1080
( byte ) EditorGUILayout . Slider ( message . attributes [ i ] . key , message . attributes [ i ] . value , 0 , 100 ) ;
0 commit comments