Skip to content

Commit

Permalink
issues/21 fix(VersionComponents): change initiation point on runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
mattak committed May 6, 2017
1 parent 2286d3a commit ef47a43
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Assets/Plugins/Unicache/Examples/Versioning/VersionComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public class VersionComponents : MonoBehaviour, IUnicacheGetter
public Button ClearButton;
public RawImage Image;

private IUnicache cache = new FileCache();
private IUnicache _cache;
private int count = 0;

public IUnicache Cache
{
get { return this.cache; }
get { return this._cache = this._cache ?? new FileCache(); }
}

private Dictionary<string, string> versionMap = new Dictionary<string, string>()
Expand All @@ -29,9 +29,9 @@ public IUnicache Cache

void Start()
{
this.cache.CacheLocator = new VersionCacheLocator(this.versionMap);
this.cache.Handler = new SimpleDownloadHandler();
this.cache.UrlLocator = new VersionUrlLocator();
this.Cache.CacheLocator = new VersionCacheLocator(this.versionMap);
this.Cache.Handler = new SimpleDownloadHandler();
this.Cache.UrlLocator = new VersionUrlLocator();

this.DownloadButton.onClick.AddListener(this.Download);
this.VersionUpButton.onClick.AddListener(this.VersionUp);
Expand All @@ -42,7 +42,7 @@ void Start()

void Download()
{
this.cache.Fetch("cachepig")
this.Cache.Fetch("cachepig")
.ByteToTexture2D(name: "cachepig")
.Subscribe(texture =>
{
Expand Down

0 comments on commit ef47a43

Please sign in to comment.