-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Layout problem fix for Unity 2022 and above
- Loading branch information
1 parent
a9eee90
commit 1830e76
Showing
9 changed files
with
470 additions
and
460 deletions.
There are no files selected for viewing
File renamed without changes.
808 changes: 404 additions & 404 deletions
808
Assets/Scenes/GameScene.unity → ...rializableDictionary/Demo/DemoScene.unity
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
Assets/Scenes/GameScene.unity.meta → ...zableDictionary/Demo/DemoScene.unity.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
56 changes: 56 additions & 0 deletions
56
Assets/Plugins/SerializableDictionary/Demo/Scripts/Example.cs
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,56 @@ | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
|
||
namespace ProjectTools.Demo | ||
{ | ||
public interface MyTestInterface | ||
{ | ||
void TestMethod(); | ||
} | ||
|
||
public class Example : MonoBehaviour, MyTestInterface | ||
{ | ||
[SerializeField] private Text GeorgeLabel; | ||
[SerializeField] private Image GeorgeImage; | ||
|
||
[SerializeField] private Text ThemisLabel; | ||
[SerializeField] private Image ThemisImage; | ||
|
||
[SerializeField] private SerializableDictionary<int, string> intToStringDictionary; | ||
[SerializeField] private SerializableDictionary<string, Color> stringToColorDictionary; | ||
[SerializeField] private SerializableDictionary<string, int[]> stringToIntArrayDictionary; | ||
|
||
[SerializeField] private InterfaceHolder<MyTestInterface> serializedInterface; | ||
|
||
[SerializeField] private SerializableDictionary<string, InterfaceHolder<MyTestInterface>> stringToInterfaceDictionary; | ||
|
||
private const string GeorgeName = "George"; | ||
private const string ThemisName = "Themis"; | ||
|
||
private void Start() | ||
{ | ||
TestSetup(); | ||
serializedInterface.Value.TestMethod(); | ||
} | ||
|
||
public void TestSetup() | ||
{ | ||
GeorgeLabel.text = intToStringDictionary[0]; | ||
ThemisLabel.text = intToStringDictionary[1]; | ||
|
||
GeorgeImage.color = stringToColorDictionary[GeorgeName]; | ||
ThemisImage.color = stringToColorDictionary[ThemisName]; | ||
} | ||
|
||
[ContextMenu("Call")] | ||
public void CallTestMethodOfInterface() | ||
{ | ||
stringToInterfaceDictionary["interface_1"].Value.TestMethod(); | ||
} | ||
|
||
public void TestMethod() | ||
{ | ||
Debug.Log($"Test method call from {this}"); | ||
} | ||
} | ||
} |
File renamed without changes.
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 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