Skip to content

Commit

Permalink
Added package v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dancher743 committed Apr 3, 2024
1 parent f2f6dee commit fb73748
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Implement `IModel` interface to create a _Model_ -
```
public class CubeModel : IModel
{
...
// ...
}
```

Expand All @@ -32,7 +32,7 @@ Implement `IView` interface to create a _View_ -
```
public class CubeView : MonoBehaviour, IView
{
...
// ...
}
```

Expand All @@ -50,23 +50,26 @@ public class CubePresenter : Presenter<CubeView, CubeModel>
{
public CubePresenter(CubeView cubeView, CubeModel cubeModel) : base(cubeView, cubeModel)
{
...
// ...
}
}
```

At this point we're done with the main components of MVP - `CubeModel`, `CubeView` and `CubePresenter`!

Instantiating
Instancing
---
To create an instance of a `Presenter` use `Create<TPresenter>()` method in `PresenterFactory` -

```
[SerializeField]
private CubeView cubeView;
// ...
private CubePresenter cubePresenter;
...
// ...
void Start()
{
Expand Down Expand Up @@ -106,7 +109,7 @@ In the example we have `UIPresenter` -
```
public class UIPresenter : Presenter<UIView, UIModel>, IMessageSubscriber
{
...
// ...
void IMessageSubscriber.ReceiveMessage<TMessage>(TMessage message)
{
Expand All @@ -132,7 +135,7 @@ In the example where `CubePresenter` class is -
```
public class CubePresenter : Presenter<CubeView, CubeModel>
{
...
// ...
private void OnModelColorChanged(Color color)
{
Expand Down Expand Up @@ -162,10 +165,12 @@ In the example, inside of `EntryPoint.OnDestroy()` method `Clear` is used to fre
```
public class EntryPoint : MonoBehaviour
{
// ...
private CubePresenter cubePresenter;
private UIPresenter UIPresenter;
...
// ...
private void OnDestroy()
{
Expand Down
Binary file removed unity-mvp-1.0.1.unitypackage
Binary file not shown.
Binary file added unity-mvp-1.1.0.unitypackage
Binary file not shown.

0 comments on commit fb73748

Please sign in to comment.