Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues/118 Optimize StateEditor #120

Merged
merged 12 commits into from
Oct 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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