Skip to content

Commit

Permalink
Merge pull request #32 from /issues/31
Browse files Browse the repository at this point in the history
SingletonMonoBehaviour be virtual Awake method
  • Loading branch information
mattak authored Jun 28, 2016
2 parents cd52a9a + deeaa96 commit a63b5a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Assets/Unidux/SingletonMonoBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static T Instance
}
}

protected void Awake()
protected virtual void Awake()
{
CheckInstance();
}
Expand Down
3 changes: 2 additions & 1 deletion Assets/UniduxExample/Counter/Scripts/Unidux.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ public class Unidux : SingletonMonoBehaviour<Unidux>
{
public Store<State> Store { get; private set; }

void Awake()
protected override void Awake()
{
base.Awake();
this.Store = new Store<State>();
this.Store.AddReducer<CountAction>(CountReducer.Reduce);
}
Expand Down
3 changes: 2 additions & 1 deletion Assets/UniduxExample/List/Scripts/Unidux.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ public class Unidux : SingletonMonoBehaviour<Unidux>
{
public Store<State> Store { get; private set; }

void Awake()
protected override void Awake()
{
base.Awake();
this.Store = new Store<State>();
this.Store.AddReducer<ListAddAction>(ListReducer.Reduce);
}
Expand Down

0 comments on commit a63b5a5

Please sign in to comment.