From 9563747a2eff65237da40109d96a75466b878d25 Mon Sep 17 00:00:00 2001 From: A F <49113047+arty-F@users.noreply.github.com> Date: Wed, 29 May 2024 22:46:25 +0700 Subject: [PATCH] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 12330f7..649df88 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ public class TestClass using UniDI; ... [SerializeField] GameObject _gameObjectPrefab; -[SerializeField] MyComponent _typedPrefab; +[SerializeField] InjectedComponent _typedPrefab; ... //plain C# class injecting var csharpClass = new InjectedClass(); @@ -65,14 +65,14 @@ csharpClass.Inject(); //bad way GameObject component injecting var gameObjectInstance1 = Instantiate(_gameObjectPrefab); -gameObjectInstance1.GetComponent().Inject(); +gameObjectInstance1.GetComponent().Inject(); //good way GameObject component injecting var gameObjectInstance2 = Instantiate(_gameObjectPrefab); -gameObjectInstance2.Inject(Lifetime.Game); +gameObjectInstance2.Inject(Lifetime.Game); //best way GameObject component injecting -var typedInstance = Instantiate(_typedPrefab); +InjectedComponent typedInstance = Instantiate(_typedPrefab); typedInstance.Inject(Lifetime.Scene); ``` @@ -81,7 +81,7 @@ typedInstance.Inject(Lifetime.Scene); using UniDI; ... [SerializeField] GameObject _gameObjectPrefab; -[SerializeField] MyComponent _typedPrefab; +[SerializeField] ConsumerComponent _typedPrefab; ... //plain C# class resolving var csharpClass = new TestClass(); @@ -89,13 +89,13 @@ csharpClass.Resolve(); //bad way GameObject resolving GameObject gameObjectInstance1 = Instantiate(_gameObjectPrefab); -gameObjectInstance1.GetComponent().Resolve(); +gameObjectInstance1.GetComponent().Resolve(); //good way GameObject resolving -GameObject gameObjectInstance2 = _gameObjectPrefab.InstantiateResolve(); +GameObject gameObjectInstance2 = _gameObjectPrefab.InstantiateResolve(); //best way GameObject resolving -MyComponent typedInstance = _typedPrefab.InstantiateResolve(position, rotation); +ConsumerComponent typedInstance = _typedPrefab.InstantiateResolve(position, rotation); ``` ## Performance