Skip to content

Commit

Permalink
Merge pull request #120 from /issues/118
Browse files Browse the repository at this point in the history
Issues/118 Optimize StateEditor
  • Loading branch information
mattak authored Oct 29, 2017
2 parents ec29ec2 + 04817a3 commit 7cc805d
Show file tree
Hide file tree
Showing 12 changed files with 759 additions and 409 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Unidux.Example.Middlewares
{
public class Unidux : SingletonMonoBehaviour<Unidux>
public class Unidux : SingletonMonoBehaviour<Unidux>, IStoreAccessor
{
public TextAsset InitialStateJson;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void Start()

void Render(State state)
{
this.GetComponent<Text>().text = state.Page.CurrentPage.ToString();
this.GetComponent<Text>().text = state.Page.Current.Page.ToString();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void Start()

void UpdateScene(State state)
{
if (state.Scene.NeedsAdjust(config.GetPageScenes(), config.PageMap[state.Page.CurrentPage]))
if (state.Scene.NeedsAdjust(config.GetPageScenes(), config.PageMap[state.Page.Current.Page]))
{
Unidux.Dispatch(PageDuck<Page, Scene>.ActionCreator.Adjust());
}
Expand Down
19 changes: 0 additions & 19 deletions Assets/Plugins/Unidux/Examples/SimpleHttp/Scripts/State.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,5 @@ public partial class State : StateBase
public string Url = "";
public int StatusCode = -1;
public string Body = "";

public override bool Equals(object obj)
{
if (obj is State)
{
var target = (State) obj;
return
this.Url == target.Url &&
this.StatusCode == target.StatusCode &&
this.Body == target.Body;
}

return false;
}

public override int GetHashCode()
{
return base.GetHashCode();
}
}
}
Loading

0 comments on commit 7cc805d

Please sign in to comment.