File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Packages/com.unity.inputsystem/InputSystem/Actions Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -314,9 +314,10 @@ static class JsonVersion
314
314
/// <seealso cref="FromJson"/>
315
315
public string ToJson ( )
316
316
{
317
+ var hasContent = ( m_ActionMaps ? . Length ?? 0 ) > 0 || ( m_ControlSchemes ? . Length ?? 0 ) > 0 ;
317
318
return JsonUtility . ToJson ( new WriteFileJson
318
319
{
319
- version = JsonVersion . Current ,
320
+ version = hasContent ? JsonVersion . Current : null ,
320
321
name = name ,
321
322
maps = InputActionMap . WriteFileJson . FromMaps ( m_ActionMaps ) . maps ,
322
323
controlSchemes = InputControlScheme . SchemeJson . ToJson ( m_ControlSchemes ) ,
@@ -974,7 +975,7 @@ private void OnDestroy()
974
975
[ Serializable ]
975
976
internal struct WriteFileJson
976
977
{
977
- public int version ;
978
+ public int ? version ;
978
979
public string name ;
979
980
public InputActionMap . WriteMapJson [ ] maps ;
980
981
public InputControlScheme . SchemeJson [ ] controlSchemes ;
You can’t perform that action at this time.
0 commit comments