@@ -30,8 +30,6 @@ namespace UnityEngine.InputSystem.Editor
30
30
internal class InputActionImporter : ScriptedImporter
31
31
{
32
32
private const int kVersion = 13 ;
33
- // Bump this whenever you make a breaking change to the on-disk JSON format
34
- private const int kJsonFormatVersion = 1 ;
35
33
36
34
[ SerializeField ] private bool m_GenerateWrapperCode ;
37
35
[ SerializeField ] private string m_WrapperCodePath ;
@@ -71,10 +69,10 @@ private static InputActionAsset CreateFromJson(AssetImportContext context)
71
69
asset . LoadFromJson ( content ) ;
72
70
73
71
// If this JSON was authored before we switched to enum-by-value, migrate it now
74
- if ( asset . m_Version < kJsonFormatVersion )
72
+ if ( asset . m_Version < kVersion )
75
73
{
76
74
MigrateAllEnumParams ( asset ) ;
77
- asset . m_Version = kJsonFormatVersion ;
75
+ asset . m_Version = kVersion ;
78
76
79
77
if ( ! EditorHelpers . WriteAsset ( context . assetPath , asset . ToJson ( ) ) )
80
78
context . LogImportError ( $ "Could not write migrated JSON to '{ context . assetPath } '") ;
@@ -133,7 +131,7 @@ private static InputActionAsset CreateFromJson(AssetImportContext context)
133
131
return asset ;
134
132
}
135
133
136
- static void MigrateAllEnumParams ( InputActionAsset asset )
134
+ internal static void MigrateAllEnumParams ( InputActionAsset asset )
137
135
{
138
136
foreach ( var map in asset . actionMaps )
139
137
{
@@ -176,7 +174,7 @@ static void MigrateAllEnumParams(InputActionAsset asset)
176
174
}
177
175
}
178
176
179
- static string PatchEnumArgs ( Type procType , string args )
177
+ internal static string PatchEnumArgs ( Type procType , string args )
180
178
{
181
179
var dict = args . Split ( new [ ] { ',' } , StringSplitOptions . RemoveEmptyEntries ) . Select ( p => p . Split ( '=' ) ) . ToDictionary ( kv => kv [ 0 ] , kv => kv [ 1 ] ) ;
182
180
var anyChanged = false ;
0 commit comments