-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed json serializer implementation
- Loading branch information
Showing
11 changed files
with
72 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace SaveSystemPackage { | ||
|
||
[Serializable] | ||
public struct SerializableKeyValuePair<TKey, TValue> { | ||
|
||
[SerializeField] | ||
private TKey key; | ||
|
||
[SerializeField] | ||
private TValue value; | ||
|
||
|
||
public SerializableKeyValuePair (TKey key, TValue value) { | ||
this.key = key; | ||
this.value = value; | ||
} | ||
|
||
|
||
public static implicit operator KeyValuePair<TKey, TValue> (SerializableKeyValuePair<TKey, TValue> item) { | ||
return new KeyValuePair<TKey, TValue>(item.key, item.value); | ||
} | ||
|
||
|
||
public static implicit operator SerializableKeyValuePair<TKey, TValue> (KeyValuePair<TKey, TValue> item) { | ||
return new SerializableKeyValuePair<TKey, TValue>(item.Key, item.Value); | ||
} | ||
|
||
|
||
public void Deconstruct (out TKey key, out TValue value) { | ||
key = this.key; | ||
value = this.value; | ||
} | ||
|
||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters